[PATCH 5/9] qemu: block: Replace snapshot transaction action generator

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

 



Use the new generator residing in the monitor code rather than directly
using qemuMonitorJSONTransactionAdd.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_block.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 4b5dd30e17..eacb48aa78 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -22,7 +22,6 @@
 #include "qemu_command.h"
 #include "qemu_domain.h"
 #include "qemu_alias.h"
-#include "qemu_monitor_json.h"

 #include "viralloc.h"
 #include "virstring.h"
@@ -1880,15 +1879,7 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions,
     if (qemuGetDriveSourceString(newsrc, NULL, &source) < 0)
         return -1;

-    if (qemuMonitorJSONTransactionAdd(actions, "blockdev-snapshot-sync",
-                                      "s:device", device,
-                                      "s:snapshot-file", source,
-                                      "s:format", format,
-                                      "S:mode", reuse ? "existing" : NULL,
-                                      NULL) < 0)
-        return -1;
-
-    return 0;
+    return qemuMonitorTransactionSnapshotLegacy(actions, device, source, format, reuse);
 }


@@ -1897,13 +1888,9 @@ qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions,
                              virDomainDiskDefPtr disk,
                              virStorageSourcePtr newsrc)
 {
-    if (qemuMonitorJSONTransactionAdd(actions, "blockdev-snapshot",
-                                      "s:node", disk->src->nodeformat,
-                                      "s:overlay", newsrc->nodeformat,
-                                      NULL) < 0)
-        return -1;
-
-    return 0;
+    return qemuMonitorTransactionSnapshotBlockdev(actions,
+                                                  disk->src->nodeformat,
+                                                  newsrc->nodeformat);
 }


-- 
2.21.0

--
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]

  Powered by Linux