[RFC PATCH 27/41] qemu: monitor: Add support for 'block-dirty-bitmap-populate' transaction member

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

 



Add monitor code for driving the block-dirty-bitmap-populate blockjob.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_monitor.c      | 11 +++++++++++
 src/qemu/qemu_monitor.h      |  7 +++++++
 src/qemu/qemu_monitor_json.c | 18 ++++++++++++++++++
 src/qemu/qemu_monitor_json.h |  6 ++++++
 tests/qemumonitorjsontest.c  |  3 ++-
 5 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 3ec22b939f..623730154d 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4617,3 +4617,14 @@ qemuMonitorTransactionBackup(virJSONValuePtr actions,
     return qemuMonitorJSONTransactionBackup(actions, device, jobname, target,
                                             bitmap, syncmode);
 }
+
+
+int
+qemuMonitorTransactionBitmapPopulate(virJSONValuePtr actions,
+                                     const char *nodename,
+                                     const char *bitmapname,
+                                     const char *jobname)
+{
+    return qemuMonitorJSONTransactionBitmapPopulate(actions, nodename,
+                                                    bitmapname, jobname);
+}
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 50a337715d..ccc946108a 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1431,3 +1431,10 @@ qemuMonitorTransactionBackup(virJSONValuePtr actions,
                              const char *target,
                              const char *bitmap,
                              qemuMonitorTransactionBackupSyncMode syncmode);
+
+
+int
+qemuMonitorTransactionBitmapPopulate(virJSONValuePtr actions,
+                                     const char *nodename,
+                                     const char *bitmapname,
+                                     const char *jobname);
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 3070c1e6b3..2ed3358252 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -9261,6 +9261,24 @@ qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources,
 }


+int
+qemuMonitorJSONTransactionBitmapPopulate(virJSONValuePtr actions,
+                                         const char *nodename,
+                                         const char *bitmapname,
+                                         const char *jobname)
+{
+    return qemuMonitorJSONTransactionAdd(actions,
+                                         "block-dirty-bitmap-populate",
+                                         "s:node", nodename,
+                                         "s:name", bitmapname,
+                                         "s:job-id", jobname,
+                                         "s:pattern", "allocation-top",
+                                         "T:auto-finalize", VIR_TRISTATE_BOOL_YES,
+                                         "T:auto-dismiss", VIR_TRISTATE_BOOL_NO,
+                                         NULL);
+}
+
+
 int
 qemuMonitorJSONTransactionSnapshotLegacy(virJSONValuePtr actions,
                                          const char *device,
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 83c5e25ca5..7ae4857672 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -667,6 +667,12 @@ qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources,
                                                      const char *sourcenode,
                                                      const char *sourcebitmap);

+int
+qemuMonitorJSONTransactionBitmapPopulate(virJSONValuePtr actions,
+                                         const char *nodename,
+                                         const char *bitmapname,
+                                         const char *jobname);
+
 int
 qemuMonitorJSONTransactionSnapshotLegacy(virJSONValuePtr actions,
                                          const char *device,
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 6d5a1d5fe2..befd41fd25 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2992,7 +2992,8 @@ testQemuMonitorJSONTransaction(const void *opaque)
         qemuMonitorTransactionBackup(actions, "dev9", "job9", "target9", "bitmap9",
                                      QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_INCREMENTAL) < 0 ||
         qemuMonitorTransactionBackup(actions, "devA", "jobA", "targetA", "bitmapA",
-                                     QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_FULL) < 0)
+                                     QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_FULL) < 0 ||
+        qemuMonitorJSONTransactionBitmapPopulate(actions, "nodeB", "bitmapB", "jobB") < 0)
         return -1;

     if (qemuMonitorTestAddItem(test, "transaction", "{\"return\":{}}") < 0)
-- 
2.26.2




[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