[PATCH 1/2] qemu: add -incoming fd:n capability checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* 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.
---

I feel a bit dirty relying on just a version test for whether
-incoming fd:n is supported, but it's no different than the
existing code for -incoming unix:path which was added about the
same time.  Unfortunately, 'qemu -help' doesn't list which
particular protocols it supports for -incoming.

 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 913fbf7..3d10b42 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 83afd9b..ee648f0 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 553abbc..18a71fa 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;
-- 
1.7.3.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]