2009-06-11 14:17:42 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef WITH_QEMU
|
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include <stdio.h>
|
|
|
|
# include <stdlib.h>
|
2009-06-11 14:17:42 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "testutils.h"
|
2010-12-17 16:41:51 +00:00
|
|
|
# include "qemu/qemu_capabilities.h"
|
2011-01-13 16:09:15 +00:00
|
|
|
# include "memory.h"
|
2009-06-11 14:17:42 +00:00
|
|
|
|
|
|
|
struct testInfo {
|
|
|
|
const char *name;
|
2011-02-08 14:22:39 +00:00
|
|
|
virBitmapPtr flags;
|
2010-02-09 13:06:56 +00:00
|
|
|
unsigned int version;
|
|
|
|
unsigned int is_kvm;
|
|
|
|
unsigned int kvm_version;
|
2009-06-11 14:17:42 +00:00
|
|
|
};
|
|
|
|
|
2011-02-08 14:22:39 +00:00
|
|
|
static void printMismatchedFlags(virBitmapPtr got,
|
|
|
|
virBitmapPtr expect)
|
2009-12-21 20:36:32 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2011-02-08 14:22:39 +00:00
|
|
|
for (i = 0 ; i < QEMU_CAPS_LAST ; i++) {
|
|
|
|
bool gotFlag = qemuCapsGet(got, i);
|
|
|
|
bool expectFlag = qemuCapsGet(expect, i);
|
2009-12-21 20:36:32 +00:00
|
|
|
if (gotFlag && !expectFlag)
|
|
|
|
fprintf(stderr, "Extra flag %i\n", i);
|
|
|
|
if (!gotFlag && expectFlag)
|
|
|
|
fprintf(stderr, "Missing flag %i\n", i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-11 14:17:42 +00:00
|
|
|
static int testHelpStrParsing(const void *data)
|
|
|
|
{
|
|
|
|
const struct testInfo *info = data;
|
2011-01-13 16:09:15 +00:00
|
|
|
char *path = NULL;
|
2011-04-24 22:25:10 +00:00
|
|
|
char *help = NULL;
|
2010-02-09 13:06:56 +00:00
|
|
|
unsigned int version, is_kvm, kvm_version;
|
2011-02-08 14:22:39 +00:00
|
|
|
virBitmapPtr flags = NULL;
|
2011-01-13 16:09:15 +00:00
|
|
|
int ret = -1;
|
2011-02-08 14:22:39 +00:00
|
|
|
char *got = NULL;
|
|
|
|
char *expected = NULL;
|
2009-06-11 14:17:42 +00:00
|
|
|
|
2011-01-13 16:09:15 +00:00
|
|
|
if (virAsprintf(&path, "%s/qemuhelpdata/%s", abs_srcdir, info->name) < 0)
|
|
|
|
return -1;
|
2009-06-11 14:17:42 +00:00
|
|
|
|
2011-04-24 22:25:10 +00:00
|
|
|
if (virtTestLoadFile(path, &help) < 0)
|
2011-01-13 16:09:15 +00:00
|
|
|
goto cleanup;
|
2009-06-11 14:17:42 +00:00
|
|
|
|
2011-02-08 14:22:39 +00:00
|
|
|
if (!(flags = qemuCapsNew()))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
if (qemuCapsParseHelpStr("QEMU", help, flags,
|
2010-12-17 16:41:51 +00:00
|
|
|
&version, &is_kvm, &kvm_version) == -1)
|
2011-01-13 16:09:15 +00:00
|
|
|
goto cleanup;
|
|
|
|
|
2011-02-08 14:08:12 +00:00
|
|
|
if (qemuCapsGet(info->flags, QEMU_CAPS_DEVICE)) {
|
2011-01-13 16:09:15 +00:00
|
|
|
VIR_FREE(path);
|
2011-04-24 22:25:10 +00:00
|
|
|
VIR_FREE(help);
|
2011-01-13 16:09:15 +00:00
|
|
|
if (virAsprintf(&path, "%s/qemuhelpdata/%s-device", abs_srcdir,
|
|
|
|
info->name) < 0)
|
|
|
|
goto cleanup;
|
|
|
|
|
2011-04-24 22:25:10 +00:00
|
|
|
if (virtTestLoadFile(path, &help) < 0)
|
2011-01-13 16:09:15 +00:00
|
|
|
goto cleanup;
|
|
|
|
|
2011-02-08 14:22:39 +00:00
|
|
|
if (qemuCapsParseDeviceStr(help, flags) < 0)
|
2011-01-13 16:09:15 +00:00
|
|
|
goto cleanup;
|
|
|
|
}
|
2009-06-11 14:17:42 +00:00
|
|
|
|
2011-02-08 14:22:39 +00:00
|
|
|
got = virBitmapString(flags);
|
|
|
|
expected = virBitmapString(info->flags);
|
|
|
|
if (!got || !expected)
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
if (STRNEQ(got, expected)) {
|
2011-01-13 16:09:15 +00:00
|
|
|
fprintf(stderr,
|
2011-02-08 14:22:39 +00:00
|
|
|
"Computed flags do not match: got %s, expected %s\n",
|
|
|
|
got, expected);
|
2009-12-21 20:36:32 +00:00
|
|
|
|
|
|
|
if (getenv("VIR_TEST_DEBUG"))
|
|
|
|
printMismatchedFlags(flags, info->flags);
|
|
|
|
|
2011-01-13 16:09:15 +00:00
|
|
|
goto cleanup;
|
2009-06-11 14:17:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (version != info->version) {
|
|
|
|
fprintf(stderr, "Parsed versions do not match: got %u, expected %u\n",
|
|
|
|
version, info->version);
|
2011-01-13 16:09:15 +00:00
|
|
|
goto cleanup;
|
2009-06-11 14:17:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (is_kvm != info->is_kvm) {
|
2011-01-13 16:09:15 +00:00
|
|
|
fprintf(stderr,
|
|
|
|
"Parsed is_kvm flag does not match: got %u, expected %u\n",
|
2009-06-11 14:17:42 +00:00
|
|
|
is_kvm, info->is_kvm);
|
2011-01-13 16:09:15 +00:00
|
|
|
goto cleanup;
|
2009-06-11 14:17:42 +00:00
|
|
|
}
|
|
|
|
|
2009-12-21 20:36:32 +00:00
|
|
|
if (kvm_version != info->kvm_version) {
|
2011-01-13 16:09:15 +00:00
|
|
|
fprintf(stderr,
|
|
|
|
"Parsed KVM versions do not match: got %u, expected %u\n",
|
2009-12-21 20:36:32 +00:00
|
|
|
kvm_version, info->kvm_version);
|
2011-01-13 16:09:15 +00:00
|
|
|
goto cleanup;
|
2009-06-11 14:17:42 +00:00
|
|
|
}
|
|
|
|
|
2011-01-13 16:09:15 +00:00
|
|
|
ret = 0;
|
|
|
|
cleanup:
|
|
|
|
VIR_FREE(path);
|
2011-04-24 22:25:10 +00:00
|
|
|
VIR_FREE(help);
|
2011-02-08 14:22:39 +00:00
|
|
|
qemuCapsFree(flags);
|
|
|
|
VIR_FREE(got);
|
|
|
|
VIR_FREE(expected);
|
2011-01-13 16:09:15 +00:00
|
|
|
return ret;
|
2009-06-11 14:17:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-04-29 16:21:20 +00:00
|
|
|
mymain(void)
|
2009-06-11 14:17:42 +00:00
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
|
2011-02-08 14:22:39 +00:00
|
|
|
# define DO_TEST(name, version, is_kvm, kvm_version, ...) \
|
|
|
|
do { \
|
|
|
|
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, \
|
|
|
|
1, testHelpStrParsing, &info) < 0) \
|
|
|
|
ret = -1; \
|
|
|
|
qemuCapsFree(info.flags); \
|
2009-06-11 14:17:42 +00:00
|
|
|
} while (0)
|
|
|
|
|
2011-02-08 14:22:39 +00:00
|
|
|
DO_TEST("qemu-0.9.1", 9001, 0, 0,
|
|
|
|
QEMU_CAPS_KQEMU,
|
|
|
|
QEMU_CAPS_VNC_COLON,
|
|
|
|
QEMU_CAPS_NO_REBOOT,
|
|
|
|
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,
|
2011-02-07 14:54:08 +00:00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FIGFD,
|
|
|
|
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,
|
2011-02-07 14:54:08 +00:00
|
|
|
QEMU_CAPS_DRIVE_AIO,
|
2011-02-08 14:22:39 +00:00
|
|
|
QEMU_CAPS_CCID_PASSTHRU,
|
|
|
|
QEMU_CAPS_CHARDEV_SPICEVMC,
|
qemu: Support vram for video of qxl type
For qemu names the primary vga as "qxl-vga":
1) if vram is specified for 2nd qxl device:
-vga qxl -global qxl-vga.vram_size=$SIZE \
-device qxl,id=video1,vram_size=$SIZE,...
2) if vram is not specified for 2nd qxl device, (use the default
set by global):
-vga qxl -global qxl-vga.vram_size=$SIZE \
-device qxl,id=video1,...
For qemu names all qxl devices as "qxl":
1) if vram is specified for 2nd qxl device:
-vga qxl -global qxl.vram_size=$SIZE \
-device qxl,id=video1,vram_size=$SIZE ...
2) if vram is not specified for 2nd qxl device:
-vga qxl -global qxl-vga.vram_size=$SIZE \
-device qxl,id=video1,...
"-global" is the only way to define vram_size for the primary qxl
device, regardless of how qemu names it, (It's not good a good
way, as original idea of "-global" is to set a global default for
a driver property, but to specify vram for first qxl device, we
have to use it).
For other qxl devices, as they are represented by "-device", could
specify it directly and seperately for each, and it overrides the
default set by "-global" if specified.
v1 - v2:
* modify "virDomainVideoDefaultRAM" so that it returns 16M as the
default vram_size for qxl device.
* vram_size * 1024 (qemu accepts bytes for vram_size).
* apply default vram_size for qxl device for which vram_size is
not specified.
* modify "graphics-spice" tests (more sensiable vram_size)
* Add an argument of virDomainDefPtr type for qemuBuildVideoDevStr,
to use virDomainVideoDefaultRAM in qemuBuildVideoDevStr).
v2 - v3:
* Modify default video memory size for qxl device from 16M to 24M
* Update codes to be consistent with changes on qemu_capabilities.*
2011-03-06 14:00:27 +00:00
|
|
|
QEMU_CAPS_DEVICE_QXL_VGA,
|
2011-06-20 08:26:47 +00:00
|
|
|
QEMU_CAPS_VIRTIO_TX_ALG,
|
2011-09-02 12:56:50 +00:00
|
|
|
QEMU_CAPS_VIRTIO_IOEVENTFD,
|
|
|
|
QEMU_CAPS_PIIX3_USB_UHCI,
|
2011-09-02 14:20:40 +00:00
|
|
|
QEMU_CAPS_PIIX4_USB_UHCI,
|
2011-09-21 08:25:29 +00:00
|
|
|
QEMU_CAPS_USB_HUB,
|
|
|
|
QEMU_CAPS_NO_SHUTDOWN);
|
2009-06-11 14:17:42 +00:00
|
|
|
|
|
|
|
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
VIRT_TEST_MAIN(mymain)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2011-07-08 23:24:44 +00:00
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
return EXIT_AM_SKIP;
|
|
|
|
}
|
2009-06-11 14:17:42 +00:00
|
|
|
|
|
|
|
#endif /* WITH_QEMU */
|