qemu: Switch over command line capabilities to virBitmap

This is done for two reasons:
- we are getting very close to 64 flags which is the maximum we can use
  with unsigned long long
- by using LL constants in enum we already violates C99 constraint that
  enum values have to fit into int
This commit is contained in:
Jiri Denemark 2011-02-08 15:22:39 +01:00
parent 23d935bd97
commit 9fc4b6a606
12 changed files with 890 additions and 823 deletions

1
cfg.mk
View File

@ -71,6 +71,7 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^docs/news.html.in$$
# Functions like free() that are no-ops on NULL arguments. # Functions like free() that are no-ops on NULL arguments.
useless_free_options = \ useless_free_options = \
--name=VIR_FREE \ --name=VIR_FREE \
--name=qemuCapsFree \
--name=sexpr_free \ --name=sexpr_free \
--name=virBitmapFree \ --name=virBitmapFree \
--name=virCPUDefFree \ --name=virCPUDefFree \

View File

@ -39,6 +39,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <stdarg.h>
#define VIR_FROM_THIS VIR_FROM_QEMU #define VIR_FROM_THIS VIR_FROM_QEMU
@ -377,7 +378,7 @@ error:
int int
qemuCapsProbeCPUModels(const char *qemu, qemuCapsProbeCPUModels(const char *qemu,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
const char *arch, const char *arch,
unsigned int *count, unsigned int *count,
const char ***cpus) const char ***cpus)
@ -442,7 +443,7 @@ qemuCapsInitGuest(virCapsPtr caps,
int nmachines = 0; int nmachines = 0;
struct stat st; struct stat st;
unsigned int ncpus; unsigned int ncpus;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
int ret = -1; int ret = -1;
/* Check for existance of base emulator, or alternate base /* Check for existance of base emulator, or alternate base
@ -553,7 +554,7 @@ qemuCapsInitGuest(virCapsPtr caps,
guest->arch.defaultInfo.emulator_mtime = binary_mtime; guest->arch.defaultInfo.emulator_mtime = binary_mtime;
if (caps->host.cpu && if (caps->host.cpu &&
qemuCapsProbeCPUModels(binary, 0, info->arch, &ncpus, NULL) == 0 && qemuCapsProbeCPUModels(binary, NULL, info->arch, &ncpus, NULL) == 0 &&
ncpus > 0 && ncpus > 0 &&
!virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0)) !virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0))
goto error; goto error;
@ -648,6 +649,7 @@ cleanup:
VIR_FREE(binary); VIR_FREE(binary);
VIR_FREE(kvmbin); VIR_FREE(kvmbin);
} }
qemuCapsFree(qemuCaps);
return ret; return ret;
@ -781,129 +783,129 @@ virCapsPtr qemuCapsInit(virCapsPtr old_caps)
} }
static unsigned long long static void
qemuCapsComputeCmdFlags(const char *help, qemuCapsComputeCmdFlags(const char *help,
unsigned int version, unsigned int version,
unsigned int is_kvm, unsigned int is_kvm,
unsigned int kvm_version) unsigned int kvm_version,
virBitmapPtr flags)
{ {
unsigned long long flags = 0;
const char *p; const char *p;
if (strstr(help, "-no-kqemu")) if (strstr(help, "-no-kqemu"))
qemuCapsSet(&flags, QEMU_CAPS_KQEMU); qemuCapsSet(flags, QEMU_CAPS_KQEMU);
if (strstr(help, "-enable-kqemu")) if (strstr(help, "-enable-kqemu"))
qemuCapsSet(&flags, QEMU_CAPS_ENABLE_KQEMU); qemuCapsSet(flags, QEMU_CAPS_ENABLE_KQEMU);
if (strstr(help, "-no-kvm")) if (strstr(help, "-no-kvm"))
qemuCapsSet(&flags, QEMU_CAPS_KVM); qemuCapsSet(flags, QEMU_CAPS_KVM);
if (strstr(help, "-enable-kvm")) if (strstr(help, "-enable-kvm"))
qemuCapsSet(&flags, QEMU_CAPS_ENABLE_KVM); qemuCapsSet(flags, QEMU_CAPS_ENABLE_KVM);
if (strstr(help, "-no-reboot")) if (strstr(help, "-no-reboot"))
qemuCapsSet(&flags, QEMU_CAPS_NO_REBOOT); qemuCapsSet(flags, QEMU_CAPS_NO_REBOOT);
if (strstr(help, "-name")) { if (strstr(help, "-name")) {
qemuCapsSet(&flags, QEMU_CAPS_NAME); qemuCapsSet(flags, QEMU_CAPS_NAME);
if (strstr(help, ",process=")) if (strstr(help, ",process="))
qemuCapsSet(&flags, QEMU_CAPS_NAME_PROCESS); qemuCapsSet(flags, QEMU_CAPS_NAME_PROCESS);
} }
if (strstr(help, "-uuid")) if (strstr(help, "-uuid"))
qemuCapsSet(&flags, QEMU_CAPS_UUID); qemuCapsSet(flags, QEMU_CAPS_UUID);
if (strstr(help, "-xen-domid")) if (strstr(help, "-xen-domid"))
qemuCapsSet(&flags, QEMU_CAPS_XEN_DOMID); qemuCapsSet(flags, QEMU_CAPS_XEN_DOMID);
else if (strstr(help, "-domid")) else if (strstr(help, "-domid"))
qemuCapsSet(&flags, QEMU_CAPS_DOMID); qemuCapsSet(flags, QEMU_CAPS_DOMID);
if (strstr(help, "-drive")) { if (strstr(help, "-drive")) {
qemuCapsSet(&flags, QEMU_CAPS_DRIVE); qemuCapsSet(flags, QEMU_CAPS_DRIVE);
if (strstr(help, "cache=") && if (strstr(help, "cache=") &&
!strstr(help, "cache=on|off")) !strstr(help, "cache=on|off"))
qemuCapsSet(&flags, QEMU_CAPS_DRIVE_CACHE_V2); qemuCapsSet(flags, QEMU_CAPS_DRIVE_CACHE_V2);
if (strstr(help, "format=")) if (strstr(help, "format="))
qemuCapsSet(&flags, QEMU_CAPS_DRIVE_FORMAT); qemuCapsSet(flags, QEMU_CAPS_DRIVE_FORMAT);
if (strstr(help, "readonly=")) if (strstr(help, "readonly="))
qemuCapsSet(&flags, QEMU_CAPS_DRIVE_READONLY); qemuCapsSet(flags, QEMU_CAPS_DRIVE_READONLY);
if (strstr(help, "aio=threads|native")) if (strstr(help, "aio=threads|native"))
qemuCapsSet(&flags, QEMU_CAPS_DRIVE_AIO); qemuCapsSet(flags, QEMU_CAPS_DRIVE_AIO);
} }
if ((p = strstr(help, "-vga")) && !strstr(help, "-std-vga")) { if ((p = strstr(help, "-vga")) && !strstr(help, "-std-vga")) {
const char *nl = strstr(p, "\n"); const char *nl = strstr(p, "\n");
qemuCapsSet(&flags, QEMU_CAPS_VGA); qemuCapsSet(flags, QEMU_CAPS_VGA);
if (strstr(p, "|qxl")) if (strstr(p, "|qxl"))
qemuCapsSet(&flags, QEMU_CAPS_VGA_QXL); qemuCapsSet(flags, QEMU_CAPS_VGA_QXL);
if ((p = strstr(p, "|none")) && p < nl) if ((p = strstr(p, "|none")) && p < nl)
qemuCapsSet(&flags, QEMU_CAPS_VGA_NONE); qemuCapsSet(flags, QEMU_CAPS_VGA_NONE);
} }
if (strstr(help, "-spice")) if (strstr(help, "-spice"))
qemuCapsSet(&flags, QEMU_CAPS_SPICE); qemuCapsSet(flags, QEMU_CAPS_SPICE);
if (strstr(help, "boot=on")) if (strstr(help, "boot=on"))
qemuCapsSet(&flags, QEMU_CAPS_DRIVE_BOOT); qemuCapsSet(flags, QEMU_CAPS_DRIVE_BOOT);
if (strstr(help, "serial=s")) if (strstr(help, "serial=s"))
qemuCapsSet(&flags, QEMU_CAPS_DRIVE_SERIAL); qemuCapsSet(flags, QEMU_CAPS_DRIVE_SERIAL);
if (strstr(help, "-pcidevice")) if (strstr(help, "-pcidevice"))
qemuCapsSet(&flags, QEMU_CAPS_PCIDEVICE); qemuCapsSet(flags, QEMU_CAPS_PCIDEVICE);
if (strstr(help, "-mem-path")) if (strstr(help, "-mem-path"))
qemuCapsSet(&flags, QEMU_CAPS_MEM_PATH); qemuCapsSet(flags, QEMU_CAPS_MEM_PATH);
if (strstr(help, "-chardev")) { if (strstr(help, "-chardev")) {
qemuCapsSet(&flags, QEMU_CAPS_CHARDEV); qemuCapsSet(flags, QEMU_CAPS_CHARDEV);
if (strstr(help, "-chardev spicevmc")) if (strstr(help, "-chardev spicevmc"))
qemuCapsSet(&flags, QEMU_CAPS_CHARDEV_SPICEVMC); qemuCapsSet(flags, QEMU_CAPS_CHARDEV_SPICEVMC);
} }
if (strstr(help, "-balloon")) if (strstr(help, "-balloon"))
qemuCapsSet(&flags, QEMU_CAPS_BALLOON); qemuCapsSet(flags, QEMU_CAPS_BALLOON);
if (strstr(help, "-device")) { if (strstr(help, "-device")) {
qemuCapsSet(&flags, QEMU_CAPS_DEVICE); qemuCapsSet(flags, QEMU_CAPS_DEVICE);
/* /*
* When -device was introduced, qemu already supported drive's * When -device was introduced, qemu already supported drive's
* readonly option but didn't advertise that. * readonly option but didn't advertise that.
*/ */
qemuCapsSet(&flags, QEMU_CAPS_DRIVE_READONLY); qemuCapsSet(flags, QEMU_CAPS_DRIVE_READONLY);
} }
if (strstr(help, "-nodefconfig")) if (strstr(help, "-nodefconfig"))
qemuCapsSet(&flags, QEMU_CAPS_NODEFCONFIG); qemuCapsSet(flags, QEMU_CAPS_NODEFCONFIG);
/* The trailing ' ' is important to avoid a bogus match */ /* The trailing ' ' is important to avoid a bogus match */
if (strstr(help, "-rtc ")) if (strstr(help, "-rtc "))
qemuCapsSet(&flags, QEMU_CAPS_RTC); qemuCapsSet(flags, QEMU_CAPS_RTC);
/* to wit */ /* to wit */
if (strstr(help, "-rtc-td-hack")) if (strstr(help, "-rtc-td-hack"))
qemuCapsSet(&flags, QEMU_CAPS_RTC_TD_HACK); qemuCapsSet(flags, QEMU_CAPS_RTC_TD_HACK);
if (strstr(help, "-no-hpet")) if (strstr(help, "-no-hpet"))
qemuCapsSet(&flags, QEMU_CAPS_NO_HPET); qemuCapsSet(flags, QEMU_CAPS_NO_HPET);
if (strstr(help, "-no-kvm-pit-reinjection")) if (strstr(help, "-no-kvm-pit-reinjection"))
qemuCapsSet(&flags, QEMU_CAPS_NO_KVM_PIT); qemuCapsSet(flags, QEMU_CAPS_NO_KVM_PIT);
if (strstr(help, "-tdf")) if (strstr(help, "-tdf"))
qemuCapsSet(&flags, QEMU_CAPS_TDF); qemuCapsSet(flags, QEMU_CAPS_TDF);
if (strstr(help, "-enable-nesting")) if (strstr(help, "-enable-nesting"))
qemuCapsSet(&flags, QEMU_CAPS_NESTING); qemuCapsSet(flags, QEMU_CAPS_NESTING);
if (strstr(help, ",menu=on")) if (strstr(help, ",menu=on"))
qemuCapsSet(&flags, QEMU_CAPS_BOOT_MENU); qemuCapsSet(flags, QEMU_CAPS_BOOT_MENU);
if (strstr(help, "-fsdev")) if (strstr(help, "-fsdev"))
qemuCapsSet(&flags, QEMU_CAPS_FSDEV); qemuCapsSet(flags, QEMU_CAPS_FSDEV);
if (strstr(help, "-smbios type")) if (strstr(help, "-smbios type"))
qemuCapsSet(&flags, QEMU_CAPS_SMBIOS_TYPE); qemuCapsSet(flags, QEMU_CAPS_SMBIOS_TYPE);
if (strstr(help, "-netdev")) { if (strstr(help, "-netdev")) {
/* Disable -netdev on 0.12 since although it exists, /* Disable -netdev on 0.12 since although it exists,
* the corresponding netdev_add/remove monitor commands * the corresponding netdev_add/remove monitor commands
* do not, and we need them to be able todo hotplug */ * do not, and we need them to be able todo hotplug */
if (version >= 13000) if (version >= 13000)
qemuCapsSet(&flags, QEMU_CAPS_NETDEV); qemuCapsSet(flags, QEMU_CAPS_NETDEV);
} }
if (strstr(help, "-sdl")) if (strstr(help, "-sdl"))
qemuCapsSet(&flags, QEMU_CAPS_SDL); qemuCapsSet(flags, QEMU_CAPS_SDL);
if (strstr(help, "cores=") && if (strstr(help, "cores=") &&
strstr(help, "threads=") && strstr(help, "threads=") &&
strstr(help, "sockets=")) strstr(help, "sockets="))
qemuCapsSet(&flags, QEMU_CAPS_SMP_TOPOLOGY); qemuCapsSet(flags, QEMU_CAPS_SMP_TOPOLOGY);
if (version >= 9000) if (version >= 9000)
qemuCapsSet(&flags, QEMU_CAPS_VNC_COLON); qemuCapsSet(flags, QEMU_CAPS_VNC_COLON);
if (is_kvm && (version >= 10000 || kvm_version >= 74)) if (is_kvm && (version >= 10000 || kvm_version >= 74))
qemuCapsSet(&flags, QEMU_CAPS_VNET_HDR); qemuCapsSet(flags, QEMU_CAPS_VNET_HDR);
if (is_kvm && strstr(help, ",vhost=")) { if (is_kvm && strstr(help, ",vhost=")) {
qemuCapsSet(&flags, QEMU_CAPS_VNET_HOST); qemuCapsSet(flags, QEMU_CAPS_VNET_HOST);
} }
/* /*
@ -919,22 +921,22 @@ qemuCapsComputeCmdFlags(const char *help,
* while waiting for data, so pretend it doesn't exist * while waiting for data, so pretend it doesn't exist
*/ */
if (version >= 10000) { if (version >= 10000) {
qemuCapsSet(&flags, QEMU_CAPS_MIGRATE_QEMU_TCP); qemuCapsSet(flags, QEMU_CAPS_MIGRATE_QEMU_TCP);
qemuCapsSet(&flags, QEMU_CAPS_MIGRATE_QEMU_EXEC); qemuCapsSet(flags, QEMU_CAPS_MIGRATE_QEMU_EXEC);
if (version >= 12000) { if (version >= 12000) {
qemuCapsSet(&flags, QEMU_CAPS_MIGRATE_QEMU_UNIX); qemuCapsSet(flags, QEMU_CAPS_MIGRATE_QEMU_UNIX);
qemuCapsSet(&flags, QEMU_CAPS_MIGRATE_QEMU_FD); qemuCapsSet(flags, QEMU_CAPS_MIGRATE_QEMU_FD);
} }
} else if (kvm_version >= 79) { } else if (kvm_version >= 79) {
qemuCapsSet(&flags, QEMU_CAPS_MIGRATE_QEMU_TCP); qemuCapsSet(flags, QEMU_CAPS_MIGRATE_QEMU_TCP);
if (kvm_version >= 80) if (kvm_version >= 80)
qemuCapsSet(&flags, QEMU_CAPS_MIGRATE_QEMU_EXEC); qemuCapsSet(flags, QEMU_CAPS_MIGRATE_QEMU_EXEC);
} else if (kvm_version > 0) { } else if (kvm_version > 0) {
qemuCapsSet(&flags, QEMU_CAPS_MIGRATE_KVM_STDIO); qemuCapsSet(flags, QEMU_CAPS_MIGRATE_KVM_STDIO);
} }
if (version >= 10000) if (version >= 10000)
qemuCapsSet(&flags, QEMU_CAPS_0_10); qemuCapsSet(flags, QEMU_CAPS_0_10);
/* While JSON mode was available in 0.12.0, it was too /* While JSON mode was available in 0.12.0, it was too
* incomplete to contemplate using. The 0.13.0 release * incomplete to contemplate using. The 0.13.0 release
@ -943,9 +945,7 @@ qemuCapsComputeCmdFlags(const char *help,
* the downside. * the downside.
*/ */
if (version >= 13000) if (version >= 13000)
qemuCapsSet(&flags, QEMU_CAPS_MONITOR_JSON); qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON);
return flags;
} }
/* We parse the output of 'qemu -help' to get the QEMU /* We parse the output of 'qemu -help' to get the QEMU
@ -974,15 +974,16 @@ qemuCapsComputeCmdFlags(const char *help,
int qemuCapsParseHelpStr(const char *qemu, int qemuCapsParseHelpStr(const char *qemu,
const char *help, const char *help,
unsigned long long *flags, virBitmapPtr flags,
unsigned int *version, unsigned int *version,
unsigned int *is_kvm, unsigned int *is_kvm,
unsigned int *kvm_version) unsigned int *kvm_version)
{ {
unsigned major, minor, micro; unsigned major, minor, micro;
const char *p = help; const char *p = help;
char *strflags;
*flags = *version = *is_kvm = *kvm_version = 0; *version = *is_kvm = *kvm_version = 0;
if (STRPREFIX(p, QEMU_VERSION_STR_1)) if (STRPREFIX(p, QEMU_VERSION_STR_1))
p += strlen(QEMU_VERSION_STR_1); p += strlen(QEMU_VERSION_STR_1);
@ -1029,10 +1030,13 @@ int qemuCapsParseHelpStr(const char *qemu,
*version = (major * 1000 * 1000) + (minor * 1000) + micro; *version = (major * 1000 * 1000) + (minor * 1000) + micro;
*flags = qemuCapsComputeCmdFlags(help, *version, *is_kvm, *kvm_version); qemuCapsComputeCmdFlags(help, *version, *is_kvm, *kvm_version, flags);
strflags = virBitmapString(flags);
VIR_DEBUG("Version %u.%u.%u, cooked version %u, flags %s",
major, minor, micro, *version, NULLSTR(strflags));
VIR_FREE(strflags);
VIR_DEBUG("Version %u.%u.%u, cooked version %u, flags 0x%llx",
major, minor, micro, *version, *flags);
if (*kvm_version) if (*kvm_version)
VIR_DEBUG("KVM version %d detected", *kvm_version); VIR_DEBUG("KVM version %d detected", *kvm_version);
else if (*is_kvm) else if (*is_kvm)
@ -1056,7 +1060,7 @@ fail:
static int static int
qemuCapsExtractDeviceStr(const char *qemu, qemuCapsExtractDeviceStr(const char *qemu,
unsigned long long *flags) virBitmapPtr flags)
{ {
char *output = NULL; char *output = NULL;
virCommandPtr cmd; virCommandPtr cmd;
@ -1094,7 +1098,7 @@ cleanup:
int int
qemuCapsParseDeviceStr(const char *str, unsigned long long *flags) qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
{ {
/* Which devices exist. */ /* Which devices exist. */
if (strstr(str, "name \"hda-duplex\"")) if (strstr(str, "name \"hda-duplex\""))
@ -1104,7 +1108,7 @@ qemuCapsParseDeviceStr(const char *str, unsigned long long *flags)
if (strstr(str, "name \"ccid-card-passthru\"")) if (strstr(str, "name \"ccid-card-passthru\""))
qemuCapsSet(flags, QEMU_CAPS_CCID_PASSTHRU); qemuCapsSet(flags, QEMU_CAPS_CCID_PASSTHRU);
/* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */ /* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */
if (!qemuCapsGet(*flags, QEMU_CAPS_CHARDEV_SPICEVMC) && if (!qemuCapsGet(flags, QEMU_CAPS_CHARDEV_SPICEVMC) &&
strstr(str, "name \"spicevmc\"")) strstr(str, "name \"spicevmc\""))
qemuCapsSet(flags, QEMU_CAPS_DEVICE_SPICEVMC); qemuCapsSet(flags, QEMU_CAPS_DEVICE_SPICEVMC);
@ -1124,16 +1128,16 @@ qemuCapsParseDeviceStr(const char *str, unsigned long long *flags)
int qemuCapsExtractVersionInfo(const char *qemu, const char *arch, int qemuCapsExtractVersionInfo(const char *qemu, const char *arch,
unsigned int *retversion, unsigned int *retversion,
unsigned long long *retflags) virBitmapPtr *retflags)
{ {
int ret = -1; int ret = -1;
unsigned int version, is_kvm, kvm_version; unsigned int version, is_kvm, kvm_version;
unsigned long long flags = 0; virBitmapPtr flags = NULL;
char *help = NULL; char *help = NULL;
virCommandPtr cmd; virCommandPtr cmd;
if (retflags) if (retflags)
*retflags = 0; *retflags = NULL;
if (retversion) if (retversion)
*retversion = 0; *retversion = 0;
@ -1154,33 +1158,37 @@ int qemuCapsExtractVersionInfo(const char *qemu, const char *arch,
if (virCommandRun(cmd, NULL) < 0) if (virCommandRun(cmd, NULL) < 0)
goto cleanup; goto cleanup;
if (qemuCapsParseHelpStr(qemu, help, &flags, if (!(flags = qemuCapsNew()) ||
qemuCapsParseHelpStr(qemu, help, flags,
&version, &is_kvm, &kvm_version) == -1) &version, &is_kvm, &kvm_version) == -1)
goto cleanup; goto cleanup;
/* Currently only x86_64 and i686 support PCI-multibus. */ /* Currently only x86_64 and i686 support PCI-multibus. */
if (STREQLEN(arch, "x86_64", 6) || if (STREQLEN(arch, "x86_64", 6) ||
STREQLEN(arch, "i686", 4)) { STREQLEN(arch, "i686", 4)) {
qemuCapsSet(&flags, QEMU_CAPS_PCI_MULTIBUS); qemuCapsSet(flags, QEMU_CAPS_PCI_MULTIBUS);
} }
/* qemuCapsExtractDeviceStr will only set additional flags if qemu /* qemuCapsExtractDeviceStr will only set additional flags if qemu
* understands the 0.13.0+ notion of "-device driver,". */ * understands the 0.13.0+ notion of "-device driver,". */
if (qemuCapsGet(flags, QEMU_CAPS_DEVICE) && if (qemuCapsGet(flags, QEMU_CAPS_DEVICE) &&
strstr(help, "-device driver,?") && strstr(help, "-device driver,?") &&
qemuCapsExtractDeviceStr(qemu, &flags) < 0) qemuCapsExtractDeviceStr(qemu, flags) < 0)
goto cleanup; goto cleanup;
if (retversion) if (retversion)
*retversion = version; *retversion = version;
if (retflags) if (retflags) {
*retflags = flags; *retflags = flags;
flags = NULL;
}
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(help); VIR_FREE(help);
virCommandFree(cmd); virCommandFree(cmd);
qemuCapsFree(flags);
return ret; return ret;
} }
@ -1233,25 +1241,55 @@ int qemuCapsExtractVersion(virCapsPtr caps,
} }
void virBitmapPtr
qemuCapsSet(unsigned long long *caps, qemuCapsNew(void)
enum qemuCapsFlags flag)
{ {
*caps |= flag; virBitmapPtr caps;
if (!(caps = virBitmapAlloc(QEMU_CAPS_LAST)))
virReportOOMError();
return caps;
} }
void void
qemuCapsClear(unsigned long long *caps, qemuCapsSet(virBitmapPtr caps,
enum qemuCapsFlags flag) enum qemuCapsFlags flag)
{ {
*caps &= ~flag; ignore_value(virBitmapSetBit(caps, flag));
}
void
qemuCapsSetList(virBitmapPtr caps, ...)
{
va_list list;
int flag;
va_start(list, caps);
while ((flag = va_arg(list, int)) < QEMU_CAPS_LAST)
ignore_value(virBitmapSetBit(caps, flag));
va_end(list);
}
void
qemuCapsClear(virBitmapPtr caps,
enum qemuCapsFlags flag)
{
ignore_value(virBitmapClearBit(caps, flag));
} }
bool bool
qemuCapsGet(unsigned long long caps, qemuCapsGet(virBitmapPtr caps,
enum qemuCapsFlags flag) enum qemuCapsFlags flag)
{ {
return !!(caps & flag); bool b;
if (!caps || virBitmapGetBit(caps, flag, &b) < 0)
return false;
else
return b;
} }

