While preparing to add a capability for active commit, I noticed
that the existing code was abusing int for boolean values.
* src/conf/capabilities.h (_virCapsGuestFeature, _virCapsHost)
(virCapabilitiesNew, virCapabilitiesAddGuestFeature): Improve
types.
* src/conf/capabilities.c (virCapabilitiesNew)
(virCapabilitiesAddGuestFeature): Adjust signature.
* src/bhyve/bhyve_capabilities.c (virBhyveCapsBuild): Update
clients.
* src/esx/esx_driver.c (esxCapsInit): Likewise.
* src/libxl/libxl_conf.c (libxlMakeCapabilities): Likewise.
* src/lxc/lxc_conf.c (virLXCDriverCapsInit): Likewise.
* src/openvz/openvz_conf.c (openvzCapsInit): Likewise.
* src/parallels/parallels_driver.c (parallelsBuildCapabilities):
Likewise.
* src/phyp/phyp_driver.c (phypCapsInit): Likewise.
* src/qemu/qemu_capabilities.c (virQEMUCapsInit)
(virQEMUCapsInitGuestFromBinary): Likewise.
* src/security/virt-aa-helper.c (get_definition): Likewise.
* src/test/test_driver.c (testBuildCapabilities): Likewise.
* src/uml/uml_conf.c (umlCapsInit): Likewise.
* src/vbox/vbox_tmpl.c (vboxCapsInit): Likewise.
* src/vmware/vmware_conf.c (vmwareCapsInit): Likewise.
* src/xen/xen_hypervisor.c (xenHypervisorBuildCapabilities):
Likewise.
* src/xenapi/xenapi_driver.c (getCapsObject): Likewise.
* tests/qemucaps2xmltest.c (testGetCaps): Likewise.
* tests/testutils.c (virTestGenericCapsInit): Likewise.
* tests/testutilslxc.c (testLXCCapsInit): Likewise.
* tests/testutilsqemu.c (testQemuCapsInit): Likewise.
* tests/testutilsxen.c (testXenCapsInit): Likewise.
* tests/vircaps2xmltest.c (buildVirCapabilities): Likewise.
* tests/vircapstest.c (buildNUMATopology): Likewise.
* tests/vmx2xmltest.c (testCapsInit): Likewise.
* tests/xml2vmxtest.c (testCapsInit): Likewise.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/bhyve/bhyve_capabilities.c | 2 +-
src/conf/capabilities.c | 18 +++++++++---------
src/conf/capabilities.h | 18 +++++++++---------
src/esx/esx_driver.c | 4 ++--
src/libxl/libxl_conf.c | 4 ++--
src/lxc/lxc_conf.c | 4 ++--
src/openvz/openvz_conf.c | 2 +-
src/parallels/parallels_driver.c | 2 +-
src/phyp/phyp_driver.c | 2 +-
src/qemu/qemu_capabilities.c | 17 +++++++++--------
src/security/virt-aa-helper.c | 2 +-
src/test/test_driver.c | 6 +++---
src/uml/uml_conf.c | 2 +-
src/vbox/vbox_tmpl.c | 2 +-
src/vmware/vmware_conf.c | 2 +-
src/xen/xen_hypervisor.c | 31 +++++++++++++++----------------
src/xenapi/xenapi_driver.c | 2 +-
tests/qemucaps2xmltest.c | 2 +-
tests/testutils.c | 2 +-
tests/testutilslxc.c | 2 +-
tests/testutilsqemu.c | 6 +++---
tests/testutilsxen.c | 2 +-
tests/vircaps2xmltest.c | 2 +-
tests/vircapstest.c | 2 +-
tests/vmx2xmltest.c | 2 +-
tests/xml2vmxtest.c | 2 +-
26 files changed, 71 insertions(+), 71 deletions(-)
diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c
index bbca924..132ce91 100644
--- a/src/bhyve/bhyve_capabilities.c
+++ b/src/bhyve/bhyve_capabilities.c
@@ -82,7 +82,7 @@ virBhyveCapsBuild(void)
virCapsGuestPtr guest;
if ((caps = virCapabilitiesNew(virArchFromHost(),
- 0, 0)) == NULL)
+ false, false)) == NULL)
return NULL;
if ((guest = virCapabilitiesAddGuest(caps, "hvm",
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 8504d34..dc2c01a 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -58,15 +58,15 @@ VIR_ONCE_GLOBAL_INIT(virCapabilities)
/**
* virCapabilitiesNew:
* @hostarch: host machine architecture
- * @offlineMigrate: non-zero if offline migration is available
- * @liveMigrate: non-zero if live migration is available
+ * @offlineMigrate: true if offline migration is available
+ * @liveMigrate: true if live migration is available
*
* Allocate a new capabilities object
*/
virCapsPtr
virCapabilitiesNew(virArch hostarch,
- int offlineMigrate,
- int liveMigrate)
+ bool offlineMigrate,
+ bool liveMigrate)
{
virCapsPtr caps;
@@ -502,16 +502,16 @@ virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
* virCapabilitiesAddGuestFeature:
* @guest: guest to associate feature with
* @name: name of feature ('pae', 'acpi', 'apic')
- * @defaultOn: non-zero if it defaults to on
- * @toggle: non-zero if its state can be toggled
+ * @defaultOn: true if it defaults to on
+ * @toggle: true if its state can be toggled
*
- * Registers a feature for a guest domain
+ * Registers a feature for a guest domain.
*/
virCapsGuestFeaturePtr
virCapabilitiesAddGuestFeature(virCapsGuestPtr guest,
const char *name,
- int defaultOn,
- int toggle)
+ bool defaultOn,
+ bool toggle)
{
virCapsGuestFeaturePtr feature;
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index 2f94451..476deba 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -1,7 +1,7 @@
/*
* capabilities.h: hypervisor capabilities
*
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -37,8 +37,8 @@ typedef struct _virCapsGuestFeature virCapsGuestFeature;
typedef virCapsGuestFeature *virCapsGuestFeaturePtr;
struct _virCapsGuestFeature {
char *name;
- int defaultOn;
- int toggle;
+ bool defaultOn;
+ bool toggle;
};
typedef struct _virCapsGuestMachine virCapsGuestMachine;
@@ -148,8 +148,8 @@ struct _virCapsHost {
unsigned int powerMgmt; /* Bitmask of the PM capabilities.
* See enum virHostPMCapability.
*/
- int offlineMigrate;
- int liveMigrate;
+ bool offlineMigrate;
+ bool liveMigrate;
size_t nmigrateTrans;
size_t nmigrateTrans_max;
char **migrateTrans;
@@ -195,8 +195,8 @@ struct _virCaps {
extern virCapsPtr
virCapabilitiesNew(virArch hostarch,
- int offlineMigrate,
- int liveMigrate);
+ bool offlineMigrate,
+ bool liveMigrate);
extern void
virCapabilitiesFreeNUMAInfo(virCapsPtr caps);
@@ -254,8 +254,8 @@ virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
extern virCapsGuestFeaturePtr
virCapabilitiesAddGuestFeature(virCapsGuestPtr guest,
const char *name,
- int defaultOn,
- int toggle);
+ bool defaultOn,
+ bool toggle);
extern int
virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel,
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index d2cc230..f0a5278 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -575,9 +575,9 @@ esxCapsInit(esxPrivate *priv)
}
if (supportsLongMode == esxVI_Boolean_True) {
- caps = virCapabilitiesNew(VIR_ARCH_X86_64, 1, 1);
+ caps = virCapabilitiesNew(VIR_ARCH_X86_64, true, true);
} else {
- caps = virCapabilitiesNew(VIR_ARCH_I686, 1, 1);
+ caps = virCapabilitiesNew(VIR_ARCH_I686, true, true);
}
if (!caps)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index f620d47..a39dc4f 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1372,9 +1372,9 @@ libxlMakeCapabilities(libxl_ctx *ctx)
virCapsPtr caps;
#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
- if ((caps = virCapabilitiesNew(virArchFromHost(), 0, 0)) == NULL)
+ if ((caps = virCapabilitiesNew(virArchFromHost(), false, false)) == NULL)
#else
- if ((caps = virCapabilitiesNew(virArchFromHost(), 1, 1)) == NULL)
+ if ((caps = virCapabilitiesNew(virArchFromHost(), true, true)) == NULL)
#endif
return NULL;
diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
index a35a5e0..b5fd3cb 100644
--- a/src/lxc/lxc_conf.c
+++ b/src/lxc/lxc_conf.c
@@ -70,11 +70,11 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver)
char *lxc_path = NULL;
if ((caps = virCapabilitiesNew(virArchFromHost(),
- 0, 0)) == NULL)
+ false, false)) == NULL)
goto error;
/* Some machines have problematic NUMA toplogy causing
- * unexpected failures. We don't want to break the QEMU
+ * unexpected failures. We don't want to break the lxc
* driver in this scenario, so log errors & carry on
*/
if (nodeCapsInitNUMA(caps) < 0) {
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 38d3ea7..856c9f5 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -172,7 +172,7 @@ virCapsPtr openvzCapsInit(void)
virCapsGuestPtr guest;
if ((caps = virCapabilitiesNew(virArchFromHost(),
- 0, 0)) == NULL)
+ false, false)) == NULL)
goto no_memory;
if (nodeCapsInitNUMA(caps) < 0)
diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index b388e2d..43568d1 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -125,7 +125,7 @@ parallelsBuildCapabilities(void)
virNodeInfo nodeinfo;
if ((caps = virCapabilitiesNew(virArchFromHost(),
- 0, 0)) == NULL)
+ false, false)) == NULL)
return NULL;
if (nodeCapsInitNUMA(caps) < 0)
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 056d289..fa9afd0 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -286,7 +286,7 @@ phypCapsInit(void)
virCapsGuestPtr guest;
if ((caps = virCapabilitiesNew(virArchFromHost(),
- 0, 0)) == NULL)
+ false, false)) == NULL)
goto no_memory;
/* Some machines have problematic NUMA toplogy causing
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index c665e2b..37e0588 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -815,17 +815,18 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
if (caps->host.cpu &&
caps->host.cpu->model &&
virQEMUCapsGetCPUDefinitions(qemubinCaps, NULL) > 0 &&
- !virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0))
+ !virCapabilitiesAddGuestFeature(guest, "cpuselection", true, false))
goto cleanup;
if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_BOOTINDEX) &&
- !virCapabilitiesAddGuestFeature(guest, "deviceboot", 1, 0))
+ !virCapabilitiesAddGuestFeature(guest, "deviceboot", true, false))
goto cleanup;
if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_DISK_SNAPSHOT))
hasdisksnapshot = true;
- if (!virCapabilitiesAddGuestFeature(guest, "disksnapshot", hasdisksnapshot,
0))
+ if (!virCapabilitiesAddGuestFeature(guest, "disksnapshot",
hasdisksnapshot,
+ false))
goto cleanup;
if (virCapabilitiesAddGuestDomain(guest,
@@ -868,13 +869,13 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
if (((guestarch == VIR_ARCH_I686) ||
(guestarch == VIR_ARCH_X86_64)) &&
- (virCapabilitiesAddGuestFeature(guest, "acpi", 1, 1) == NULL ||
- virCapabilitiesAddGuestFeature(guest, "apic", 1, 0) == NULL))
+ (virCapabilitiesAddGuestFeature(guest, "acpi", true, true) == NULL ||
+ virCapabilitiesAddGuestFeature(guest, "apic", true, false) == NULL))
goto cleanup;
if ((guestarch == VIR_ARCH_I686) &&
- (virCapabilitiesAddGuestFeature(guest, "pae", 1, 0) == NULL ||
- virCapabilitiesAddGuestFeature(guest, "nonpae", 1, 0) == NULL))
+ (virCapabilitiesAddGuestFeature(guest, "pae", true, false) == NULL ||
+ virCapabilitiesAddGuestFeature(guest, "nonpae", true, false) ==
NULL))
goto cleanup;
ret = 0;
@@ -957,7 +958,7 @@ virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache)
virArch hostarch = virArchFromHost();
if ((caps = virCapabilitiesNew(hostarch,
- 1, 1)) == NULL)
+ true, true)) == NULL)
goto error;
/* Some machines have problematic NUMA toplogy causing
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index c8f17f9..f11855d 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -727,7 +727,7 @@ get_definition(vahControl * ctl, const char *xmlStr)
if (caps_mockup(ctl, xmlStr) != 0)
goto exit;
- if ((ctl->caps = virCapabilitiesNew(ctl->arch, 1, 1)) == NULL) {
+ if ((ctl->caps = virCapabilitiesNew(ctl->arch, true, true)) == NULL) {
vah_error(ctl, 0, _("could not allocate memory"));
goto exit;
}
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 7bfc88d..42af231 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -318,7 +318,7 @@ testBuildCapabilities(virConnectPtr conn)
const char *const guest_types[] = { "hvm", "xen" };
size_t i;
- if ((caps = virCapabilitiesNew(VIR_ARCH_I686, 0, 0)) == NULL)
+ if ((caps = virCapabilitiesNew(VIR_ARCH_I686, false, false)) == NULL)
goto error;
if (virCapabilitiesAddHostFeature(caps, "pae") < 0)
@@ -360,9 +360,9 @@ testBuildCapabilities(virConnectPtr conn)
NULL) == NULL)
goto error;
- if (virCapabilitiesAddGuestFeature(guest, "pae", 1, 1) == NULL)
+ if (virCapabilitiesAddGuestFeature(guest, "pae", true, true) == NULL)
goto error;
- if (virCapabilitiesAddGuestFeature(guest, "nonpae", 1, 1) == NULL)
+ if (virCapabilitiesAddGuestFeature(guest, "nonpae", true, true) ==
NULL)
goto error;
}
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 7a206d2..e25bf8c 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -58,7 +58,7 @@ virCapsPtr umlCapsInit(void)
virCapsGuestPtr guest;
if ((caps = virCapabilitiesNew(virArchFromHost(),
- 0, 0)) == NULL)
+ false, false)) == NULL)
goto error;
/* Some machines have problematic NUMA toplogy causing
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 3825083..fa5020f 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -885,7 +885,7 @@ static virCapsPtr vboxCapsInit(void)
virCapsGuestPtr guest;
if ((caps = virCapabilitiesNew(virArchFromHost(),
- 0, 0)) == NULL)
+ false, false)) == NULL)
goto no_memory;
if (nodeCapsInitNUMA(caps) < 0)
diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index b773303..81ac4ae 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -65,7 +65,7 @@ vmwareCapsInit(void)
virCPUDataPtr data = NULL;
if ((caps = virCapabilitiesNew(virArchFromHost(),
- 0, 0)) == NULL)
+ false, false)) == NULL)
goto error;
if (nodeCapsInitNUMA(caps) < 0)
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 524b21f..b52c937 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -2108,7 +2108,7 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, virArch
hostarch,
int hv_major = hv_versions.hv >> 16;
int hv_minor = hv_versions.hv & 0xFFFF;
- if ((caps = virCapabilitiesNew(hostarch, 1, 1)) == NULL)
+ if ((caps = virCapabilitiesNew(hostarch, true, true)) == NULL)
goto no_memory;
if (hvm_type && STRNEQ(hvm_type, "") &&
@@ -2166,37 +2166,36 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, virArch
hostarch,
if (guest_archs[i].pae &&
virCapabilitiesAddGuestFeature(guest,
"pae",
- 1,
- 0) == NULL)
+ true,
+ false) == NULL)
goto no_memory;
if (guest_archs[i].nonpae &&
virCapabilitiesAddGuestFeature(guest,
"nonpae",
- 1,
- 0) == NULL)
+ true,
+ false) == NULL)
goto no_memory;
if (guest_archs[i].ia64_be &&
virCapabilitiesAddGuestFeature(guest,
"ia64_be",
- 1,
- 0) == NULL)
+ true,
+ false) == NULL)
goto no_memory;
if (guest_archs[i].hvm) {
if (virCapabilitiesAddGuestFeature(guest,
"acpi",
- 1, 1) == NULL)
+ true, true) == NULL)
goto no_memory;
/* In Xen 3.1.0, APIC is always on and can't be toggled */
if (virCapabilitiesAddGuestFeature(guest,
"apic",
- 1,
- (hv_major > 3 &&
- hv_minor > 0 ?
- 0 : 1)) == NULL)
+ true,
+ !(hv_major > 3 &&
+ hv_minor > 0)) == NULL)
goto no_memory;
/* Xen 3.3.x and beyond supports enabling/disabling
@@ -2205,8 +2204,8 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, virArch
hostarch,
if ((hv_major == 3 && hv_minor >= 3) || (hv_major > 3))
if (virCapabilitiesAddGuestFeature(guest,
"hap",
- 0,
- 1) == NULL)
+ false,
+ true) == NULL)
goto no_memory;
/* Xen 3.4.x and beyond supports the Viridian (Hyper-V)
@@ -2215,8 +2214,8 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, virArch
hostarch,
if ((hv_major == 3 && hv_minor >= 4) || (hv_major > 3))
if (virCapabilitiesAddGuestFeature(guest,
"viridian",
- 0,
- 1) == NULL)
+ false,
+ true) == NULL)
goto no_memory;
}
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 316e274..d86fbb6 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -85,7 +85,7 @@ getCapsObject(void)
{
virCapsGuestPtr guest1, guest2;
virCapsGuestDomainPtr domain1, domain2;
- virCapsPtr caps = virCapabilitiesNew(virArchFromHost(), 0, 0);
+ virCapsPtr caps = virCapabilitiesNew(virArchFromHost(), false, false);
if (!caps)
return NULL;
diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
index cef5735..3529acb 100644
--- a/tests/qemucaps2xmltest.c
+++ b/tests/qemucaps2xmltest.c
@@ -110,7 +110,7 @@ testGetCaps(char *capsData, const testQemuData *data)
goto error;
}
- if ((caps = virCapabilitiesNew(data->guestarch, 0, 0)) == NULL) {
+ if ((caps = virCapabilitiesNew(data->guestarch, false, false)) == NULL) {
fprintf(stderr, "failed to create the fake capabilities");
goto error;
}
diff --git a/tests/testutils.c b/tests/testutils.c
index dbe4773..5bdfcc5 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -912,7 +912,7 @@ virCapsPtr virTestGenericCapsInit(void)
virCapsGuestPtr guest;
if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64,
- 0, 0)) == NULL)
+ false, false)) == NULL)
return NULL;
if ((guest = virCapabilitiesAddGuest(caps, "hvm", VIR_ARCH_I686,
diff --git a/tests/testutilslxc.c b/tests/testutilslxc.c
index 968d8d0..09dfd02 100644
--- a/tests/testutilslxc.c
+++ b/tests/testutilslxc.c
@@ -14,7 +14,7 @@ virCapsPtr testLXCCapsInit(void)
virCapsGuestPtr guest;
if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64,
- 0, 0)) == NULL)
+ false, false)) == NULL)
return NULL;
if ((guest = virCapabilitiesAddGuest(caps, "exe", VIR_ARCH_I686,
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 85f0356..52abb8c 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -249,7 +249,7 @@ virCapsPtr testQemuCapsInit(void)
};
if ((caps = virCapabilitiesNew(host_cpu.arch,
- 0, 0)) == NULL)
+ false, false)) == NULL)
return NULL;
if ((caps->host.cpu = virCPUDefCopy(&host_cpu)) == NULL ||
@@ -259,7 +259,7 @@ virCapsPtr testQemuCapsInit(void)
if ((guest = virCapabilitiesAddGuest(caps, "hvm", VIR_ARCH_I686,
"/usr/bin/qemu", NULL,
nmachines, machines)) == NULL ||
- !virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0))
+ !virCapabilitiesAddGuestFeature(guest, "cpuselection", true, false))
goto cleanup;
machines = NULL;
@@ -277,7 +277,7 @@ virCapsPtr testQemuCapsInit(void)
if ((guest = virCapabilitiesAddGuest(caps, "hvm", VIR_ARCH_X86_64,
"/usr/bin/qemu-system-x86_64", NULL,
nmachines, machines)) == NULL ||
- !virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0))
+ !virCapabilitiesAddGuestFeature(guest, "cpuselection", true, false))
goto cleanup;
machines = NULL;
diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c
index 3c8b60f..a50a8a2 100644
--- a/tests/testutilsxen.c
+++ b/tests/testutilsxen.c
@@ -23,7 +23,7 @@ virCapsPtr testXenCapsInit(void)
uname(&utsname);
if ((caps = virCapabilitiesNew(VIR_ARCH_I686,
- 0, 0)) == NULL)
+ false, false)) == NULL)
return NULL;
nmachines = ARRAY_CARDINALITY(x86_machines);
diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c
index d8b61aa..b5b4f48 100644
--- a/tests/vircaps2xmltest.c
+++ b/tests/vircaps2xmltest.c
@@ -41,7 +41,7 @@ buildVirCapabilities(int max_cells,
int id;
size_t i;
- if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64, 0, 0)) == NULL)
+ if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64, false, false)) == NULL)
goto error;
id = 0;
diff --git a/tests/vircapstest.c b/tests/vircapstest.c
index 59e9c2b..deabc7a 100644
--- a/tests/vircapstest.c
+++ b/tests/vircapstest.c
@@ -44,7 +44,7 @@ buildNUMATopology(int seq)
int core_id, cell_id;
int id;
- if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64, 0, 0)) == NULL)
+ if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64, false, false)) == NULL)
goto error;
id = 0;
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
index 1d2e012..5c103dd 100644
--- a/tests/vmx2xmltest.c
+++ b/tests/vmx2xmltest.c
@@ -25,7 +25,7 @@ testCapsInit(void)
{
virCapsGuestPtr guest = NULL;
- caps = virCapabilitiesNew(VIR_ARCH_I686, 1, 1);
+ caps = virCapabilitiesNew(VIR_ARCH_I686, true, true);
if (caps == NULL) {
return;
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
index 058b19f..58418dc 100644
--- a/tests/xml2vmxtest.c
+++ b/tests/xml2vmxtest.c
@@ -25,7 +25,7 @@ testCapsInit(void)
{
virCapsGuestPtr guest = NULL;
- caps = virCapabilitiesNew(VIR_ARCH_I686, 1, 1);
+ caps = virCapabilitiesNew(VIR_ARCH_I686, true, true);
if (caps == NULL) {
return;
--
1.9.3