qemu: add -incoming fd:n capability checking

* src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_MIGRATE_QEMU_FD):
New enum value.
* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Populate
flags according to qemu version.
* tests/qemuhelptest.c (mymain): Adjust test.
This commit is contained in:
Eric Blake 2010-12-22 15:13:06 -07:00
parent 40dbbd6e5f
commit abff0290b1
3 changed files with 14 additions and 5 deletions

View File

@ -943,6 +943,8 @@ qemuCapsComputeCmdFlags(const char *help,
* Handling of -incoming arg with varying features
* -incoming tcp (kvm >= 79, qemu >= 0.10.0)
* -incoming exec (kvm >= 80, qemu >= 0.10.0)
* -incoming unix (qemu >= 0.12.0)
* -incoming fd (qemu >= 0.12.0)
* -incoming stdio (all earlier kvm)
*
* NB, there was a pre-kvm-79 'tcp' support, but it
@ -952,8 +954,10 @@ qemuCapsComputeCmdFlags(const char *help,
if (version >= 10000) {
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP;
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC;
if (version >= 12000)
if (version >= 12000) {
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_UNIX;
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_FD;
}
} else if (kvm_version >= 79) {
flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP;
if (kvm_version >= 80)

View File

@ -82,6 +82,7 @@ enum qemuCapsFlags {
QEMUD_CMD_FLAG_VGA_QXL = (1LL << 45), /* The 'qxl' arg for '-vga' */
QEMUD_CMD_FLAG_SPICE = (1LL << 46), /* Is -spice avail */
QEMUD_CMD_FLAG_VGA_NONE = (1LL << 47), /* The 'none' arg for '-vga' */
QEMUD_CMD_FLAG_MIGRATE_QEMU_FD = (1LL << 48), /* -incoming fd:n */
};
virCapsPtr qemuCapsInit(virCapsPtr old_caps);

View File

@ -286,7 +286,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_BOOT_MENU |
QEMUD_CMD_FLAG_NAME_PROCESS |
QEMUD_CMD_FLAG_SMBIOS_TYPE |
QEMUD_CMD_FLAG_VGA_NONE,
QEMUD_CMD_FLAG_VGA_NONE |
QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
12001, 0, 0);
DO_TEST("qemu-kvm-0.12.1.2-rhel60",
QEMUD_CMD_FLAG_VNC_COLON |
@ -324,7 +325,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_SMBIOS_TYPE |
QEMUD_CMD_FLAG_VGA_QXL |
QEMUD_CMD_FLAG_SPICE |
QEMUD_CMD_FLAG_VGA_NONE,
QEMUD_CMD_FLAG_VGA_NONE |
QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
12001, 1, 0);
DO_TEST("qemu-kvm-0.12.3",
QEMUD_CMD_FLAG_VNC_COLON |
@ -360,7 +362,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_NESTING |
QEMUD_CMD_FLAG_NAME_PROCESS |
QEMUD_CMD_FLAG_SMBIOS_TYPE |
QEMUD_CMD_FLAG_VGA_NONE,
QEMUD_CMD_FLAG_VGA_NONE |
QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
12003, 1, 0);
DO_TEST("qemu-kvm-0.13.0",
QEMUD_CMD_FLAG_VNC_COLON |
@ -403,7 +406,8 @@ mymain(int argc, char **argv)
QEMUD_CMD_FLAG_NAME_PROCESS |
QEMUD_CMD_FLAG_SMBIOS_TYPE |
QEMUD_CMD_FLAG_SPICE |
QEMUD_CMD_FLAG_VGA_NONE,
QEMUD_CMD_FLAG_VGA_NONE |
QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
13000, 1, 0);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;