View File

@ -24,84 +24,93 @@
#ifndef __QEMU_CAPABILITIES_H__ #ifndef __QEMU_CAPABILITIES_H__
# define __QEMU_CAPABILITIES_H__ # define __QEMU_CAPABILITIES_H__
# include "bitmap.h"
# include "capabilities.h" # include "capabilities.h"
/* Internal flags to keep track of qemu command line capabilities */ /* Internal flags to keep track of qemu command line capabilities */
enum qemuCapsFlags { enum qemuCapsFlags {
QEMU_CAPS_KQEMU = (1 << 0), /* Whether KQEMU is compiled in */ QEMU_CAPS_KQEMU = 0, /* Whether KQEMU is compiled in */
QEMU_CAPS_VNC_COLON = (1 << 1), /* Does the VNC take just port, or address + display */ QEMU_CAPS_VNC_COLON = 1, /* Does the VNC take just port, or address + display */
QEMU_CAPS_NO_REBOOT = (1 << 2), /* Is the -no-reboot flag available */ QEMU_CAPS_NO_REBOOT = 2, /* Is the -no-reboot flag available */
QEMU_CAPS_DRIVE = (1 << 3), /* Is the new -drive arg available */ QEMU_CAPS_DRIVE = 3, /* Is the new -drive arg available */
QEMU_CAPS_DRIVE_BOOT = (1 << 4), /* Does -drive support boot=on */ QEMU_CAPS_DRIVE_BOOT = 4, /* Does -drive support boot=on */
QEMU_CAPS_NAME = (1 << 5), /* Is the -name flag available */ QEMU_CAPS_NAME = 5, /* Is the -name flag available */
QEMU_CAPS_UUID = (1 << 6), /* Is the -uuid flag available */ QEMU_CAPS_UUID = 6, /* Is the -uuid flag available */
QEMU_CAPS_DOMID = (1 << 7), /* Xenner only, special -domid flag available */ QEMU_CAPS_DOMID = 7, /* Xenner only, special -domid flag available */
QEMU_CAPS_VNET_HDR = (1 << 8), QEMU_CAPS_VNET_HDR = 8,
QEMU_CAPS_MIGRATE_KVM_STDIO = (1 << 9), /* Original migration code from KVM. Also had tcp, but we can't use that QEMU_CAPS_MIGRATE_KVM_STDIO = 9, /* Original migration code from KVM. Also had tcp, but we can't use that
* since it had a design bug blocking the entire monitor console */ * since it had a design bug blocking the entire monitor console */
QEMU_CAPS_MIGRATE_QEMU_TCP = (1 << 10), /* New migration syntax after merge to QEMU with TCP transport */ QEMU_CAPS_MIGRATE_QEMU_TCP = 10, /* New migration syntax after merge to QEMU with TCP transport */
QEMU_CAPS_MIGRATE_QEMU_EXEC = (1 << 11), /* New migration syntax after merge to QEMU with EXEC transport */ QEMU_CAPS_MIGRATE_QEMU_EXEC = 11, /* New migration syntax after merge to QEMU with EXEC transport */
QEMU_CAPS_DRIVE_CACHE_V2 = (1 << 12), /* Is the cache= flag wanting new v2 values */ QEMU_CAPS_DRIVE_CACHE_V2 = 12, /* Is the cache= flag wanting new v2 values */
QEMU_CAPS_KVM = (1 << 13), /* Whether KVM is compiled in */ QEMU_CAPS_KVM = 13, /* Whether KVM is compiled in */
QEMU_CAPS_DRIVE_FORMAT = (1 << 14), /* Is -drive format= avail */ QEMU_CAPS_DRIVE_FORMAT = 14, /* Is -drive format= avail */
QEMU_CAPS_VGA = (1 << 15), /* Is -vga avail */ QEMU_CAPS_VGA = 15, /* Is -vga avail */
/* features added in qemu-0.10.0 or later */ /* features added in qemu-0.10.0 or later */
QEMU_CAPS_0_10 = (1 << 16), QEMU_CAPS_0_10 = 16,
QEMU_CAPS_NET_NAME = QEMU_CAPS_0_10, /* -net ...,name=str */ QEMU_CAPS_NET_NAME = QEMU_CAPS_0_10, /* -net ...,name=str */
QEMU_CAPS_HOST_NET_ADD = QEMU_CAPS_0_10, /* host_net_add monitor command */ QEMU_CAPS_HOST_NET_ADD = QEMU_CAPS_0_10, /* host_net_add monitor command */
QEMU_CAPS_PCIDEVICE = (1 << 17), /* PCI device assignment only supported by qemu-kvm */ QEMU_CAPS_PCIDEVICE = 17, /* PCI device assignment only supported by qemu-kvm */
QEMU_CAPS_MEM_PATH = (1 << 18), /* mmap'ped guest backing supported */ QEMU_CAPS_MEM_PATH = 18, /* mmap'ped guest backing supported */
QEMU_CAPS_DRIVE_SERIAL = (1 << 19), /* -driver serial= available */ QEMU_CAPS_DRIVE_SERIAL = 19, /* -driver serial= available */
QEMU_CAPS_XEN_DOMID = (1 << 20), /* -xen-domid (new style xen integration) */ QEMU_CAPS_XEN_DOMID = 20, /* -xen-domid (new style xen integration) */
QEMU_CAPS_MIGRATE_QEMU_UNIX = (1 << 21), /* Does qemu support unix domain sockets for migration? */ QEMU_CAPS_MIGRATE_QEMU_UNIX = 21, /* Does qemu support unix domain sockets for migration? */
QEMU_CAPS_CHARDEV = (1 << 22), /* Is the new -chardev arg available */ QEMU_CAPS_CHARDEV = 22, /* Is the new -chardev arg available */
QEMU_CAPS_ENABLE_KVM = (1 << 23), /* Is the -enable-kvm flag available to "enable KVM full virtualization support" */ QEMU_CAPS_ENABLE_KVM = 23, /* Is the -enable-kvm flag available to "enable KVM full virtualization support" */
QEMU_CAPS_MONITOR_JSON = (1 << 24), /* JSON mode for monitor */ QEMU_CAPS_MONITOR_JSON = 24, /* JSON mode for monitor */
QEMU_CAPS_BALLOON = (1 << 25), /* -balloon available */ QEMU_CAPS_BALLOON = 25, /* -balloon available */
QEMU_CAPS_DEVICE = (1 << 26), /* Is the new -device arg available */ QEMU_CAPS_DEVICE = 26, /* Is the new -device arg available */
QEMU_CAPS_SDL = (1 << 27), /* Is the new -sdl arg available */ QEMU_CAPS_SDL = 27, /* Is the new -sdl arg available */
QEMU_CAPS_SMP_TOPOLOGY = (1 << 28), /* Is sockets=s,cores=c,threads=t available for -smp? */ QEMU_CAPS_SMP_TOPOLOGY = 28, /* Is sockets=s,cores=c,threads=t available for -smp? */
QEMU_CAPS_NETDEV = (1 << 29), /* The -netdev flag & netdev_add/remove monitor commands */ QEMU_CAPS_NETDEV = 29, /* The -netdev flag & netdev_add/remove monitor commands */
QEMU_CAPS_RTC = (1 << 30), /* The -rtc flag for clock options */ QEMU_CAPS_RTC = 30, /* The -rtc flag for clock options */
QEMU_CAPS_VNET_HOST = (1LL << 31), /* vnet-host support is available in qemu */ QEMU_CAPS_VNET_HOST = 31, /* vnet-host support is available in qemu */
QEMU_CAPS_RTC_TD_HACK = (1LL << 32), /* -rtc-td-hack available */ QEMU_CAPS_RTC_TD_HACK = 32, /* -rtc-td-hack available */
QEMU_CAPS_NO_HPET = (1LL << 33), /* -no-hpet flag is supported */ QEMU_CAPS_NO_HPET = 33, /* -no-hpet flag is supported */
QEMU_CAPS_NO_KVM_PIT = (1LL << 34), /* -no-kvm-pit-reinjection supported */ QEMU_CAPS_NO_KVM_PIT = 34, /* -no-kvm-pit-reinjection supported */
QEMU_CAPS_TDF = (1LL << 35), /* -tdf flag (user-mode pit catchup) */ QEMU_CAPS_TDF = 35, /* -tdf flag (user-mode pit catchup) */
QEMU_CAPS_PCI_CONFIGFD = (1LL << 36), /* pci-assign.configfd */ QEMU_CAPS_PCI_CONFIGFD = 36, /* pci-assign.configfd */
QEMU_CAPS_NODEFCONFIG = (1LL << 37), /* -nodefconfig */ QEMU_CAPS_NODEFCONFIG = 37, /* -nodefconfig */
QEMU_CAPS_BOOT_MENU = (1LL << 38), /* -boot menu=on support */ QEMU_CAPS_BOOT_MENU = 38, /* -boot menu=on support */
QEMU_CAPS_ENABLE_KQEMU = (1LL << 39), /* -enable-kqemu flag */ QEMU_CAPS_ENABLE_KQEMU = 39, /* -enable-kqemu flag */
QEMU_CAPS_FSDEV = (1LL << 40), /* -fstype filesystem passthrough */ QEMU_CAPS_FSDEV = 40, /* -fstype filesystem passthrough */
QEMU_CAPS_NESTING = (1LL << 41), /* -enable-nesting (SVM/VMX) */ QEMU_CAPS_NESTING = 41, /* -enable-nesting (SVM/VMX) */
QEMU_CAPS_NAME_PROCESS = (1LL << 42), /* Is -name process= available */ QEMU_CAPS_NAME_PROCESS = 42, /* Is -name process= available */
QEMU_CAPS_DRIVE_READONLY= (1LL << 43), /* -drive readonly=on|off */ QEMU_CAPS_DRIVE_READONLY = 43, /* -drive readonly=on|off */
QEMU_CAPS_SMBIOS_TYPE = (1LL << 44), /* Is -smbios type= available */ QEMU_CAPS_SMBIOS_TYPE = 44, /* Is -smbios type= available */
QEMU_CAPS_VGA_QXL = (1LL << 45), /* The 'qxl' arg for '-vga' */ QEMU_CAPS_VGA_QXL = 45, /* The 'qxl' arg for '-vga' */
QEMU_CAPS_SPICE = (1LL << 46), /* Is -spice avail */ QEMU_CAPS_SPICE = 46, /* Is -spice avail */
QEMU_CAPS_VGA_NONE = (1LL << 47), /* The 'none' arg for '-vga' */ QEMU_CAPS_VGA_NONE = 47, /* The 'none' arg for '-vga' */
QEMU_CAPS_MIGRATE_QEMU_FD = (1LL << 48), /* -incoming fd:n */ QEMU_CAPS_MIGRATE_QEMU_FD = 48, /* -incoming fd:n */
QEMU_CAPS_BOOTINDEX = (1LL << 49), /* -device bootindex property */ QEMU_CAPS_BOOTINDEX = 49, /* -device bootindex property */
QEMU_CAPS_HDA_DUPLEX = (1LL << 50), /* -device hda-duplex */ QEMU_CAPS_HDA_DUPLEX = 50, /* -device hda-duplex */
QEMU_CAPS_DRIVE_AIO = (1LL << 51), /* -drive aio= supported */ QEMU_CAPS_DRIVE_AIO = 51, /* -drive aio= supported */
QEMU_CAPS_PCI_MULTIBUS = (1LL << 52), /* bus=pci.0 vs bus=pci */ QEMU_CAPS_PCI_MULTIBUS = 52, /* bus=pci.0 vs bus=pci */
QEMU_CAPS_PCI_BOOTINDEX = (1LL << 53), /* pci-assign.bootindex */ QEMU_CAPS_PCI_BOOTINDEX = 53, /* pci-assign.bootindex */
QEMU_CAPS_CCID_EMULATED = (1LL << 54), /* -device ccid-card-emulated */ QEMU_CAPS_CCID_EMULATED = 54, /* -device ccid-card-emulated */
QEMU_CAPS_CCID_PASSTHRU = (1LL << 55), /* -device ccid-card-passthru */ QEMU_CAPS_CCID_PASSTHRU = 55, /* -device ccid-card-passthru */
QEMU_CAPS_CHARDEV_SPICEVMC = (1LL << 56), /* newer -chardev spicevmc */ QEMU_CAPS_CHARDEV_SPICEVMC = 56, /* newer -chardev spicevmc */
QEMU_CAPS_DEVICE_SPICEVMC = (1LL << 57), /* older -device spicevmc*/ QEMU_CAPS_DEVICE_SPICEVMC = 57, /* older -device spicevmc*/
QEMU_CAPS_VIRTIO_TX_ALG = (1LL << 58), /* -device virtio-net-pci,tx=string */ QEMU_CAPS_VIRTIO_TX_ALG = 58, /* -device virtio-net-pci,tx=string */
QEMU_CAPS_LAST, /* this must always be the last item */
}; };
void qemuCapsSet(unsigned long long *caps, virBitmapPtr qemuCapsNew(void);
enum qemuCapsFlags flag);
void qemuCapsClear(unsigned long long *caps, # define qemuCapsFree(caps) virBitmapFree(caps)
enum qemuCapsFlags flag);
bool qemuCapsGet(unsigned long long caps, void qemuCapsSet(virBitmapPtr caps,
enum qemuCapsFlags flag) ATTRIBUTE_NONNULL(1);
void qemuCapsSetList(virBitmapPtr caps, ...) ATTRIBUTE_NONNULL(1);
void qemuCapsClear(virBitmapPtr caps,
enum qemuCapsFlags flag) ATTRIBUTE_NONNULL(1);
bool qemuCapsGet(virBitmapPtr caps,
enum qemuCapsFlags flag); enum qemuCapsFlags flag);
virCapsPtr qemuCapsInit(virCapsPtr old_caps); virCapsPtr qemuCapsInit(virCapsPtr old_caps);
@ -111,7 +120,7 @@ int qemuCapsProbeMachineTypes(const char *binary,
int *nmachines); int *nmachines);
int qemuCapsProbeCPUModels(const char *qemu, int qemuCapsProbeCPUModels(const char *qemu,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
const char *arch, const char *arch,
unsigned int *count, unsigned int *count,
const char ***cpus); const char ***cpus);
@ -120,16 +129,16 @@ int qemuCapsExtractVersion(virCapsPtr caps,
unsigned int *version); unsigned int *version);
int qemuCapsExtractVersionInfo(const char *qemu, const char *arch, int qemuCapsExtractVersionInfo(const char *qemu, const char *arch,
unsigned int *version, unsigned int *version,
unsigned long long *qemuCaps); virBitmapPtr *qemuCaps);
int qemuCapsParseHelpStr(const char *qemu, int qemuCapsParseHelpStr(const char *qemu,
const char *str, const char *str,
unsigned long long *qemuCaps, virBitmapPtr qemuCaps,
unsigned int *version, unsigned int *version,
unsigned int *is_kvm, unsigned int *is_kvm,
unsigned int *kvm_version); unsigned int *kvm_version);
int qemuCapsParseDeviceStr(const char *str, int qemuCapsParseDeviceStr(const char *str,
unsigned long long *qemuCaps); virBitmapPtr qemuCaps);
#endif /* __QEMU_CAPABILITIES_H__*/ #endif /* __QEMU_CAPABILITIES_H__*/

