mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
lib: Don't check for virCapabilitiesAddGuest() retval
The virCapabilitiesAddGuest() function can't fail. It aborts on OOM. Therefore, there's no need to check for its return value. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
42cc2f9396
commit
c18d9e23fa
@ -50,11 +50,9 @@ virBhyveCapsBuild(void)
|
|||||||
false, false)) == NULL)
|
false, false)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
VIR_ARCH_X86_64,
|
VIR_ARCH_X86_64, "bhyve",
|
||||||
"bhyve",
|
NULL, 0, NULL);
|
||||||
NULL, 0, NULL)) == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_BHYVE,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_BHYVE,
|
||||||
NULL, NULL, 0, NULL) == NULL)
|
NULL, NULL, 0, NULL) == NULL)
|
||||||
|
@ -65,14 +65,8 @@ virCaps *virCHDriverCapsInit(void)
|
|||||||
if (virCapabilitiesInitCaches(caps) < 0)
|
if (virCapabilitiesInitCaches(caps) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
VIR_DOMAIN_OSTYPE_HVM,
|
caps->host.arch, NULL, NULL, 0, NULL);
|
||||||
caps->host.arch,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL)) == NULL)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
VIR_DOMAIN_VIRT_KVM,
|
VIR_DOMAIN_VIRT_KVM,
|
||||||
|
@ -567,9 +567,6 @@ esxCapsInit(esxPrivate *priv)
|
|||||||
NULL, NULL, 0,
|
NULL, NULL, 0,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (!guest)
|
|
||||||
goto failure;
|
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0, NULL))
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
@ -580,9 +577,6 @@ esxCapsInit(esxPrivate *priv)
|
|||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
|
|
||||||
if (!guest)
|
|
||||||
goto failure;
|
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0, NULL))
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
@ -276,8 +276,6 @@ hypervCapsInit(hypervPrivate *priv)
|
|||||||
/* i686 caps */
|
/* i686 caps */
|
||||||
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_I686,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_I686,
|
||||||
NULL, NULL, 0, NULL);
|
NULL, NULL, 0, NULL);
|
||||||
if (!guest)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_HYPERV, NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_HYPERV, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
@ -285,8 +283,6 @@ hypervCapsInit(hypervPrivate *priv)
|
|||||||
/* x86_64 caps */
|
/* x86_64 caps */
|
||||||
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64,
|
||||||
NULL, NULL, 0, NULL);
|
NULL, NULL, 0, NULL);
|
||||||
if (!guest)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_HYPERV, NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_HYPERV, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -473,20 +473,17 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCaps *caps)
|
|||||||
if ((machines = virCapabilitiesAllocMachines(xen_machines, 1)) == NULL)
|
if ((machines = virCapabilitiesAllocMachines(xen_machines, 1)) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps,
|
||||||
guest_archs[i].hvm ? VIR_DOMAIN_OSTYPE_HVM :
|
guest_archs[i].hvm ? VIR_DOMAIN_OSTYPE_HVM :
|
||||||
(guest_archs[i].pvh ? VIR_DOMAIN_OSTYPE_XENPVH :
|
(guest_archs[i].pvh ? VIR_DOMAIN_OSTYPE_XENPVH :
|
||||||
VIR_DOMAIN_OSTYPE_XEN),
|
VIR_DOMAIN_OSTYPE_XEN),
|
||||||
guest_archs[i].arch,
|
guest_archs[i].arch,
|
||||||
LIBXL_EXECBIN_DIR "/qemu-system-i386",
|
LIBXL_EXECBIN_DIR "/qemu-system-i386",
|
||||||
(guest_archs[i].hvm ?
|
(guest_archs[i].hvm ?
|
||||||
LIBXL_FIRMWARE_DIR "/hvmloader" :
|
LIBXL_FIRMWARE_DIR "/hvmloader" :
|
||||||
NULL),
|
NULL),
|
||||||
1,
|
1,
|
||||||
machines)) == NULL) {
|
machines);
|
||||||
virCapabilitiesFreeMachines(machines, 1);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
|
@ -97,14 +97,8 @@ virCaps *virLXCDriverCapsInit(virLXCDriver *driver)
|
|||||||
LIBEXECDIR)))
|
LIBEXECDIR)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
||||||
VIR_DOMAIN_OSTYPE_EXE,
|
caps->host.arch, lxc_path, NULL, 0, NULL);
|
||||||
caps->host.arch,
|
|
||||||
lxc_path,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL)) == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
VIR_DOMAIN_VIRT_LXC,
|
VIR_DOMAIN_VIRT_LXC,
|
||||||
@ -116,14 +110,8 @@ virCaps *virLXCDriverCapsInit(virLXCDriver *driver)
|
|||||||
|
|
||||||
/* On 64-bit hosts, we can use personality() to request a 32bit process */
|
/* On 64-bit hosts, we can use personality() to request a 32bit process */
|
||||||
if ((altArch = lxcContainerGetAlt32bitArch(caps->host.arch)) != VIR_ARCH_NONE) {
|
if ((altArch = lxcContainerGetAlt32bitArch(caps->host.arch)) != VIR_ARCH_NONE) {
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
||||||
VIR_DOMAIN_OSTYPE_EXE,
|
altArch, lxc_path, NULL, 0, NULL);
|
||||||
altArch,
|
|
||||||
lxc_path,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL)) == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
VIR_DOMAIN_VIRT_LXC,
|
VIR_DOMAIN_VIRT_LXC,
|
||||||
|
@ -156,14 +156,8 @@ virCaps *openvzCapsInit(void)
|
|||||||
if (virCapabilitiesInitCaches(caps) < 0)
|
if (virCapabilitiesInitCaches(caps) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
||||||
VIR_DOMAIN_OSTYPE_EXE,
|
caps->host.arch, NULL, NULL, 0, NULL);
|
||||||
caps->host.arch,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL)) == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
VIR_DOMAIN_VIRT_OPENVZ,
|
VIR_DOMAIN_VIRT_OPENVZ,
|
||||||
|
@ -1050,14 +1050,9 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps,
|
|||||||
|
|
||||||
/* We register kvm as the base emulator too, since we can
|
/* We register kvm as the base emulator too, since we can
|
||||||
* just give -no-kvm to disable acceleration if required */
|
* just give -no-kvm to disable acceleration if required */
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
VIR_DOMAIN_OSTYPE_HVM,
|
guestarch, binary,
|
||||||
guestarch,
|
NULL, nmachines, machines);
|
||||||
binary,
|
|
||||||
NULL,
|
|
||||||
nmachines,
|
|
||||||
machines)) == NULL)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
nmachines = 0;
|
nmachines = 0;
|
||||||
|
@ -642,16 +642,8 @@ get_definition(vahControl * ctl, const char *xmlStr)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(ctl->caps,
|
guest = virCapabilitiesAddGuest(ctl->caps, ostype, ctl->arch,
|
||||||
ostype,
|
NULL, NULL, 0, NULL);
|
||||||
ctl->arch,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL)) == NULL) {
|
|
||||||
vah_error(ctl, 0, _("could not allocate memory"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((virtType = virDomainVirtTypeFromString(ctl->virtType)) < 0) {
|
if ((virtType = virDomainVirtTypeFromString(ctl->virtType)) < 0) {
|
||||||
vah_error(ctl, 0, _("unknown virtualization type"));
|
vah_error(ctl, 0, _("unknown virtualization type"));
|
||||||
|
@ -345,14 +345,8 @@ testBuildCapabilities(virConnectPtr conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS(guest_types); i++) {
|
for (i = 0; i < G_N_ELEMENTS(guest_types); i++) {
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, guest_types[i], VIR_ARCH_I686,
|
||||||
guest_types[i],
|
TEST_EMULATOR, NULL, 0, NULL);
|
||||||
VIR_ARCH_I686,
|
|
||||||
TEST_EMULATOR,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL)) == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
VIR_DOMAIN_VIRT_TEST,
|
VIR_DOMAIN_VIRT_TEST,
|
||||||
|
@ -100,13 +100,8 @@ vboxCapsInit(void)
|
|||||||
if (virCapabilitiesInitCaches(caps) < 0)
|
if (virCapabilitiesInitCaches(caps) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
VIR_DOMAIN_OSTYPE_HVM,
|
caps->host.arch, NULL, NULL, 0, NULL);
|
||||||
caps->host.arch,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL)) == NULL)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
|
@ -78,11 +78,8 @@ vmwareCapsInit(void)
|
|||||||
VIR_WARN("Failed to get host CPU cache info");
|
VIR_WARN("Failed to get host CPU cache info");
|
||||||
|
|
||||||
/* i686 guests are always supported */
|
/* i686 guests are always supported */
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
VIR_DOMAIN_OSTYPE_HVM,
|
VIR_ARCH_I686, NULL, NULL, 0, NULL);
|
||||||
VIR_ARCH_I686,
|
|
||||||
NULL, NULL, 0, NULL)) == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
VIR_DOMAIN_VIRT_VMWARE,
|
VIR_DOMAIN_VIRT_VMWARE,
|
||||||
@ -103,11 +100,8 @@ vmwareCapsInit(void)
|
|||||||
(virCPUCheckFeature(caps->host.cpu->arch, caps->host.cpu, "vmx") ||
|
(virCPUCheckFeature(caps->host.cpu->arch, caps->host.cpu, "vmx") ||
|
||||||
virCPUCheckFeature(caps->host.cpu->arch, caps->host.cpu, "svm")))) {
|
virCPUCheckFeature(caps->host.cpu->arch, caps->host.cpu, "svm")))) {
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
VIR_DOMAIN_OSTYPE_HVM,
|
VIR_ARCH_X86_64, NULL, NULL, 0, NULL);
|
||||||
VIR_ARCH_X86_64,
|
|
||||||
NULL, NULL, 0, NULL)) == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
VIR_DOMAIN_VIRT_VMWARE,
|
VIR_DOMAIN_VIRT_VMWARE,
|
||||||
|
@ -83,8 +83,8 @@ vzCapsAddGuestDomain(virCaps *caps,
|
|||||||
{
|
{
|
||||||
virCapsGuest *guest;
|
virCapsGuest *guest;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, ostype, arch, emulator,
|
guest = virCapabilitiesAddGuest(caps, ostype, arch,
|
||||||
NULL, 0, NULL)) == NULL)
|
emulator, NULL, 0, NULL);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
||||||
|
@ -903,10 +903,8 @@ virTestGenericCapsInit(void)
|
|||||||
false, false)) == NULL)
|
false, false)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_I686,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_I686,
|
||||||
"/usr/bin/acme-virt", NULL,
|
"/usr/bin/acme-virt", NULL, 0, NULL);
|
||||||
0, NULL)) == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, NULL, 0, NULL))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -917,10 +915,8 @@ virTestGenericCapsInit(void)
|
|||||||
NULL, NULL, 0, NULL))
|
NULL, NULL, 0, NULL))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64,
|
||||||
"/usr/bin/acme-virt", NULL,
|
"/usr/bin/acme-virt", NULL, 0, NULL);
|
||||||
0, NULL)) == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, NULL, 0, NULL))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -18,21 +18,19 @@ testLXCCapsInit(void)
|
|||||||
false, false)) == NULL)
|
false, false)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
||||||
VIR_ARCH_I686,
|
VIR_ARCH_I686,
|
||||||
"/usr/libexec/libvirt_lxc", NULL,
|
"/usr/libexec/libvirt_lxc", NULL,
|
||||||
0, NULL)) == NULL)
|
0, NULL);
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_LXC, NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_LXC, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
||||||
VIR_ARCH_X86_64,
|
VIR_ARCH_X86_64,
|
||||||
"/usr/libexec/libvirt_lxc", NULL,
|
"/usr/libexec/libvirt_lxc", NULL,
|
||||||
0, NULL)) == NULL)
|
0, NULL);
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_LXC, NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_LXC, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -165,14 +165,9 @@ testQemuAddGuest(virCaps *caps,
|
|||||||
if (machines == NULL)
|
if (machines == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!(guest = virCapabilitiesAddGuest(caps,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
VIR_DOMAIN_OSTYPE_HVM,
|
arch, qemu_emulators[emu_arch],
|
||||||
arch,
|
NULL, nmachines, machines);
|
||||||
qemu_emulators[emu_arch],
|
|
||||||
NULL,
|
|
||||||
nmachines,
|
|
||||||
machines)))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
nmachines = 0;
|
nmachines = 0;
|
||||||
|
@ -34,12 +34,11 @@ testXLInitCaps(void)
|
|||||||
nmachines = G_N_ELEMENTS(x86_machines);
|
nmachines = G_N_ELEMENTS(x86_machines);
|
||||||
if ((machines = virCapabilitiesAllocMachines(x86_machines, nmachines)) == NULL)
|
if ((machines = virCapabilitiesAllocMachines(x86_machines, nmachines)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
VIR_ARCH_X86_64,
|
VIR_ARCH_X86_64,
|
||||||
"/usr/lib/xen/bin/qemu-system-i386",
|
"/usr/lib/xen/bin/qemu-system-i386",
|
||||||
"/usr/lib/xen/boot/hvmloader",
|
"/usr/lib/xen/boot/hvmloader",
|
||||||
nmachines, machines)) == NULL)
|
nmachines, machines);
|
||||||
goto cleanup;
|
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL,
|
||||||
NULL, 0, NULL) == NULL)
|
NULL, 0, NULL) == NULL)
|
||||||
@ -48,12 +47,11 @@ testXLInitCaps(void)
|
|||||||
if ((machines = virCapabilitiesAllocMachines(xen_machines, nmachines)) == NULL)
|
if ((machines = virCapabilitiesAllocMachines(xen_machines, nmachines)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_XEN,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_XEN,
|
||||||
VIR_ARCH_X86_64,
|
VIR_ARCH_X86_64,
|
||||||
"/usr/lib/xen/bin/qemu-system-i386",
|
"/usr/lib/xen/bin/qemu-system-i386",
|
||||||
NULL,
|
NULL,
|
||||||
nmachines, machines)) == NULL)
|
nmachines, machines);
|
||||||
goto cleanup;
|
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL,
|
||||||
@ -63,12 +61,11 @@ testXLInitCaps(void)
|
|||||||
if ((machines = virCapabilitiesAllocMachines(pvh_machines, nmachines)) == NULL)
|
if ((machines = virCapabilitiesAllocMachines(pvh_machines, nmachines)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_XENPVH,
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_XENPVH,
|
||||||
VIR_ARCH_X86_64,
|
VIR_ARCH_X86_64,
|
||||||
"/usr/lib/xen/bin/qemu-system-i386",
|
"/usr/lib/xen/bin/qemu-system-i386",
|
||||||
NULL,
|
NULL,
|
||||||
nmachines, machines)) == NULL)
|
nmachines, machines);
|
||||||
goto cleanup;
|
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL,
|
||||||
|
@ -31,13 +31,9 @@ testCapsInit(void)
|
|||||||
virCapabilitiesAddHostMigrateTransport(caps, "vpxmigr");
|
virCapabilitiesAddHostMigrateTransport(caps, "vpxmigr");
|
||||||
|
|
||||||
/* i686 guest */
|
/* i686 guest */
|
||||||
guest =
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
VIR_ARCH_I686,
|
||||||
VIR_ARCH_I686,
|
NULL, NULL, 0, NULL);
|
||||||
NULL, NULL, 0, NULL);
|
|
||||||
|
|
||||||
if (guest == NULL)
|
|
||||||
goto failure;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
||||||
NULL) == NULL) {
|
NULL) == NULL) {
|
||||||
@ -45,13 +41,9 @@ testCapsInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* x86_64 guest */
|
/* x86_64 guest */
|
||||||
guest =
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
VIR_ARCH_X86_64,
|
||||||
VIR_ARCH_X86_64,
|
NULL, NULL, 0, NULL);
|
||||||
NULL, NULL, 0, NULL);
|
|
||||||
|
|
||||||
if (guest == NULL)
|
|
||||||
goto failure;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
||||||
NULL) == NULL) {
|
NULL) == NULL) {
|
||||||
|
@ -32,13 +32,9 @@ testCapsInit(void)
|
|||||||
|
|
||||||
|
|
||||||
/* i686 guest */
|
/* i686 guest */
|
||||||
guest =
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
VIR_ARCH_I686,
|
||||||
VIR_ARCH_I686,
|
NULL, NULL, 0, NULL);
|
||||||
NULL, NULL, 0, NULL);
|
|
||||||
|
|
||||||
if (guest == NULL)
|
|
||||||
goto failure;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
||||||
NULL) == NULL) {
|
NULL) == NULL) {
|
||||||
@ -46,13 +42,9 @@ testCapsInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* x86_64 guest */
|
/* x86_64 guest */
|
||||||
guest =
|
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
||||||
virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
|
VIR_ARCH_X86_64,
|
||||||
VIR_ARCH_X86_64,
|
NULL, NULL, 0, NULL);
|
||||||
NULL, NULL, 0, NULL);
|
|
||||||
|
|
||||||
if (guest == NULL)
|
|
||||||
goto failure;
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
||||||
NULL) == NULL) {
|
NULL) == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user