]> xenbits.xensource.com Git - libvirt.git/commitdiff
snapshot: add qemu capability for 'transaction' command
authorEric Blake <eblake@redhat.com>
Wed, 14 Mar 2012 22:29:21 +0000 (16:29 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 23 Mar 2012 22:38:19 +0000 (16:38 -0600)
We need a capability bit to gracefully error out if some of the
additions in future patches can't be implemented by the running qemu.

* src/qemu/qemu_capabilities.h (QEMU_CAPS_TRANSACTION): New cap.
* src/qemu/qemu_capabilities.c (qemuCaps): Name it.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
it.

src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
src/qemu/qemu_monitor_json.c

index ace5011cf127c525dbadd92663ee0473cdf1c532..0e09d6d285c750805d3836a8e3ad521b2b4bdc61 100644 (file)
@@ -155,6 +155,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
               "system_wakeup",
               "scsi-disk.channel",
               "scsi-block",
+              "transaction",
     );
 
 struct qemu_feature_flags {
index 62b4270c1e6c07689023a021448d9e8edc1149e3..78cdbe08843d8964d88108655015204b8b3e6a18 100644 (file)
@@ -123,6 +123,7 @@ enum qemuCapsFlags {
     QEMU_CAPS_WAKEUP             = 86, /* system_wakeup monitor command */
     QEMU_CAPS_SCSI_DISK_CHANNEL  = 87, /* Is scsi-disk.channel available? */
     QEMU_CAPS_SCSI_BLOCK         = 88, /* -device scsi-block */
+    QEMU_CAPS_TRANSACTION        = 89, /* transaction monitor command */
 
     QEMU_CAPS_LAST,                   /* this must always be the last item */
 };
index 0fe02da2c377306e46d79b5112a4e82164b09b34..741872dbccaddf2e8b667a1d30b37982cf348be5 100644 (file)
@@ -929,6 +929,9 @@ qemuMonitorJSONCheckCommands(qemuMonitorPtr mon,
 
         if (STREQ(name, "system_wakeup"))
             qemuCapsSet(qemuCaps, QEMU_CAPS_WAKEUP);
+
+        if (STREQ(name, "transaction"))
+            qemuCapsSet(qemuCaps, QEMU_CAPS_TRANSACTION);
     }
 
     ret = 0;