View File

@ -109,7 +109,7 @@ int
qemuPhysIfaceConnect(virConnectPtr conn, qemuPhysIfaceConnect(virConnectPtr conn,
struct qemud_driver *driver, struct qemud_driver *driver,
virDomainNetDefPtr net, virDomainNetDefPtr net,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
const unsigned char *vmuuid, const unsigned char *vmuuid,
enum virVMOperationType vmop) enum virVMOperationType vmop)
{ {
@ -170,7 +170,7 @@ int
qemuNetworkIfaceConnect(virConnectPtr conn, qemuNetworkIfaceConnect(virConnectPtr conn,
struct qemud_driver *driver, struct qemud_driver *driver,
virDomainNetDefPtr net, virDomainNetDefPtr net,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
char *brname = NULL; char *brname = NULL;
int err; int err;
@ -305,7 +305,7 @@ cleanup:
static int static int
qemuOpenVhostNet(virDomainNetDefPtr net, qemuOpenVhostNet(virDomainNetDefPtr net,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
int *vhostfd) int *vhostfd)
{ {
@ -403,7 +403,7 @@ static int qemuAssignDeviceDiskAliasLegacy(virDomainDiskDefPtr disk)
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk, char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
char *ret; char *ret;
@ -501,7 +501,7 @@ no_memory:
int int
qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, unsigned long long qemuCaps) qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, virBitmapPtr qemuCaps)
{ {
if (qemuCapsGet(qemuCaps, QEMU_CAPS_DRIVE)) { if (qemuCapsGet(qemuCaps, QEMU_CAPS_DRIVE)) {
if (qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) if (qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
@ -584,7 +584,7 @@ qemuAssignDeviceControllerAlias(virDomainControllerDefPtr controller)
static int static int
qemuAssignDeviceAliases(virDomainDefPtr def, unsigned long long qemuCaps) qemuAssignDeviceAliases(virDomainDefPtr def, virBitmapPtr qemuCaps)
{ {
int i; int i;
@ -720,7 +720,7 @@ int
qemuDomainAssignPCIAddresses(virDomainDefPtr def) qemuDomainAssignPCIAddresses(virDomainDefPtr def)
{ {
int ret = -1; int ret = -1;
unsigned long long qemuCaps = 0; virBitmapPtr qemuCaps = NULL;
qemuDomainPCIAddressSetPtr addrs = NULL; qemuDomainPCIAddressSetPtr addrs = NULL;
if (qemuCapsExtractVersionInfo(def->emulator, def->os.arch, if (qemuCapsExtractVersionInfo(def->emulator, def->os.arch,
@ -739,6 +739,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def)
ret = 0; ret = 0;
cleanup: cleanup:
qemuCapsFree(qemuCaps);
qemuDomainPCIAddressSetFree(addrs); qemuDomainPCIAddressSetFree(addrs);
return ret; return ret;
@ -1126,7 +1127,7 @@ error:
static int static int
qemuBuildDeviceAddressStr(virBufferPtr buf, qemuBuildDeviceAddressStr(virBufferPtr buf,
virDomainDeviceInfoPtr info, virDomainDeviceInfoPtr info,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
if (info->addr.pci.domain != 0) { if (info->addr.pci.domain != 0) {
@ -1180,7 +1181,7 @@ qemuSafeSerialParamValue(const char *value)
char * char *
qemuBuildDriveStr(virDomainDiskDefPtr disk, qemuBuildDriveStr(virDomainDiskDefPtr disk,
int bootable, int bootable,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer opt = VIR_BUFFER_INITIALIZER; virBuffer opt = VIR_BUFFER_INITIALIZER;
const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus); const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus);
@ -1396,7 +1397,7 @@ error:
char * char *
qemuBuildDriveDevStr(virDomainDiskDefPtr disk, qemuBuildDriveDevStr(virDomainDiskDefPtr disk,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer opt = VIR_BUFFER_INITIALIZER; virBuffer opt = VIR_BUFFER_INITIALIZER;
const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus); const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus);
@ -1453,7 +1454,7 @@ error:
char *qemuBuildFSStr(virDomainFSDefPtr fs, char *qemuBuildFSStr(virDomainFSDefPtr fs,
unsigned long long qemuCaps ATTRIBUTE_UNUSED) virBitmapPtr qemuCaps ATTRIBUTE_UNUSED)
{ {
virBuffer opt = VIR_BUFFER_INITIALIZER; virBuffer opt = VIR_BUFFER_INITIALIZER;
@ -1489,7 +1490,7 @@ error:
char * char *
qemuBuildFSDevStr(virDomainFSDefPtr fs, qemuBuildFSDevStr(virDomainFSDefPtr fs,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer opt = VIR_BUFFER_INITIALIZER; virBuffer opt = VIR_BUFFER_INITIALIZER;
@ -1520,7 +1521,7 @@ error:
char * char *
qemuBuildControllerDevStr(virDomainControllerDefPtr def, qemuBuildControllerDevStr(virDomainControllerDefPtr def,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
@ -1605,7 +1606,7 @@ qemuBuildNicStr(virDomainNetDefPtr net,
char * char *
qemuBuildNicDevStr(virDomainNetDefPtr net, qemuBuildNicDevStr(virDomainNetDefPtr net,
int vlan, int vlan,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
const char *nic; const char *nic;
@ -1777,7 +1778,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
char * char *
qemuBuildWatchdogDevStr(virDomainWatchdogDefPtr dev, qemuBuildWatchdogDevStr(virDomainWatchdogDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
@ -1808,7 +1809,7 @@ error:
char * char *
qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev, qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
@ -1855,7 +1856,7 @@ error:
char * char *
qemuBuildSoundDevStr(virDomainSoundDefPtr sound, qemuBuildSoundDevStr(virDomainSoundDefPtr sound,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
const char *model = virDomainSoundModelTypeToString(sound->model); const char *model = virDomainSoundModelTypeToString(sound->model);
@ -1917,7 +1918,7 @@ error:
static char * static char *
qemuBuildVideoDevStr(virDomainVideoDefPtr video, qemuBuildVideoDevStr(virDomainVideoDefPtr video,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
const char *model = qemuVideoTypeToString(video->type); const char *model = qemuVideoTypeToString(video->type);
@ -1973,7 +1974,7 @@ qemuOpenPCIConfig(virDomainHostdevDefPtr dev)
char * char *
qemuBuildPCIHostdevDevStr(virDomainHostdevDefPtr dev, const char *configfd, qemuBuildPCIHostdevDevStr(virDomainHostdevDefPtr dev, const char *configfd,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
@ -2066,7 +2067,7 @@ qemuBuildUSBHostdevUsbDevStr(virDomainHostdevDefPtr dev)
* host side of the character device */ * host side of the character device */
static char * static char *
qemuBuildChrChardevStr(virDomainChrSourceDefPtr dev, const char *alias, qemuBuildChrChardevStr(virDomainChrSourceDefPtr dev, const char *alias,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
bool telnet; bool telnet;
@ -2244,7 +2245,7 @@ error:
static char * static char *
qemuBuildVirtioSerialPortDevStr(virDomainChrDefPtr dev, qemuBuildVirtioSerialPortDevStr(virDomainChrDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE) if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE)
@ -2482,7 +2483,7 @@ static int
qemuBuildCpuArgStr(const struct qemud_driver *driver, qemuBuildCpuArgStr(const struct qemud_driver *driver,
const virDomainDefPtr def, const virDomainDefPtr def,
const char *emulator, const char *emulator,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
const struct utsname *ut, const struct utsname *ut,
char **opt, char **opt,
bool *hasHwVirt) bool *hasHwVirt)
@ -2607,7 +2608,7 @@ no_memory:
static char * static char *
qemuBuildSmpArgStr(const virDomainDefPtr def, qemuBuildSmpArgStr(const virDomainDefPtr def,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
@ -2660,7 +2661,7 @@ qemuBuildCommandLine(virConnectPtr conn,
virDomainDefPtr def, virDomainDefPtr def,
virDomainChrSourceDefPtr monitor_chr, virDomainChrSourceDefPtr monitor_chr,
bool monitor_json, bool monitor_json,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
const char *migrateFrom, const char *migrateFrom,
int migrateFd, int migrateFd,
virDomainSnapshotObjPtr current_snapshot, virDomainSnapshotObjPtr current_snapshot,
@ -2698,7 +2699,7 @@ qemuBuildCommandLine(virConnectPtr conn,
*/ */
if (qemuCapsGet(qemuCaps, QEMU_CAPS_KVM) && if (qemuCapsGet(qemuCaps, QEMU_CAPS_KVM) &&
(def->virtType == VIR_DOMAIN_VIRT_QEMU)) (def->virtType == VIR_DOMAIN_VIRT_QEMU))
qemuCapsClear(&qemuCaps, QEMU_CAPS_DRIVE_BOOT); qemuCapsClear(qemuCaps, QEMU_CAPS_DRIVE_BOOT);
switch (def->virtType) { switch (def->virtType) {
case VIR_DOMAIN_VIRT_QEMU: case VIR_DOMAIN_VIRT_QEMU:
@ -3241,13 +3242,13 @@ qemuBuildCommandLine(virConnectPtr conn,
if (disk->bus != VIR_DOMAIN_DISK_BUS_XEN) { if (disk->bus != VIR_DOMAIN_DISK_BUS_XEN) {
withDeviceArg = 1; withDeviceArg = 1;
} else { } else {
qemuCapsClear(&qemuCaps, QEMU_CAPS_DEVICE); qemuCapsClear(qemuCaps, QEMU_CAPS_DEVICE);
deviceFlagMasked = true; deviceFlagMasked = true;
} }
} }
optstr = qemuBuildDriveStr(disk, bootable, qemuCaps); optstr = qemuBuildDriveStr(disk, bootable, qemuCaps);
if (deviceFlagMasked) if (deviceFlagMasked)
qemuCapsSet(&qemuCaps, QEMU_CAPS_DEVICE); qemuCapsSet(qemuCaps, QEMU_CAPS_DEVICE);
if (!optstr) if (!optstr)
goto error; goto error;
virCommandAddArg(cmd, optstr); virCommandAddArg(cmd, optstr);

View File

@ -46,7 +46,7 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
virDomainDefPtr def, virDomainDefPtr def,
virDomainChrSourceDefPtr monitor_chr, virDomainChrSourceDefPtr monitor_chr,
bool monitor_json, bool monitor_json,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
const char *migrateFrom, const char *migrateFrom,
int migrateFd, int migrateFd,
virDomainSnapshotObjPtr current_snapshot, virDomainSnapshotObjPtr current_snapshot,
@ -68,44 +68,44 @@ char * qemuBuildNicStr(virDomainNetDefPtr net,
/* Current, best practice */ /* Current, best practice */
char * qemuBuildNicDevStr(virDomainNetDefPtr net, char * qemuBuildNicDevStr(virDomainNetDefPtr net,
int vlan, int vlan,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk, char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
/* Both legacy & current support */ /* Both legacy & current support */
char *qemuBuildDriveStr(virDomainDiskDefPtr disk, char *qemuBuildDriveStr(virDomainDiskDefPtr disk,
int bootable, int bootable,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
char *qemuBuildFSStr(virDomainFSDefPtr fs, char *qemuBuildFSStr(virDomainFSDefPtr fs,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
/* Current, best practice */ /* Current, best practice */
char * qemuBuildDriveDevStr(virDomainDiskDefPtr disk, char * qemuBuildDriveDevStr(virDomainDiskDefPtr disk,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
char * qemuBuildFSDevStr(virDomainFSDefPtr fs, char * qemuBuildFSDevStr(virDomainFSDefPtr fs,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
/* Current, best practice */ /* Current, best practice */
char * qemuBuildControllerDevStr(virDomainControllerDefPtr def, char * qemuBuildControllerDevStr(virDomainControllerDefPtr def,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
char * qemuBuildWatchdogDevStr(virDomainWatchdogDefPtr dev, char * qemuBuildWatchdogDevStr(virDomainWatchdogDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
char * qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev, char * qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
char * qemuBuildUSBInputDevStr(virDomainInputDefPtr dev); char * qemuBuildUSBInputDevStr(virDomainInputDefPtr dev);
char * qemuBuildSoundDevStr(virDomainSoundDefPtr sound, char * qemuBuildSoundDevStr(virDomainSoundDefPtr sound,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
/* Legacy, pre device support */ /* Legacy, pre device support */
char * qemuBuildPCIHostdevPCIDevStr(virDomainHostdevDefPtr dev); char * qemuBuildPCIHostdevPCIDevStr(virDomainHostdevDefPtr dev);
/* Current, best practice */ /* Current, best practice */
char * qemuBuildPCIHostdevDevStr(virDomainHostdevDefPtr dev, char * qemuBuildPCIHostdevDevStr(virDomainHostdevDefPtr dev,
const char *configfd, const char *configfd,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuOpenPCIConfig(virDomainHostdevDefPtr dev); int qemuOpenPCIConfig(virDomainHostdevDefPtr dev);
@ -119,13 +119,13 @@ char * qemuBuildUSBHostdevDevStr(virDomainHostdevDefPtr dev);
int qemuNetworkIfaceConnect(virConnectPtr conn, int qemuNetworkIfaceConnect(virConnectPtr conn,
struct qemud_driver *driver, struct qemud_driver *driver,
virDomainNetDefPtr net, virDomainNetDefPtr net,
unsigned long long qemCmdFlags) virBitmapPtr qemuCaps)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
int qemuPhysIfaceConnect(virConnectPtr conn, int qemuPhysIfaceConnect(virConnectPtr conn,
struct qemud_driver *driver, struct qemud_driver *driver,
virDomainNetDefPtr net, virDomainNetDefPtr net,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
const unsigned char *vmuuid, const unsigned char *vmuuid,
enum virVMOperationType vmop); enum virVMOperationType vmop);
@ -156,7 +156,7 @@ int qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr ad
int qemuDomainNetVLAN(virDomainNetDefPtr def); int qemuDomainNetVLAN(virDomainNetDefPtr def);
int qemuAssignDeviceNetAlias(virDomainDefPtr def, virDomainNetDefPtr net, int idx); int qemuAssignDeviceNetAlias(virDomainDefPtr def, virDomainNetDefPtr net, int idx);
int qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, unsigned long long qemuCaps); int qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, virBitmapPtr qemuCaps);
int qemuAssignDeviceHostdevAlias(virDomainDefPtr def, virDomainHostdevDefPtr net, int idx); int qemuAssignDeviceHostdevAlias(virDomainDefPtr def, virDomainHostdevDefPtr net, int idx);
int qemuAssignDeviceControllerAlias(virDomainControllerDefPtr controller); int qemuAssignDeviceControllerAlias(virDomainControllerDefPtr controller);

View File

@ -3538,7 +3538,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
struct qemud_driver *driver = conn->privateData; struct qemud_driver *driver = conn->privateData;
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainChrSourceDef monConfig; virDomainChrSourceDef monConfig;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
virCommandPtr cmd = NULL; virCommandPtr cmd = NULL;
char *ret = NULL; char *ret = NULL;
int i; int i;
@ -3611,6 +3611,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
cleanup: cleanup:
qemuDriverUnlock(driver); qemuDriverUnlock(driver);
qemuCapsFree(qemuCaps);
virCommandFree(cmd); virCommandFree(cmd);
virDomainDefFree(def); virDomainDefFree(def);
return ret; return ret;
@ -3947,7 +3948,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
struct qemud_driver *driver = dom->conn->privateData; struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainDeviceDefPtr dev = NULL; virDomainDeviceDefPtr dev = NULL;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
virCgroupPtr cgroup = NULL; virCgroupPtr cgroup = NULL;
int ret = -1; int ret = -1;
@ -4078,6 +4079,7 @@ cleanup:
if (cgroup) if (cgroup)
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
qemuCapsFree(qemuCaps);
virDomainDeviceDefFree(dev); virDomainDeviceDefFree(dev);
if (vm) if (vm)
virDomainObjUnlock(vm); virDomainObjUnlock(vm);
@ -4105,7 +4107,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
struct qemud_driver *driver = dom->conn->privateData; struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainDeviceDefPtr dev = NULL; virDomainDeviceDefPtr dev = NULL;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
virCgroupPtr cgroup = NULL; virCgroupPtr cgroup = NULL;
int ret = -1; int ret = -1;
bool force = (flags & VIR_DOMAIN_DEVICE_MODIFY_FORCE) != 0; bool force = (flags & VIR_DOMAIN_DEVICE_MODIFY_FORCE) != 0;
@ -4211,6 +4213,7 @@ cleanup:
if (cgroup) if (cgroup)
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
qemuCapsFree(qemuCaps);
virDomainDeviceDefFree(dev); virDomainDeviceDefFree(dev);
if (vm) if (vm)
virDomainObjUnlock(vm); virDomainObjUnlock(vm);
@ -4223,7 +4226,7 @@ static int qemudDomainDetachDevice(virDomainPtr dom,
const char *xml) { const char *xml) {
struct qemud_driver *driver = dom->conn->privateData; struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
virDomainDeviceDefPtr dev = NULL; virDomainDeviceDefPtr dev = NULL;
int ret = -1; int ret = -1;
@ -4296,6 +4299,7 @@ endjob:
vm = NULL; vm = NULL;
cleanup: cleanup:
qemuCapsFree(qemuCaps);
virDomainDeviceDefFree(dev); virDomainDeviceDefFree(dev);
if (vm) if (vm)
virDomainObjUnlock(vm); virDomainObjUnlock(vm);

View File

@ -44,7 +44,7 @@
int qemuDomainChangeEjectableMedia(struct qemud_driver *driver, int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
bool force) bool force)
{ {
virDomainDiskDefPtr origdisk = NULL; virDomainDiskDefPtr origdisk = NULL;
@ -140,7 +140,7 @@ error:
int qemuDomainAttachPciDiskDevice(struct qemud_driver *driver, int qemuDomainAttachPciDiskDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int i, ret; int i, ret;
const char* type = virDomainDiskBusTypeToString(disk->bus); const char* type = virDomainDiskBusTypeToString(disk->bus);
@ -235,7 +235,7 @@ error:
int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver, int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainControllerDefPtr controller, virDomainControllerDefPtr controller,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int i; int i;
int ret = -1; int ret = -1;
@ -300,7 +300,7 @@ static virDomainControllerDefPtr
qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver, qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
int controller, int controller,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int i; int i;
virDomainControllerDefPtr cont; virDomainControllerDefPtr cont;
@ -346,7 +346,7 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
int qemuDomainAttachSCSIDisk(struct qemud_driver *driver, int qemuDomainAttachSCSIDisk(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int i; int i;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
@ -462,7 +462,7 @@ error:
int qemuDomainAttachUsbMassstorageDevice(struct qemud_driver *driver, int qemuDomainAttachUsbMassstorageDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
int i, ret; int i, ret;
@ -547,7 +547,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
struct qemud_driver *driver, struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainNetDefPtr net, virDomainNetDefPtr net,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
char *tapfd_name = NULL; char *tapfd_name = NULL;
@ -777,7 +777,7 @@ no_memory:
int qemuDomainAttachHostPciDevice(struct qemud_driver *driver, int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev, virDomainHostdevDefPtr hostdev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
int ret; int ret;
@ -872,7 +872,7 @@ error:
int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver, int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev, virDomainHostdevDefPtr hostdev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int ret; int ret;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
@ -935,7 +935,7 @@ error:
int qemuDomainAttachHostDevice(struct qemud_driver *driver, int qemuDomainAttachHostDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev, virDomainHostdevDefPtr hostdev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@ -1130,7 +1130,7 @@ static inline int qemuFindDisk(virDomainDefPtr def, const char *dst)
int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver, int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int i, ret = -1; int i, ret = -1;
virDomainDiskDefPtr detach = NULL; virDomainDiskDefPtr detach = NULL;
@ -1221,7 +1221,7 @@ cleanup:
int qemuDomainDetachSCSIDiskDevice(struct qemud_driver *driver, int qemuDomainDetachSCSIDiskDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int i, ret = -1; int i, ret = -1;
virDomainDiskDefPtr detach = NULL; virDomainDiskDefPtr detach = NULL;
@ -1350,7 +1350,7 @@ static bool qemuDomainControllerIsBusy(virDomainObjPtr vm,
int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver, int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int i, ret = -1; int i, ret = -1;
virDomainControllerDefPtr detach = NULL; virDomainControllerDefPtr detach = NULL;
@ -1434,7 +1434,7 @@ cleanup:
int qemuDomainDetachNetDevice(struct qemud_driver *driver, int qemuDomainDetachNetDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int i, ret = -1; int i, ret = -1;
virDomainNetDefPtr detach = NULL; virDomainNetDefPtr detach = NULL;
@ -1561,7 +1561,7 @@ cleanup:
int qemuDomainDetachHostPciDevice(struct qemud_driver *driver, int qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virDomainHostdevDefPtr detach = NULL; virDomainHostdevDefPtr detach = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
@ -1661,7 +1661,7 @@ int qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
int qemuDomainDetachHostUsbDevice(struct qemud_driver *driver, int qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virDomainHostdevDefPtr detach = NULL; virDomainHostdevDefPtr detach = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
@ -1743,7 +1743,7 @@ int qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
int qemuDomainDetachHostDevice(struct qemud_driver *driver, int qemuDomainDetachHostDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
virDomainHostdevDefPtr hostdev = dev->data.hostdev; virDomainHostdevDefPtr hostdev = dev->data.hostdev;
int ret; int ret;

View File

@ -32,41 +32,41 @@
int qemuDomainChangeEjectableMedia(struct qemud_driver *driver, int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
unsigned long long qemuCaps, virBitmapPtr qemuCaps,
bool force); bool force);
int qemuDomainAttachPciDiskDevice(struct qemud_driver *driver, int qemuDomainAttachPciDiskDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver, int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainControllerDefPtr controller, virDomainControllerDefPtr controller,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainAttachSCSIDisk(struct qemud_driver *driver, int qemuDomainAttachSCSIDisk(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainAttachUsbMassstorageDevice(struct qemud_driver *driver, int qemuDomainAttachUsbMassstorageDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainAttachNetDevice(virConnectPtr conn, int qemuDomainAttachNetDevice(virConnectPtr conn,
struct qemud_driver *driver, struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainNetDefPtr net, virDomainNetDefPtr net,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainAttachHostPciDevice(struct qemud_driver *driver, int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev, virDomainHostdevDefPtr hostdev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver, int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev, virDomainHostdevDefPtr hostdev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainAttachHostDevice(struct qemud_driver *driver, int qemuDomainAttachHostDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev, virDomainHostdevDefPtr hostdev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainChangeGraphics(struct qemud_driver *driver, int qemuDomainChangeGraphics(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainGraphicsDefPtr dev); virDomainGraphicsDefPtr dev);
@ -78,31 +78,31 @@ int qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver, int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainDetachSCSIDiskDevice(struct qemud_driver *driver, int qemuDomainDetachSCSIDiskDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver, int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainDetachNetDevice(struct qemud_driver *driver, int qemuDomainDetachNetDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainDetachHostPciDevice(struct qemud_driver *driver, int qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainDetachHostUsbDevice(struct qemud_driver *driver, int qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
int qemuDomainDetachHostDevice(struct qemud_driver *driver, int qemuDomainDetachHostDevice(struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
unsigned long long qemuCaps); virBitmapPtr qemuCaps);
#endif /* __QEMU_HOTPLUG_H__ */ #endif /* __QEMU_HOTPLUG_H__ */

View File

@ -244,7 +244,7 @@ qemuMigrationPrepareTunnel(struct qemud_driver *driver,
int ret = -1; int ret = -1;
int internalret; int internalret;
char *unixfile = NULL; char *unixfile = NULL;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
qemuDomainObjPrivatePtr priv = NULL; qemuDomainObjPrivatePtr priv = NULL;
struct timeval now; struct timeval now;
@ -376,6 +376,7 @@ endjob:
} }
cleanup: cleanup:
qemuCapsFree(qemuCaps);
virDomainDefFree(def); virDomainDefFree(def);
if (unixfile) if (unixfile)
unlink(unixfile); unlink(unixfile);
@ -708,7 +709,7 @@ static int doTunnelMigrate(struct qemud_driver *driver,
virStreamPtr st = NULL; virStreamPtr st = NULL;
char *unixfile = NULL; char *unixfile = NULL;
int internalret; int internalret;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
int status; int status;
unsigned long long transferred, remaining, total; unsigned long long transferred, remaining, total;
unsigned int background_flags = QEMU_MONITOR_MIGRATE_BACKGROUND; unsigned int background_flags = QEMU_MONITOR_MIGRATE_BACKGROUND;
@ -894,6 +895,7 @@ finish:
cleanup: cleanup:
VIR_FORCE_CLOSE(client_sock); VIR_FORCE_CLOSE(client_sock);
VIR_FORCE_CLOSE(qemu_sock); VIR_FORCE_CLOSE(qemu_sock);
qemuCapsFree(qemuCaps);
if (ddomain) if (ddomain)
virUnrefDomain(ddomain); virUnrefDomain(ddomain);

View File

@ -1137,7 +1137,7 @@ static int
qemuProcessInitPasswords(virConnectPtr conn, qemuProcessInitPasswords(virConnectPtr conn,
struct qemud_driver *driver, struct qemud_driver *driver,
virDomainObjPtr vm, virDomainObjPtr vm,
unsigned long long qemuCaps) virBitmapPtr qemuCaps)
{ {
int ret = 0; int ret = 0;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
@ -1789,7 +1789,7 @@ qemuProcessReconnect(void *payload, const char *name ATTRIBUTE_UNUSED, void *opa
struct qemuProcessReconnectData *data = opaque; struct qemuProcessReconnectData *data = opaque;
struct qemud_driver *driver = data->driver; struct qemud_driver *driver = data->driver;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
virConnectPtr conn = data->conn; virConnectPtr conn = data->conn;
virDomainObjLock(obj); virDomainObjLock(obj);
@ -1835,9 +1835,12 @@ qemuProcessReconnect(void *payload, const char *name ATTRIBUTE_UNUSED, void *opa
if (virDomainObjUnref(obj) > 0) if (virDomainObjUnref(obj) > 0)
virDomainObjUnlock(obj); virDomainObjUnlock(obj);
qemuCapsFree(qemuCaps);
return; return;
error: error:
qemuCapsFree(qemuCaps);
if (!virDomainObjIsActive(obj)) { if (!virDomainObjIsActive(obj)) {
if (virDomainObjUnref(obj) > 0) if (virDomainObjUnref(obj) > 0)
virDomainObjUnlock(obj); virDomainObjUnlock(obj);
@ -1879,7 +1882,7 @@ int qemuProcessStart(virConnectPtr conn,
enum virVMOperationType vmop) enum virVMOperationType vmop)
{ {
int ret; int ret;
unsigned long long qemuCaps; virBitmapPtr qemuCaps = NULL;
off_t pos = -1; off_t pos = -1;
char ebuf[1024]; char ebuf[1024];
char *pidfile = NULL; char *pidfile = NULL;
@ -2220,6 +2223,7 @@ int qemuProcessStart(virConnectPtr conn,
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
goto cleanup; goto cleanup;
qemuCapsFree(qemuCaps);
virCommandFree(cmd); virCommandFree(cmd);
VIR_FORCE_CLOSE(logfile); VIR_FORCE_CLOSE(logfile);
@ -2229,6 +2233,7 @@ cleanup:
/* We jump here if we failed to start the VM for any reason, or /* We jump here if we failed to start the VM for any reason, or
* if we failed to initialize the now running VM. kill it off and * if we failed to initialize the now running VM. kill it off and
* pretend we never started it */ * pretend we never started it */
qemuCapsFree(qemuCaps);
virCommandFree(cmd); virCommandFree(cmd);
VIR_FORCE_CLOSE(logfile); VIR_FORCE_CLOSE(logfile);
qemuProcessStop(driver, vm, 0); qemuProcessStop(driver, vm, 0);

View File

@ -13,7 +13,7 @@
struct testInfo { struct testInfo {
const char *name; const char *name;
unsigned long long flags; virBitmapPtr flags;
unsigned int version; unsigned int version;
unsigned int is_kvm; unsigned int is_kvm;
unsigned int kvm_version; unsigned int kvm_version;
@ -22,14 +22,14 @@ struct testInfo {
static char *progname; static char *progname;
static char *abs_srcdir; static char *abs_srcdir;
static void printMismatchedFlags(unsigned long long got, static void printMismatchedFlags(virBitmapPtr got,
unsigned long long expect) virBitmapPtr expect)
{ {
int i; int i;
for (i = 0 ; i < (sizeof(got)*CHAR_BIT) ; i++) { for (i = 0 ; i < QEMU_CAPS_LAST ; i++) {
unsigned long long gotFlag = (got & (1LL << i)); bool gotFlag = qemuCapsGet(got, i);
unsigned long long expectFlag = (expect & (1LL << i)); bool expectFlag = qemuCapsGet(expect, i);
if (gotFlag && !expectFlag) if (gotFlag && !expectFlag)
fprintf(stderr, "Extra flag %i\n", i); fprintf(stderr, "Extra flag %i\n", i);
if (!gotFlag && expectFlag) if (!gotFlag && expectFlag)
@ -44,8 +44,10 @@ static int testHelpStrParsing(const void *data)
char helpStr[MAX_HELP_OUTPUT_SIZE]; char helpStr[MAX_HELP_OUTPUT_SIZE];
char *help = &(helpStr[0]); char *help = &(helpStr[0]);
unsigned int version, is_kvm, kvm_version; unsigned int version, is_kvm, kvm_version;
unsigned long long flags; virBitmapPtr flags = NULL;
int ret = -1; int ret = -1;
char *got = NULL;
char *expected = NULL;
if (virAsprintf(&path, "%s/qemuhelpdata/%s", abs_srcdir, info->name) < 0) if (virAsprintf(&path, "%s/qemuhelpdata/%s", abs_srcdir, info->name) < 0)
return -1; return -1;
@ -53,7 +55,10 @@ static int testHelpStrParsing(const void *data)
if (virtTestLoadFile(path, &help, MAX_HELP_OUTPUT_SIZE) < 0) if (virtTestLoadFile(path, &help, MAX_HELP_OUTPUT_SIZE) < 0)
goto cleanup; goto cleanup;
if (qemuCapsParseHelpStr("QEMU", help, &flags, if (!(flags = qemuCapsNew()))
goto cleanup;
if (qemuCapsParseHelpStr("QEMU", help, flags,
&version, &is_kvm, &kvm_version) == -1) &version, &is_kvm, &kvm_version) == -1)
goto cleanup; goto cleanup;
@ -66,14 +71,19 @@ static int testHelpStrParsing(const void *data)
if (virtTestLoadFile(path, &help, MAX_HELP_OUTPUT_SIZE) < 0) if (virtTestLoadFile(path, &help, MAX_HELP_OUTPUT_SIZE) < 0)
goto cleanup; goto cleanup;
if (qemuCapsParseDeviceStr(help, &flags) < 0) if (qemuCapsParseDeviceStr(help, flags) < 0)
goto cleanup; goto cleanup;
} }
if (flags != info->flags) { got = virBitmapString(flags);
expected = virBitmapString(info->flags);
if (!got || !expected)
goto cleanup;
if (STRNEQ(got, expected)) {
fprintf(stderr, fprintf(stderr,
"Computed flags do not match: got 0x%llx, expected 0x%llx\n", "Computed flags do not match: got %s, expected %s\n",
flags, info->flags); got, expected);
if (getenv("VIR_TEST_DEBUG")) if (getenv("VIR_TEST_DEBUG"))
printMismatchedFlags(flags, info->flags); printMismatchedFlags(flags, info->flags);
@ -104,6 +114,9 @@ static int testHelpStrParsing(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(path); VIR_FREE(path);
qemuCapsFree(flags);
VIR_FREE(got);
VIR_FREE(expected);
return ret; return ret;
} }
@ -124,365 +137,359 @@ mymain(int argc, char **argv)
if (!abs_srcdir) if (!abs_srcdir)
abs_srcdir = getcwd(cwd, sizeof(cwd)); abs_srcdir = getcwd(cwd, sizeof(cwd));
# define DO_TEST(name, flags, version, is_kvm, kvm_version) \ # define DO_TEST(name, version, is_kvm, kvm_version, ...) \
do { \ do { \
const struct testInfo info = { name, flags, version, is_kvm, kvm_version }; \ struct testInfo info = { \
name, NULL, version, is_kvm, kvm_version \
}; \
if (!(info.flags = qemuCapsNew())) \
return EXIT_FAILURE; \
qemuCapsSetList(info.flags, __VA_ARGS__, QEMU_CAPS_LAST); \
if (virtTestRun("QEMU Help String Parsing " name, \ if (virtTestRun("QEMU Help String Parsing " name, \
1, testHelpStrParsing, &info) < 0) \ 1, testHelpStrParsing, &info) < 0) \
ret = -1; \ ret = -1; \
qemuCapsFree(info.flags); \
} while (0) } while (0)
DO_TEST("qemu-0.9.1", DO_TEST("qemu-0.9.1", 9001, 0, 0,
QEMU_CAPS_KQEMU | QEMU_CAPS_KQEMU,
QEMU_CAPS_VNC_COLON | QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT | QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE,
QEMU_CAPS_NAME);
DO_TEST("kvm-74", 9001, 1, 74,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME, QEMU_CAPS_NAME,
9001, 0, 0); QEMU_CAPS_VNET_HDR,
DO_TEST("kvm-74", QEMU_CAPS_MIGRATE_KVM_STDIO,
QEMU_CAPS_VNC_COLON | QEMU_CAPS_KVM,
QEMU_CAPS_NO_REBOOT | QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE | QEMU_CAPS_MEM_PATH,
QEMU_CAPS_DRIVE_BOOT | QEMU_CAPS_TDF);
QEMU_CAPS_NAME | DO_TEST("kvm-83-rhel56", 9001, 1, 83,
QEMU_CAPS_VNET_HDR | QEMU_CAPS_VNC_COLON,
QEMU_CAPS_MIGRATE_KVM_STDIO | QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_KVM | QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_FORMAT | QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_MEM_PATH | QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
QEMU_CAPS_VNET_HDR,
QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_KVM,
QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_VGA,
QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_MEM_PATH,
QEMU_CAPS_BALLOON,
QEMU_CAPS_RTC_TD_HACK,
QEMU_CAPS_NO_HPET,
QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_TDF, QEMU_CAPS_TDF,
9001, 1, 74); QEMU_CAPS_DRIVE_READONLY,
DO_TEST("kvm-83-rhel56", QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_VNC_COLON | QEMU_CAPS_SPICE);
QEMU_CAPS_NO_REBOOT | DO_TEST("qemu-0.10.5", 10005, 0, 0,
QEMU_CAPS_DRIVE | QEMU_CAPS_KQEMU,
QEMU_CAPS_DRIVE_BOOT | QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NAME | QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_UUID | QEMU_CAPS_DRIVE,
QEMU_CAPS_VNET_HDR | QEMU_CAPS_NAME,
QEMU_CAPS_MIGRATE_QEMU_TCP | QEMU_CAPS_UUID,
QEMU_CAPS_MIGRATE_QEMU_EXEC | QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_DRIVE_CACHE_V2 | QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_KVM | QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_DRIVE_FORMAT | QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_SERIAL | QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_VGA | QEMU_CAPS_VGA,
QEMU_CAPS_PCIDEVICE | QEMU_CAPS_0_10,
QEMU_CAPS_MEM_PATH | QEMU_CAPS_ENABLE_KVM,
QEMU_CAPS_BALLOON | QEMU_CAPS_SDL,
QEMU_CAPS_RTC_TD_HACK | QEMU_CAPS_RTC_TD_HACK,
QEMU_CAPS_NO_HPET | QEMU_CAPS_NO_HPET,
QEMU_CAPS_NO_KVM_PIT | QEMU_CAPS_VGA_NONE);
QEMU_CAPS_TDF | DO_TEST("qemu-kvm-0.10.5", 10005, 1, 0,
QEMU_CAPS_DRIVE_READONLY | QEMU_CAPS_VNC_COLON,
QEMU_CAPS_SMBIOS_TYPE | QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
QEMU_CAPS_VNET_HDR,
QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_KVM,
QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_VGA,
QEMU_CAPS_0_10,
QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_MEM_PATH,
QEMU_CAPS_SDL,
QEMU_CAPS_RTC_TD_HACK,
QEMU_CAPS_NO_HPET,
QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_TDF,
QEMU_CAPS_NESTING,
QEMU_CAPS_VGA_NONE);
DO_TEST("kvm-86", 10050, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
QEMU_CAPS_VNET_HDR,
QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_KVM,
QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_VGA,
QEMU_CAPS_0_10,
QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_SDL,
QEMU_CAPS_RTC_TD_HACK,
QEMU_CAPS_NO_HPET,
QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_TDF,
QEMU_CAPS_NESTING,
QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_VGA_NONE);
DO_TEST("qemu-kvm-0.11.0-rc2", 10092, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
QEMU_CAPS_VNET_HDR,
QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_KVM,
QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_VGA,
QEMU_CAPS_0_10,
QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_MEM_PATH,
QEMU_CAPS_ENABLE_KVM,
QEMU_CAPS_BALLOON,
QEMU_CAPS_SDL,
QEMU_CAPS_RTC_TD_HACK,
QEMU_CAPS_NO_HPET,
QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_TDF,
QEMU_CAPS_BOOT_MENU,
QEMU_CAPS_NESTING,
QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_VGA_NONE);
DO_TEST("qemu-0.12.1", 12001, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_DRIVE_READONLY,
QEMU_CAPS_VGA,
QEMU_CAPS_0_10,
QEMU_CAPS_ENABLE_KVM,
QEMU_CAPS_SDL,
QEMU_CAPS_XEN_DOMID,
QEMU_CAPS_MIGRATE_QEMU_UNIX,
QEMU_CAPS_CHARDEV,
QEMU_CAPS_BALLOON,
QEMU_CAPS_DEVICE,
QEMU_CAPS_SMP_TOPOLOGY,
QEMU_CAPS_RTC,
QEMU_CAPS_NO_HPET,
QEMU_CAPS_BOOT_MENU,
QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_VGA_NONE,
QEMU_CAPS_MIGRATE_QEMU_FD,
QEMU_CAPS_DRIVE_AIO);
DO_TEST("qemu-kvm-0.12.1.2-rhel60", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME,
QEMU_CAPS_UUID,
QEMU_CAPS_VNET_HDR,
QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_KVM,
QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_DRIVE_READONLY,
QEMU_CAPS_VGA,
QEMU_CAPS_0_10,
QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_MEM_PATH,
QEMU_CAPS_MIGRATE_QEMU_UNIX,
QEMU_CAPS_CHARDEV,
QEMU_CAPS_ENABLE_KVM,
QEMU_CAPS_BALLOON,
QEMU_CAPS_DEVICE,
QEMU_CAPS_SMP_TOPOLOGY,
QEMU_CAPS_RTC,
QEMU_CAPS_VNET_HOST,
QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_TDF,
QEMU_CAPS_PCI_CONFIGFD,
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_BOOT_MENU,
QEMU_CAPS_NESTING,
QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_VGA_QXL,
QEMU_CAPS_SPICE, QEMU_CAPS_SPICE,
9001, 1, 83);
DO_TEST("qemu-0.10.5",
QEMU_CAPS_KQEMU |
QEMU_CAPS_VNC_COLON |
QEMU_CAPS_NO_REBOOT |
QEMU_CAPS_DRIVE |
QEMU_CAPS_NAME |
QEMU_CAPS_UUID |
QEMU_CAPS_MIGRATE_QEMU_TCP |
QEMU_CAPS_MIGRATE_QEMU_EXEC |
QEMU_CAPS_DRIVE_CACHE_V2 |
QEMU_CAPS_DRIVE_FORMAT |
QEMU_CAPS_DRIVE_SERIAL |
QEMU_CAPS_VGA |
QEMU_CAPS_0_10 |
QEMU_CAPS_ENABLE_KVM |
QEMU_CAPS_SDL |
QEMU_CAPS_RTC_TD_HACK |
QEMU_CAPS_NO_HPET |
QEMU_CAPS_VGA_NONE, QEMU_CAPS_VGA_NONE,
10005, 0, 0); QEMU_CAPS_MIGRATE_QEMU_FD,
DO_TEST("qemu-kvm-0.10.5",
QEMU_CAPS_VNC_COLON |
QEMU_CAPS_NO_REBOOT |
QEMU_CAPS_DRIVE |
QEMU_CAPS_DRIVE_BOOT |
QEMU_CAPS_NAME |
QEMU_CAPS_UUID |
QEMU_CAPS_VNET_HDR |
QEMU_CAPS_MIGRATE_QEMU_TCP |
QEMU_CAPS_MIGRATE_QEMU_EXEC |
QEMU_CAPS_DRIVE_CACHE_V2 |
QEMU_CAPS_KVM |
QEMU_CAPS_DRIVE_FORMAT |
QEMU_CAPS_DRIVE_SERIAL |
QEMU_CAPS_VGA |
QEMU_CAPS_0_10 |
QEMU_CAPS_PCIDEVICE |
QEMU_CAPS_MEM_PATH |
QEMU_CAPS_SDL |
QEMU_CAPS_RTC_TD_HACK |
QEMU_CAPS_NO_HPET |
QEMU_CAPS_NO_KVM_PIT |
QEMU_CAPS_TDF |
QEMU_CAPS_NESTING |
QEMU_CAPS_VGA_NONE,
10005, 1, 0);
DO_TEST("kvm-86",
QEMU_CAPS_VNC_COLON |
QEMU_CAPS_NO_REBOOT |
QEMU_CAPS_DRIVE |
QEMU_CAPS_DRIVE_BOOT |
QEMU_CAPS_NAME |
QEMU_CAPS_UUID |
QEMU_CAPS_VNET_HDR |
QEMU_CAPS_MIGRATE_QEMU_TCP |
QEMU_CAPS_MIGRATE_QEMU_EXEC |
QEMU_CAPS_DRIVE_CACHE_V2 |
QEMU_CAPS_KVM |
QEMU_CAPS_DRIVE_FORMAT |
QEMU_CAPS_DRIVE_SERIAL |
QEMU_CAPS_VGA |
QEMU_CAPS_0_10 |
QEMU_CAPS_PCIDEVICE |
QEMU_CAPS_SDL |
QEMU_CAPS_RTC_TD_HACK |
QEMU_CAPS_NO_HPET |
QEMU_CAPS_NO_KVM_PIT |
QEMU_CAPS_TDF |
QEMU_CAPS_NESTING |
QEMU_CAPS_SMBIOS_TYPE |
QEMU_CAPS_VGA_NONE,
10050, 1, 0);
DO_TEST("qemu-kvm-0.11.0-rc2",
QEMU_CAPS_VNC_COLON |
QEMU_CAPS_NO_REBOOT |
QEMU_CAPS_DRIVE |
QEMU_CAPS_DRIVE_BOOT |
QEMU_CAPS_NAME |
QEMU_CAPS_UUID |
QEMU_CAPS_VNET_HDR |
QEMU_CAPS_MIGRATE_QEMU_TCP |
QEMU_CAPS_MIGRATE_QEMU_EXEC |
QEMU_CAPS_DRIVE_CACHE_V2 |
QEMU_CAPS_KVM |
QEMU_CAPS_DRIVE_FORMAT |
QEMU_CAPS_DRIVE_SERIAL |
QEMU_CAPS_VGA |
QEMU_CAPS_0_10 |
QEMU_CAPS_PCIDEVICE |
QEMU_CAPS_MEM_PATH |
QEMU_CAPS_ENABLE_KVM |
QEMU_CAPS_BALLOON |
QEMU_CAPS_SDL |
QEMU_CAPS_RTC_TD_HACK |
QEMU_CAPS_NO_HPET |
QEMU_CAPS_NO_KVM_PIT |
QEMU_CAPS_TDF |
QEMU_CAPS_BOOT_MENU |
QEMU_CAPS_NESTING |
QEMU_CAPS_NAME_PROCESS |
QEMU_CAPS_SMBIOS_TYPE |
QEMU_CAPS_VGA_NONE,
10092, 1, 0);
DO_TEST("qemu-0.12.1",
QEMU_CAPS_VNC_COLON |
QEMU_CAPS_NO_REBOOT |
QEMU_CAPS_DRIVE |
QEMU_CAPS_NAME |
QEMU_CAPS_UUID |
QEMU_CAPS_MIGRATE_QEMU_TCP |
QEMU_CAPS_MIGRATE_QEMU_EXEC |
QEMU_CAPS_DRIVE_CACHE_V2 |
QEMU_CAPS_DRIVE_FORMAT |
QEMU_CAPS_DRIVE_SERIAL |
QEMU_CAPS_DRIVE_READONLY |
QEMU_CAPS_VGA |
QEMU_CAPS_0_10 |
QEMU_CAPS_ENABLE_KVM |
QEMU_CAPS_SDL |
QEMU_CAPS_XEN_DOMID |
QEMU_CAPS_MIGRATE_QEMU_UNIX |
QEMU_CAPS_CHARDEV |
QEMU_CAPS_BALLOON |
QEMU_CAPS_DEVICE |
QEMU_CAPS_SMP_TOPOLOGY |
QEMU_CAPS_RTC |
QEMU_CAPS_NO_HPET |
QEMU_CAPS_BOOT_MENU |
QEMU_CAPS_NAME_PROCESS |
QEMU_CAPS_SMBIOS_TYPE |
QEMU_CAPS_VGA_NONE |
QEMU_CAPS_MIGRATE_QEMU_FD |
QEMU_CAPS_DRIVE_AIO, QEMU_CAPS_DRIVE_AIO,
12001, 0, 0); QEMU_CAPS_DEVICE_SPICEVMC);
DO_TEST("qemu-kvm-0.12.1.2-rhel60", DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
QEMU_CAPS_VNC_COLON | QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT | QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT | QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_NAME | QEMU_CAPS_NAME,
QEMU_CAPS_UUID | QEMU_CAPS_UUID,
QEMU_CAPS_VNET_HDR | QEMU_CAPS_VNET_HDR,
QEMU_CAPS_MIGRATE_QEMU_TCP | QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_MIGRATE_QEMU_EXEC | QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_DRIVE_CACHE_V2 | QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_KVM | QEMU_CAPS_KVM,
QEMU_CAPS_DRIVE_FORMAT | QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_SERIAL | QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_DRIVE_READONLY | QEMU_CAPS_DRIVE_READONLY,
QEMU_CAPS_VGA | QEMU_CAPS_VGA,
QEMU_CAPS_0_10 | QEMU_CAPS_0_10,
QEMU_CAPS_PCIDEVICE | QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_MEM_PATH | QEMU_CAPS_MEM_PATH,
QEMU_CAPS_MIGRATE_QEMU_UNIX | QEMU_CAPS_SDL,
QEMU_CAPS_CHARDEV | QEMU_CAPS_MIGRATE_QEMU_UNIX,
QEMU_CAPS_ENABLE_KVM | QEMU_CAPS_CHARDEV,
QEMU_CAPS_BALLOON | QEMU_CAPS_BALLOON,
QEMU_CAPS_DEVICE | QEMU_CAPS_DEVICE,
QEMU_CAPS_SMP_TOPOLOGY | QEMU_CAPS_SMP_TOPOLOGY,
QEMU_CAPS_RTC | QEMU_CAPS_RTC,
QEMU_CAPS_VNET_HOST | QEMU_CAPS_VNET_HOST,
QEMU_CAPS_NO_KVM_PIT | QEMU_CAPS_NO_HPET,
QEMU_CAPS_TDF | QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_PCI_CONFIGFD | QEMU_CAPS_TDF,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_BOOT_MENU,
QEMU_CAPS_BOOT_MENU | QEMU_CAPS_NESTING,
QEMU_CAPS_NESTING | QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_NAME_PROCESS | QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_SMBIOS_TYPE | QEMU_CAPS_VGA_NONE,
QEMU_CAPS_VGA_QXL | QEMU_CAPS_MIGRATE_QEMU_FD,
QEMU_CAPS_SPICE | QEMU_CAPS_DRIVE_AIO);
QEMU_CAPS_VGA_NONE | DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0,
QEMU_CAPS_MIGRATE_QEMU_FD | QEMU_CAPS_VNC_COLON,
QEMU_CAPS_DRIVE_AIO | QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DEVICE_SPICEVMC, QEMU_CAPS_DRIVE,
12001, 1, 0); QEMU_CAPS_DRIVE_BOOT,
DO_TEST("qemu-kvm-0.12.3", QEMU_CAPS_NAME,
QEMU_CAPS_VNC_COLON | QEMU_CAPS_UUID,
QEMU_CAPS_NO_REBOOT | QEMU_CAPS_VNET_HDR,
QEMU_CAPS_DRIVE | QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_DRIVE_BOOT | QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_NAME | QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_UUID | QEMU_CAPS_KVM,
QEMU_CAPS_VNET_HDR | QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_MIGRATE_QEMU_TCP | QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_MIGRATE_QEMU_EXEC | QEMU_CAPS_XEN_DOMID,
QEMU_CAPS_DRIVE_CACHE_V2 | QEMU_CAPS_DRIVE_READONLY,
QEMU_CAPS_KVM | QEMU_CAPS_VGA,
QEMU_CAPS_DRIVE_FORMAT | QEMU_CAPS_0_10,
QEMU_CAPS_DRIVE_SERIAL | QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_DRIVE_READONLY | QEMU_CAPS_MEM_PATH,
QEMU_CAPS_VGA | QEMU_CAPS_SDL,
QEMU_CAPS_0_10 | QEMU_CAPS_MIGRATE_QEMU_UNIX,
QEMU_CAPS_PCIDEVICE | QEMU_CAPS_CHARDEV,
QEMU_CAPS_MEM_PATH | QEMU_CAPS_ENABLE_KVM,
QEMU_CAPS_SDL | QEMU_CAPS_MONITOR_JSON,
QEMU_CAPS_MIGRATE_QEMU_UNIX | QEMU_CAPS_BALLOON,
QEMU_CAPS_CHARDEV | QEMU_CAPS_DEVICE,
QEMU_CAPS_BALLOON | QEMU_CAPS_SMP_TOPOLOGY,
QEMU_CAPS_DEVICE | QEMU_CAPS_NETDEV,
QEMU_CAPS_SMP_TOPOLOGY | QEMU_CAPS_RTC,
QEMU_CAPS_RTC | QEMU_CAPS_VNET_HOST,
QEMU_CAPS_VNET_HOST | QEMU_CAPS_NO_HPET,
QEMU_CAPS_NO_HPET | QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_NO_KVM_PIT | QEMU_CAPS_TDF,
QEMU_CAPS_TDF | QEMU_CAPS_PCI_CONFIGFD,
QEMU_CAPS_BOOT_MENU | QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_NESTING | QEMU_CAPS_BOOT_MENU,
QEMU_CAPS_NAME_PROCESS | QEMU_CAPS_FSDEV,
QEMU_CAPS_SMBIOS_TYPE | QEMU_CAPS_NESTING,
QEMU_CAPS_VGA_NONE | QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_MIGRATE_QEMU_FD | QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_SPICE,
QEMU_CAPS_VGA_NONE,
QEMU_CAPS_MIGRATE_QEMU_FD,
QEMU_CAPS_DRIVE_AIO, QEMU_CAPS_DRIVE_AIO,
12003, 1, 0); QEMU_CAPS_DEVICE_SPICEVMC);
DO_TEST("qemu-kvm-0.13.0", DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
QEMU_CAPS_VNC_COLON | QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT | QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE,
QEMU_CAPS_DRIVE_BOOT | QEMU_CAPS_NAME,
QEMU_CAPS_NAME | QEMU_CAPS_UUID,
QEMU_CAPS_UUID | QEMU_CAPS_VNET_HDR,
QEMU_CAPS_VNET_HDR | QEMU_CAPS_MIGRATE_QEMU_TCP,
QEMU_CAPS_MIGRATE_QEMU_TCP | QEMU_CAPS_MIGRATE_QEMU_EXEC,
QEMU_CAPS_MIGRATE_QEMU_EXEC | QEMU_CAPS_DRIVE_CACHE_V2,
QEMU_CAPS_DRIVE_CACHE_V2 | QEMU_CAPS_KVM,
QEMU_CAPS_KVM | QEMU_CAPS_DRIVE_FORMAT,
QEMU_CAPS_DRIVE_FORMAT | QEMU_CAPS_DRIVE_SERIAL,
QEMU_CAPS_DRIVE_SERIAL | QEMU_CAPS_DRIVE_READONLY,
QEMU_CAPS_XEN_DOMID | QEMU_CAPS_VGA,
QEMU_CAPS_DRIVE_READONLY | QEMU_CAPS_0_10,
QEMU_CAPS_VGA | QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_0_10 | QEMU_CAPS_MEM_PATH,
QEMU_CAPS_PCIDEVICE | QEMU_CAPS_MIGRATE_QEMU_UNIX,
QEMU_CAPS_MEM_PATH | QEMU_CAPS_CHARDEV,
QEMU_CAPS_SDL | QEMU_CAPS_ENABLE_KVM,
QEMU_CAPS_MIGRATE_QEMU_UNIX | QEMU_CAPS_BALLOON,
QEMU_CAPS_CHARDEV | QEMU_CAPS_DEVICE,
QEMU_CAPS_ENABLE_KVM | QEMU_CAPS_SMP_TOPOLOGY,
QEMU_CAPS_MONITOR_JSON | QEMU_CAPS_RTC,
QEMU_CAPS_BALLOON | QEMU_CAPS_VNET_HOST,
QEMU_CAPS_DEVICE | QEMU_CAPS_NO_KVM_PIT,
QEMU_CAPS_SMP_TOPOLOGY | QEMU_CAPS_TDF,
QEMU_CAPS_NETDEV | QEMU_CAPS_PCI_CONFIGFD,
QEMU_CAPS_RTC | QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_VNET_HOST | QEMU_CAPS_BOOT_MENU,
QEMU_CAPS_NO_HPET | QEMU_CAPS_NESTING,
QEMU_CAPS_NO_KVM_PIT | QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_TDF | QEMU_CAPS_SMBIOS_TYPE,
QEMU_CAPS_PCI_CONFIGFD | QEMU_CAPS_VGA_QXL,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_SPICE,
QEMU_CAPS_BOOT_MENU | QEMU_CAPS_VGA_NONE,
QEMU_CAPS_FSDEV | QEMU_CAPS_MIGRATE_QEMU_FD,
QEMU_CAPS_NESTING | QEMU_CAPS_HDA_DUPLEX,
QEMU_CAPS_NAME_PROCESS | QEMU_CAPS_DRIVE_AIO,
QEMU_CAPS_SMBIOS_TYPE | QEMU_CAPS_CCID_PASSTHRU,
QEMU_CAPS_SPICE | QEMU_CAPS_CHARDEV_SPICEVMC,
QEMU_CAPS_VGA_NONE | QEMU_CAPS_VIRTIO_TX_ALG);
QEMU_CAPS_MIGRATE_QEMU_FD |
QEMU_CAPS_DRIVE_AIO |
QEMU_CAPS_DEVICE_SPICEVMC,
13000, 1, 0);
DO_TEST("qemu-kvm-0.12.1.2-rhel61",
QEMU_CAPS_VNC_COLON |
QEMU_CAPS_NO_REBOOT |
QEMU_CAPS_DRIVE |
QEMU_CAPS_NAME |
QEMU_CAPS_UUID |
QEMU_CAPS_VNET_HDR |
QEMU_CAPS_MIGRATE_QEMU_TCP |
QEMU_CAPS_MIGRATE_QEMU_EXEC |
QEMU_CAPS_DRIVE_CACHE_V2 |
QEMU_CAPS_KVM |
QEMU_CAPS_DRIVE_FORMAT |
QEMU_CAPS_DRIVE_SERIAL |
QEMU_CAPS_DRIVE_READONLY |
QEMU_CAPS_VGA |
QEMU_CAPS_0_10 |
QEMU_CAPS_PCIDEVICE |
QEMU_CAPS_MEM_PATH |
QEMU_CAPS_MIGRATE_QEMU_UNIX |
QEMU_CAPS_CHARDEV |
QEMU_CAPS_ENABLE_KVM |
QEMU_CAPS_BALLOON |
QEMU_CAPS_DEVICE |
QEMU_CAPS_SMP_TOPOLOGY |
QEMU_CAPS_RTC |
QEMU_CAPS_VNET_HOST |
QEMU_CAPS_NO_KVM_PIT |
QEMU_CAPS_TDF |
QEMU_CAPS_PCI_CONFIGFD |
QEMU_CAPS_NODEFCONFIG |
QEMU_CAPS_BOOT_MENU |
QEMU_CAPS_NESTING |
QEMU_CAPS_NAME_PROCESS |
QEMU_CAPS_SMBIOS_TYPE |
QEMU_CAPS_VGA_QXL |
QEMU_CAPS_SPICE |
QEMU_CAPS_VGA_NONE |
QEMU_CAPS_MIGRATE_QEMU_FD |
QEMU_CAPS_HDA_DUPLEX |
QEMU_CAPS_DRIVE_AIO |
QEMU_CAPS_CCID_PASSTHRU |
QEMU_CAPS_CHARDEV_SPICEVMC |
QEMU_CAPS_VIRTIO_TX_ALG,
12001, 1, 0);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
} }

View File

@ -29,7 +29,7 @@ static struct qemud_driver driver;
static int testCompareXMLToArgvFiles(const char *xml, static int testCompareXMLToArgvFiles(const char *xml,
const char *cmdline, const char *cmdline,
unsigned long long extraFlags, virBitmapPtr extraFlags,
const char *migrateFrom, const char *migrateFrom,
int migrateFd, int migrateFd,
bool expectError) { bool expectError) {
@ -38,7 +38,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
int len; int len;
char *actualargv = NULL; char *actualargv = NULL;
int ret = -1; int ret = -1;
unsigned long long flags;
virDomainDefPtr vmdef = NULL; virDomainDefPtr vmdef = NULL;
virDomainChrSourceDef monitor_chr; virDomainChrSourceDef monitor_chr;
virConnectPtr conn; virConnectPtr conn;
@ -89,14 +88,15 @@ static int testCompareXMLToArgvFiles(const char *xml,
monitor_chr.data.nix.path = (char *)"/tmp/test-monitor"; monitor_chr.data.nix.path = (char *)"/tmp/test-monitor";
monitor_chr.data.nix.listen = true; monitor_chr.data.nix.listen = true;
flags = QEMU_CAPS_VNC_COLON | qemuCapsSetList(extraFlags,
QEMU_CAPS_NO_REBOOT | QEMU_CAPS_VNC_COLON,
extraFlags; QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_LAST);
if (qemudCanonicalizeMachine(&driver, vmdef) < 0) if (qemudCanonicalizeMachine(&driver, vmdef) < 0)
goto fail; goto fail;
if (qemuCapsGet(flags, QEMU_CAPS_DEVICE)) { if (qemuCapsGet(extraFlags, QEMU_CAPS_DEVICE)) {
qemuDomainPCIAddressSetPtr pciaddrs; qemuDomainPCIAddressSetPtr pciaddrs;
if (!(pciaddrs = qemuDomainPCIAddressSetCreate(vmdef))) if (!(pciaddrs = qemuDomainPCIAddressSetCreate(vmdef)))
goto fail; goto fail;
@ -117,11 +117,11 @@ static int testCompareXMLToArgvFiles(const char *xml,
*/ */
if (STREQLEN(vmdef->os.arch, "x86_64", 6) || if (STREQLEN(vmdef->os.arch, "x86_64", 6) ||
STREQLEN(vmdef->os.arch, "i686", 4)) { STREQLEN(vmdef->os.arch, "i686", 4)) {
qemuCapsSet(&flags, QEMU_CAPS_PCI_MULTIBUS); qemuCapsSet(extraFlags, QEMU_CAPS_PCI_MULTIBUS);
} }
if (!(cmd = qemuBuildCommandLine(conn, &driver, if (!(cmd = qemuBuildCommandLine(conn, &driver,
vmdef, &monitor_chr, false, flags, vmdef, &monitor_chr, false, extraFlags,
migrateFrom, migrateFd, NULL, migrateFrom, migrateFd, NULL,
VIR_VM_OP_CREATE))) VIR_VM_OP_CREATE)))
goto fail; goto fail;
@ -169,7 +169,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
struct testInfo { struct testInfo {
const char *name; const char *name;
unsigned long long extraFlags; virBitmapPtr extraFlags;
const char *migrateFrom; const char *migrateFrom;
int migrateFd; int migrateFd;
bool expectError; bool expectError;
@ -230,18 +230,24 @@ mymain(int argc, char **argv)
if (cpuMapOverride(map) < 0) if (cpuMapOverride(map) < 0)
return EXIT_FAILURE; return EXIT_FAILURE;
# define DO_TEST_FULL(name, extraFlags, migrateFrom, migrateFd, expectError) \ # define DO_TEST_FULL(name, migrateFrom, migrateFd, expectError, ...) \
do { \ do { \
const struct testInfo info = { \ struct testInfo info = { \
name, extraFlags, migrateFrom, migrateFd, expectError \ name, NULL, migrateFrom, migrateFd, expectError \
}; \ }; \
if (!(info.extraFlags = qemuCapsNew())) \
return EXIT_FAILURE; \
qemuCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST); \
if (virtTestRun("QEMU XML-2-ARGV " name, \ if (virtTestRun("QEMU XML-2-ARGV " name, \
1, testCompareXMLToArgvHelper, &info) < 0) \ 1, testCompareXMLToArgvHelper, &info) < 0) \
ret = -1; \ ret = -1; \
qemuCapsFree(info.extraFlags); \
} while (0) } while (0)
# define DO_TEST(name, extraFlags, expectError) \ # define DO_TEST(name, expectError, ...) \
DO_TEST_FULL(name, extraFlags, NULL, -1, expectError) DO_TEST_FULL(name, NULL, -1, expectError, __VA_ARGS__)
# define NONE QEMU_CAPS_LAST
/* Unset or set all envvars here that are copied in qemudBuildCommandLine /* Unset or set all envvars here that are copied in qemudBuildCommandLine
* using ADD_ENV_COPY, otherwise these tests may fail due to unexpected * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected
@ -256,241 +262,235 @@ mymain(int argc, char **argv)
unsetenv("QEMU_AUDIO_DRV"); unsetenv("QEMU_AUDIO_DRV");
unsetenv("SDL_AUDIODRIVER"); unsetenv("SDL_AUDIODRIVER");
DO_TEST("minimal", QEMU_CAPS_NAME, false); DO_TEST("minimal", false, QEMU_CAPS_NAME);
DO_TEST("machine-aliases1", 0, false); DO_TEST("machine-aliases1", false, NONE);
DO_TEST("machine-aliases2", 0, true); DO_TEST("machine-aliases2", true, NONE);
DO_TEST("boot-cdrom", 0, false); DO_TEST("boot-cdrom", false, NONE);
DO_TEST("boot-network", 0, false); DO_TEST("boot-network", false, NONE);
DO_TEST("boot-floppy", 0, false); DO_TEST("boot-floppy", false, NONE);
DO_TEST("boot-multi", QEMU_CAPS_BOOT_MENU, false); DO_TEST("boot-multi", false, QEMU_CAPS_BOOT_MENU);
DO_TEST("boot-menu-disable", QEMU_CAPS_BOOT_MENU, false); DO_TEST("boot-menu-disable", false, QEMU_CAPS_BOOT_MENU);
DO_TEST("boot-order", QEMU_CAPS_BOOTINDEX | DO_TEST("boot-order", false,
QEMU_CAPS_DRIVE | QEMU_CAPS_DEVICE, false); QEMU_CAPS_BOOTINDEX, QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE);
DO_TEST("bootloader", QEMU_CAPS_DOMID, true); DO_TEST("bootloader", true, QEMU_CAPS_DOMID);
DO_TEST("clock-utc", 0, false); DO_TEST("clock-utc", false, NONE);
DO_TEST("clock-localtime", 0, false); DO_TEST("clock-localtime", false, NONE);
/* /*
* Can't be enabled since the absolute timestamp changes every time * Can't be enabled since the absolute timestamp changes every time
DO_TEST("clock-variable", QEMU_CAPS_RTC, false); DO_TEST("clock-variable", false, QEMU_CAPS_RTC);
*/ */
DO_TEST("clock-france", QEMU_CAPS_RTC, false); DO_TEST("clock-france", false, QEMU_CAPS_RTC);
DO_TEST("hugepages", QEMU_CAPS_MEM_PATH, false); DO_TEST("hugepages", false, QEMU_CAPS_MEM_PATH);
DO_TEST("disk-cdrom", 0, false); DO_TEST("disk-cdrom", false, NONE);
DO_TEST("disk-cdrom-empty", QEMU_CAPS_DRIVE, false); DO_TEST("disk-cdrom-empty", false, QEMU_CAPS_DRIVE);
DO_TEST("disk-floppy", 0, false); DO_TEST("disk-floppy", false, NONE);
DO_TEST("disk-many", 0, false); DO_TEST("disk-many", false, NONE);
DO_TEST("disk-virtio", QEMU_CAPS_DRIVE | DO_TEST("disk-virtio", false, QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT);
QEMU_CAPS_DRIVE_BOOT, false); DO_TEST("disk-xenvbd", false, QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT);
DO_TEST("disk-xenvbd", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-boot-disk", false,
QEMU_CAPS_DRIVE_BOOT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT);
DO_TEST("disk-drive-boot-disk", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-boot-cdrom", false,
QEMU_CAPS_DRIVE_BOOT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT);
DO_TEST("disk-drive-boot-cdrom", QEMU_CAPS_DRIVE | DO_TEST("floppy-drive-fat", false,
QEMU_CAPS_DRIVE_BOOT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT, QEMU_CAPS_DRIVE_FORMAT);
DO_TEST("floppy-drive-fat", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-fat", false,
QEMU_CAPS_DRIVE_BOOT | QEMU_CAPS_DRIVE_FORMAT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT, QEMU_CAPS_DRIVE_FORMAT);
DO_TEST("disk-drive-fat", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-readonly-disk", false,
QEMU_CAPS_DRIVE_BOOT | QEMU_CAPS_DRIVE_FORMAT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_READONLY,
DO_TEST("disk-drive-readonly-disk", QEMU_CAPS_DRIVE | QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
QEMU_CAPS_DRIVE_READONLY | QEMU_CAPS_DEVICE | DO_TEST("disk-drive-readonly-no-device", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_READONLY, QEMU_CAPS_NODEFCONFIG);
DO_TEST("disk-drive-readonly-no-device", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-fmt-qcow", false,
QEMU_CAPS_DRIVE_READONLY | QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT, QEMU_CAPS_DRIVE_FORMAT);
DO_TEST("disk-drive-fmt-qcow", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-shared", false,
QEMU_CAPS_DRIVE_BOOT | QEMU_CAPS_DRIVE_FORMAT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_FORMAT, QEMU_CAPS_DRIVE_SERIAL);
DO_TEST("disk-drive-shared", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-cache-v1-wt", false,
QEMU_CAPS_DRIVE_FORMAT | QEMU_CAPS_DRIVE_SERIAL, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_FORMAT);
DO_TEST("disk-drive-cache-v1-wt", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-cache-v1-wb", false,
QEMU_CAPS_DRIVE_FORMAT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_FORMAT);
DO_TEST("disk-drive-cache-v1-wb", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-cache-v1-none", false,
QEMU_CAPS_DRIVE_FORMAT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_FORMAT);
DO_TEST("disk-drive-cache-v1-none", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-error-policy-stop", false,
QEMU_CAPS_DRIVE_FORMAT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_DRIVE_FORMAT);
DO_TEST("disk-drive-error-policy-stop", QEMU_CAPS_DRIVE | DO_TEST("disk-drive-cache-v2-wt", false,
QEMU_CAPS_MONITOR_JSON | QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);
QEMU_CAPS_DRIVE_FORMAT, false); DO_TEST("disk-drive-cache-v2-wb", false,
DO_TEST("disk-drive-cache-v2-wt", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);
QEMU_CAPS_DRIVE_CACHE_V2 | QEMU_CAPS_DRIVE_FORMAT, false); DO_TEST("disk-drive-cache-v2-none", false,
DO_TEST("disk-drive-cache-v2-wb", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);
QEMU_CAPS_DRIVE_CACHE_V2 | QEMU_CAPS_DRIVE_FORMAT, false); DO_TEST("disk-drive-network-nbd", false,
DO_TEST("disk-drive-cache-v2-none", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_FORMAT);
QEMU_CAPS_DRIVE_CACHE_V2 | QEMU_CAPS_DRIVE_FORMAT, false); DO_TEST("disk-drive-network-rbd", false,
DO_TEST("disk-drive-network-nbd", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_FORMAT);
QEMU_CAPS_DRIVE_FORMAT, false); DO_TEST("disk-drive-network-sheepdog", false,
DO_TEST("disk-drive-network-rbd", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_FORMAT);
QEMU_CAPS_DRIVE_FORMAT, false); DO_TEST("disk-usb", false, NONE);
DO_TEST("disk-drive-network-sheepdog", QEMU_CAPS_DRIVE | DO_TEST("disk-usb-device", false,
QEMU_CAPS_DRIVE_FORMAT, false); QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("disk-usb", 0, false); DO_TEST("disk-scsi-device", false,
DO_TEST("disk-usb-device", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
QEMU_CAPS_DEVICE | QEMU_CAPS_NODEFCONFIG, false); DO_TEST("disk-scsi-device-auto", false,
DO_TEST("disk-scsi-device", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
QEMU_CAPS_DEVICE | QEMU_CAPS_NODEFCONFIG, false); DO_TEST("disk-aio", false,
DO_TEST("disk-scsi-device-auto", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_AIO,
QEMU_CAPS_DEVICE | QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);
DO_TEST("disk-aio", QEMU_CAPS_DRIVE | QEMU_CAPS_DRIVE_AIO | DO_TEST("graphics-vnc", false, NONE);
QEMU_CAPS_DRIVE_CACHE_V2 | QEMU_CAPS_DRIVE_FORMAT, false); DO_TEST("graphics-vnc-socket", false, NONE);
DO_TEST("graphics-vnc", 0, false);
DO_TEST("graphics-vnc-socket", 0, false);
driver.vncSASL = 1; driver.vncSASL = 1;
driver.vncSASLdir = strdup("/root/.sasl2"); driver.vncSASLdir = strdup("/root/.sasl2");
DO_TEST("graphics-vnc-sasl", QEMU_CAPS_VGA, false); DO_TEST("graphics-vnc-sasl", false, QEMU_CAPS_VGA);
driver.vncTLS = 1; driver.vncTLS = 1;
driver.vncTLSx509verify = 1; driver.vncTLSx509verify = 1;
driver.vncTLSx509certdir = strdup("/etc/pki/tls/qemu"); driver.vncTLSx509certdir = strdup("/etc/pki/tls/qemu");
DO_TEST("graphics-vnc-tls", 0, false); DO_TEST("graphics-vnc-tls", false, NONE);
driver.vncSASL = driver.vncTLSx509verify = driver.vncTLS = 0; driver.vncSASL = driver.vncTLSx509verify = driver.vncTLS = 0;
free(driver.vncSASLdir); free(driver.vncSASLdir);
free(driver.vncTLSx509certdir); free(driver.vncTLSx509certdir);
driver.vncSASLdir = driver.vncTLSx509certdir = NULL; driver.vncSASLdir = driver.vncTLSx509certdir = NULL;
DO_TEST("graphics-sdl", 0, false); DO_TEST("graphics-sdl", false, NONE);
DO_TEST("graphics-sdl-fullscreen", 0, false); DO_TEST("graphics-sdl-fullscreen", false, NONE);
DO_TEST("nographics", QEMU_CAPS_VGA, false); DO_TEST("nographics", false, QEMU_CAPS_VGA);
DO_TEST("nographics-vga", QEMU_CAPS_VGA | DO_TEST("nographics-vga", false,
QEMU_CAPS_VGA_NONE, false); QEMU_CAPS_VGA, QEMU_CAPS_VGA_NONE);
DO_TEST("graphics-spice", DO_TEST("graphics-spice", false,
QEMU_CAPS_VGA | QEMU_CAPS_VGA_QXL | QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL,
QEMU_CAPS_DEVICE | QEMU_CAPS_SPICE, false); QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE);
DO_TEST("input-usbmouse", 0, false); DO_TEST("input-usbmouse", false, NONE);
DO_TEST("input-usbtablet", 0, false); DO_TEST("input-usbtablet", false, NONE);
DO_TEST("input-xen", QEMU_CAPS_DOMID, true); DO_TEST("input-xen", true, QEMU_CAPS_DOMID);
DO_TEST("misc-acpi", 0, false); DO_TEST("misc-acpi", false, NONE);
DO_TEST("misc-no-reboot", 0, false); DO_TEST("misc-no-reboot", false, NONE);
DO_TEST("misc-uuid", QEMU_CAPS_NAME | DO_TEST("misc-uuid", false, QEMU_CAPS_NAME, QEMU_CAPS_UUID);
QEMU_CAPS_UUID, false); DO_TEST("net-user", false, NONE);
DO_TEST("net-user", 0, false); DO_TEST("net-virtio", false, NONE);
DO_TEST("net-virtio", 0, false); DO_TEST("net-virtio-device", false,
DO_TEST("net-virtio-device", QEMU_CAPS_DEVICE | QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_VIRTIO_TX_ALG);
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_VIRTIO_TX_ALG, false); DO_TEST("net-virtio-netdev", false,
DO_TEST("net-virtio-netdev", QEMU_CAPS_DEVICE | QEMU_CAPS_DEVICE, QEMU_CAPS_NETDEV, QEMU_CAPS_NODEFCONFIG);
QEMU_CAPS_NETDEV | QEMU_CAPS_NODEFCONFIG, false); DO_TEST("net-eth", false, NONE);
DO_TEST("net-eth", 0, false); DO_TEST("net-eth-ifname", false, NONE);
DO_TEST("net-eth-ifname", 0, false); DO_TEST("net-eth-names", false, QEMU_CAPS_NET_NAME);
DO_TEST("net-eth-names", QEMU_CAPS_NET_NAME, false);
DO_TEST("serial-vc", 0, false); DO_TEST("serial-vc", false, NONE);
DO_TEST("serial-pty", 0, false); DO_TEST("serial-pty", false, NONE);
DO_TEST("serial-dev", 0, false); DO_TEST("serial-dev", false, NONE);
DO_TEST("serial-file", 0, false); DO_TEST("serial-file", false, NONE);
DO_TEST("serial-unix", 0, false); DO_TEST("serial-unix", false, NONE);
DO_TEST("serial-tcp", 0, false); DO_TEST("serial-tcp", false, NONE);
DO_TEST("serial-udp", 0, false); DO_TEST("serial-udp", false, NONE);
DO_TEST("serial-tcp-telnet", 0, false); DO_TEST("serial-tcp-telnet", false, NONE);
DO_TEST("serial-many", 0, false); DO_TEST("serial-many", false, NONE);
DO_TEST("parallel-tcp", 0, false); DO_TEST("parallel-tcp", false, NONE);
DO_TEST("console-compat", 0, false); DO_TEST("console-compat", false, NONE);
DO_TEST("console-compat-auto", 0, false); DO_TEST("console-compat-auto", false, NONE);
DO_TEST("serial-vc-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-vc-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("serial-pty-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-pty-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("serial-dev-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-dev-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("serial-file-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-file-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("serial-unix-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-unix-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("serial-tcp-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-tcp-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("serial-udp-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-udp-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("serial-tcp-telnet-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-tcp-telnet-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("serial-many-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("serial-many-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("parallel-tcp-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("parallel-tcp-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("console-compat-chardev", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("console-compat-chardev", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("channel-guestfwd", QEMU_CAPS_CHARDEV|QEMU_CAPS_DEVICE | DO_TEST("channel-guestfwd", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("channel-virtio", QEMU_CAPS_DEVICE | DO_TEST("channel-virtio", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("channel-virtio-auto", QEMU_CAPS_DEVICE | DO_TEST("channel-virtio-auto", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("console-virtio", QEMU_CAPS_DEVICE | DO_TEST("console-virtio", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("channel-spicevmc", QEMU_CAPS_DEVICE | DO_TEST("channel-spicevmc", false,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_SPICE | QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_CHARDEV_SPICEVMC, false); QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC);
DO_TEST("channel-spicevmc-old", QEMU_CAPS_DEVICE | DO_TEST("channel-spicevmc-old", false,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_SPICE | QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_DEVICE_SPICEVMC, false); QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC);
DO_TEST("smartcard-host", DO_TEST("smartcard-host", false,
QEMU_CAPS_CHARDEV | QEMU_CAPS_DEVICE | QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_CCID_EMULATED, false); QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CCID_EMULATED);
DO_TEST("smartcard-host-certificates", DO_TEST("smartcard-host-certificates", false,
QEMU_CAPS_CHARDEV | QEMU_CAPS_DEVICE | QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_CCID_EMULATED, false); QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CCID_EMULATED);
DO_TEST("smartcard-passthrough-tcp", DO_TEST("smartcard-passthrough-tcp", false,
QEMU_CAPS_CHARDEV | QEMU_CAPS_DEVICE | QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_CCID_PASSTHRU, false); QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CCID_PASSTHRU);
DO_TEST("smartcard-passthrough-spicevmc", DO_TEST("smartcard-passthrough-spicevmc", false,
QEMU_CAPS_CHARDEV | QEMU_CAPS_DEVICE | QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_CCID_PASSTHRU | QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV_SPICEVMC);
QEMU_CAPS_CHARDEV_SPICEVMC, false); DO_TEST("smartcard-controller", false,
DO_TEST("smartcard-controller", QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
QEMU_CAPS_CHARDEV | QEMU_CAPS_DEVICE | QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CCID_EMULATED);
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_CCID_EMULATED, false);
DO_TEST("smbios", QEMU_CAPS_SMBIOS_TYPE, false); DO_TEST("smbios", false, QEMU_CAPS_SMBIOS_TYPE);
DO_TEST("watchdog", 0, false); DO_TEST("watchdog", false, NONE);
DO_TEST("watchdog-device", QEMU_CAPS_DEVICE | DO_TEST("watchdog-device", false, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
QEMU_CAPS_NODEFCONFIG, false); DO_TEST("watchdog-dump", false, NONE);
DO_TEST("watchdog-dump", 0, false); DO_TEST("balloon-device", false, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("balloon-device", QEMU_CAPS_DEVICE | DO_TEST("balloon-device-auto", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("balloon-device-auto", QEMU_CAPS_DEVICE | DO_TEST("sound", false, NONE);
QEMU_CAPS_NODEFCONFIG, false); DO_TEST("sound-device", false,
DO_TEST("sound", 0, false); QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_HDA_DUPLEX);
DO_TEST("sound-device", QEMU_CAPS_DEVICE | DO_TEST("fs9p", false,
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_HDA_DUPLEX, false); QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_FSDEV);
DO_TEST("fs9p", QEMU_CAPS_DEVICE |
QEMU_CAPS_NODEFCONFIG | QEMU_CAPS_FSDEV, false);
DO_TEST("hostdev-usb-address", 0, false); DO_TEST("hostdev-usb-address", false, NONE);
DO_TEST("hostdev-usb-address-device", QEMU_CAPS_DEVICE | DO_TEST("hostdev-usb-address-device", false,
QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("hostdev-pci-address", QEMU_CAPS_PCIDEVICE, false); DO_TEST("hostdev-pci-address", false, QEMU_CAPS_PCIDEVICE);
DO_TEST("hostdev-pci-address-device", QEMU_CAPS_PCIDEVICE | DO_TEST("hostdev-pci-address-device", false,
QEMU_CAPS_DEVICE | QEMU_CAPS_NODEFCONFIG, false); QEMU_CAPS_PCIDEVICE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST_FULL("restore-v1", QEMU_CAPS_MIGRATE_KVM_STDIO, "stdio", 7, DO_TEST_FULL("restore-v1", "stdio", 7, false,
false); QEMU_CAPS_MIGRATE_KVM_STDIO);
DO_TEST_FULL("restore-v2", QEMU_CAPS_MIGRATE_QEMU_EXEC, "stdio", 7, DO_TEST_FULL("restore-v2", "stdio", 7, false,
false); QEMU_CAPS_MIGRATE_QEMU_EXEC);
DO_TEST_FULL("restore-v2", QEMU_CAPS_MIGRATE_QEMU_EXEC, "exec:cat", 7, DO_TEST_FULL("restore-v2", "exec:cat", 7, false,
false); QEMU_CAPS_MIGRATE_QEMU_EXEC);
DO_TEST_FULL("restore-v2-fd", QEMU_CAPS_MIGRATE_QEMU_FD, "stdio", 7, DO_TEST_FULL("restore-v2-fd", "stdio", 7, false,
false); QEMU_CAPS_MIGRATE_QEMU_FD);
DO_TEST_FULL("restore-v2-fd", QEMU_CAPS_MIGRATE_QEMU_FD, "fd:7", 7, DO_TEST_FULL("restore-v2-fd", "fd:7", 7, false,
false); QEMU_CAPS_MIGRATE_QEMU_FD);
DO_TEST_FULL("migrate", QEMU_CAPS_MIGRATE_QEMU_TCP, DO_TEST_FULL("migrate", "tcp:10.0.0.1:5000", -1, false,
"tcp:10.0.0.1:5000", -1, false); QEMU_CAPS_MIGRATE_QEMU_TCP);
DO_TEST("qemu-ns", 0, false); DO_TEST("qemu-ns", false, NONE);
DO_TEST("smp", QEMU_CAPS_SMP_TOPOLOGY, false); DO_TEST("smp", false, QEMU_CAPS_SMP_TOPOLOGY);
DO_TEST("cpu-topology1", QEMU_CAPS_SMP_TOPOLOGY, false); DO_TEST("cpu-topology1", false, QEMU_CAPS_SMP_TOPOLOGY);
DO_TEST("cpu-topology2", QEMU_CAPS_SMP_TOPOLOGY, false); DO_TEST("cpu-topology2", false, QEMU_CAPS_SMP_TOPOLOGY);
DO_TEST("cpu-topology3", 0, false); DO_TEST("cpu-topology3", false, NONE);
DO_TEST("cpu-minimum1", 0, false); DO_TEST("cpu-minimum1", false, NONE);
DO_TEST("cpu-minimum2", 0, false); DO_TEST("cpu-minimum2", false, NONE);
DO_TEST("cpu-exact1", 0, false); DO_TEST("cpu-exact1", false, NONE);
DO_TEST("cpu-exact2", 0, false); DO_TEST("cpu-exact2", false, NONE);
DO_TEST("cpu-strict1", 0, false); DO_TEST("cpu-strict1", false, NONE);
DO_TEST("memtune", QEMU_CAPS_NAME, false); DO_TEST("memtune", false, QEMU_CAPS_NAME);
DO_TEST("blkiotune", QEMU_CAPS_NAME, false); DO_TEST("blkiotune", false, QEMU_CAPS_NAME);
free(driver.stateDir); free(driver.stateDir);
virCapabilitiesFree(driver.caps); virCapabilitiesFree(driver.caps);