From abff0290b1f840d43b955a069005cb657780ab24 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 22 Dec 2010 15:13:06 -0700 Subject: [PATCH] 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. --- src/qemu/qemu_capabilities.c | 6 +++++- src/qemu/qemu_capabilities.h | 1 + tests/qemuhelptest.c | 12 ++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 913fbf7694..3d10b422bc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -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) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 83afd9b293..ee648f0cf3 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -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); diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 553abbc9ab..18a71fa9e3 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -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;