mirror of https://gitee.com/openkylin/libvirt.git
Fix libnuma use to build with v1 compatability code
This commit is contained in:
parent
a9567e09ef
commit
c23ff311fc
|
@ -1,3 +1,11 @@
|
|||
Fri Nov 28 11:17:40 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* libvirt.spec.in: Add missing numa-ctl BuildRequires
|
||||
* qemud/Makefile.am: Fix libvirtd_DEPENDANCIES to include all libs
|
||||
* src/qemu_conf.c, src/qemu_driver.c, src/uml_conf.c,
|
||||
src/uml_driver.c: Define NUMA_VERSION1_COMPATIBILITY and
|
||||
fix size of array used to get node mapping
|
||||
|
||||
Fri Nov 28 08:40:00 CET 2008 Chris Lalancette <clalance@redhat.com>
|
||||
* src/storage_backend.c: Wait up to 5 seconds for
|
||||
/dev/disk/by-{id,path} to exist in virStorageBackendStablePath
|
||||
|
|
|
@ -124,6 +124,8 @@ BuildRequires: lvm2
|
|||
BuildRequires: iscsi-initiator-utils
|
||||
# For disk driver
|
||||
BuildRequires: parted-devel
|
||||
# For QEMU/LXC numa info
|
||||
BuildRequires: numactl-devel
|
||||
Obsoletes: libvir
|
||||
|
||||
# Fedora build root suckage
|
||||
|
|
|
@ -87,7 +87,6 @@ libvirtd_LDFLAGS = \
|
|||
$(COVERAGE_LDFLAGS) \
|
||||
$(POLKIT_LIBS)
|
||||
|
||||
libvirtd_DEPENDENCIES = ../src/libvirt.la
|
||||
libvirtd_LDADD = \
|
||||
../gnulib/lib/libgnu.la
|
||||
|
||||
|
@ -129,6 +128,9 @@ libvirtd_CFLAGS += $(AVAHI_CFLAGS)
|
|||
libvirtd_LDADD += $(AVAHI_LIBS)
|
||||
endif
|
||||
|
||||
libvirtd_DEPENDENCIES = $(libvirtd_LDADD)
|
||||
|
||||
|
||||
default_xml_dest = libvirt/qemu/networks/default.xml
|
||||
install-data-local: install-init install-data-sasl install-data-polkit
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <sys/utsname.h>
|
||||
|
||||
#if HAVE_NUMACTL
|
||||
#define NUMA_VERSION1_COMPATIBILITY 1
|
||||
#include <numa.h>
|
||||
#endif
|
||||
|
||||
|
@ -300,11 +301,11 @@ qemudCapsInitGuest(virCapsPtr caps,
|
|||
#if HAVE_NUMACTL
|
||||
#define MAX_CPUS 4096
|
||||
#define MAX_CPUS_MASK_SIZE (sizeof(unsigned long))
|
||||
#define MAX_CPUS_MASK_LEN (MAX_CPUS / MAX_CPUS_MASK_SIZE)
|
||||
#define MAX_CPUS_MASK_BYTES (MAX_CPUS / 8)
|
||||
#define MAX_CPUS_MASK_BITS (MAX_CPUS_MASK_SIZE * 8)
|
||||
#define MAX_CPUS_MASK_LEN (MAX_CPUS / (MAX_CPUS_MASK_BITS))
|
||||
|
||||
#define MASK_CPU_ISSET(mask, cpu) \
|
||||
(((mask)[((cpu) / MAX_CPUS_MASK_SIZE)] >> ((cpu) % MAX_CPUS_MASK_SIZE)) & 1)
|
||||
(((mask)[((cpu) / MAX_CPUS_MASK_BITS)] >> ((cpu) % MAX_CPUS_MASK_BITS)) & 1)
|
||||
|
||||
static int
|
||||
qemudCapsInitNUMA(virCapsPtr caps)
|
||||
|
@ -322,7 +323,8 @@ qemudCapsInitNUMA(virCapsPtr caps)
|
|||
goto cleanup;
|
||||
|
||||
for (n = 0 ; n <= numa_max_node() ; n++) {
|
||||
if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_BYTES) < 0)
|
||||
|
||||
if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN) < 0)
|
||||
goto cleanup;
|
||||
|
||||
for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <sys/ioctl.h>
|
||||
|
||||
#if HAVE_NUMACTL
|
||||
#define NUMA_VERSION1_COMPATIBILITY 1
|
||||
#include <numa.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <sys/utsname.h>
|
||||
|
||||
#if HAVE_NUMACTL
|
||||
#define NUMA_VERSION1_COMPATIBILITY 1
|
||||
#include <numa.h>
|
||||
#endif
|
||||
|
||||
|
@ -56,11 +57,11 @@
|
|||
#if HAVE_NUMACTL
|
||||
#define MAX_CPUS 4096
|
||||
#define MAX_CPUS_MASK_SIZE (sizeof(unsigned long))
|
||||
#define MAX_CPUS_MASK_LEN (MAX_CPUS / MAX_CPUS_MASK_SIZE)
|
||||
#define MAX_CPUS_MASK_BYTES (MAX_CPUS / 8)
|
||||
#define MAX_CPUS_MASK_BITS (MAX_CPUS_MASK_SIZE * 8)
|
||||
#define MAX_CPUS_MASK_LEN (MAX_CPUS / (MAX_CPUS_MASK_BITS))
|
||||
|
||||
#define MASK_CPU_ISSET(mask, cpu) \
|
||||
(((mask)[((cpu) / MAX_CPUS_MASK_SIZE)] >> ((cpu) % MAX_CPUS_MASK_SIZE)) & 1)
|
||||
(((mask)[((cpu) / MAX_CPUS_MASK_BITS)] >> ((cpu) % MAX_CPUS_MASK_BITS)) & 1)
|
||||
|
||||
static int
|
||||
umlCapsInitNUMA(virCapsPtr caps)
|
||||
|
@ -78,7 +79,8 @@ umlCapsInitNUMA(virCapsPtr caps)
|
|||
goto cleanup;
|
||||
|
||||
for (n = 0 ; n <= numa_max_node() ; n++) {
|
||||
if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_BYTES) < 0)
|
||||
|
||||
if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_LEN) < 0)
|
||||
goto cleanup;
|
||||
|
||||
for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include <sys/inotify.h>
|
||||
|
||||
#if HAVE_NUMACTL
|
||||
#define NUMA_VERSION1_COMPATIBILITY 1
|
||||
#include <numa.h>
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue