yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
26ba25
From 3db6ed16ab417b32bcaf9444ab9091f7f599884d Mon Sep 17 00:00:00 2001
26ba25
From: John Snow <jsnow@redhat.com>
26ba25
Date: Tue, 25 Sep 2018 22:34:27 +0100
26ba25
Subject: [PATCH 24/28] qapi/block-commit: expose new job properties
26ba25
26ba25
RH-Author: John Snow <jsnow@redhat.com>
26ba25
Message-id: <20180925223431.24791-22-jsnow@redhat.com>
26ba25
Patchwork-id: 82285
26ba25
O-Subject: [RHEL8/rhel qemu-kvm PATCH 21/25] qapi/block-commit: expose new job properties
26ba25
Bugzilla: 1632939
26ba25
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
26ba25
RH-Acked-by: Max Reitz <mreitz@redhat.com>
26ba25
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
26ba25
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
Reviewed-by: Max Reitz <mreitz@redhat.com>
26ba25
Message-id: 20180906130225.5118-13-jsnow@redhat.com
26ba25
Reviewed-by: Jeff Cody <jcody@redhat.com>
26ba25
Signed-off-by: Max Reitz <mreitz@redhat.com>
26ba25
(cherry picked from commit 96fbf5345f60a87fab8e7ea79a2406f381027db9)
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 blockdev.c           |  8 ++++++++
26ba25
 qapi/block-core.json | 16 +++++++++++++++-
26ba25
 2 files changed, 23 insertions(+), 1 deletion(-)
26ba25
26ba25
diff --git a/blockdev.c b/blockdev.c
26ba25
index 90a50d0..10b5944 100644
26ba25
--- a/blockdev.c
26ba25
+++ b/blockdev.c
26ba25
@@ -3315,6 +3315,8 @@ void qmp_block_commit(bool has_job_id, const char *job_id, const char *device,
26ba25
                       bool has_backing_file, const char *backing_file,
26ba25
                       bool has_speed, int64_t speed,
26ba25
                       bool has_filter_node_name, const char *filter_node_name,
26ba25
+                      bool has_auto_finalize, bool auto_finalize,
26ba25
+                      bool has_auto_dismiss, bool auto_dismiss,
26ba25
                       Error **errp)
26ba25
 {
26ba25
     BlockDriverState *bs;
26ba25
@@ -3334,6 +3336,12 @@ void qmp_block_commit(bool has_job_id, const char *job_id, const char *device,
26ba25
     if (!has_filter_node_name) {
26ba25
         filter_node_name = NULL;
26ba25
     }
26ba25
+    if (has_auto_finalize && !auto_finalize) {
26ba25
+        job_flags |= JOB_MANUAL_FINALIZE;
26ba25
+    }
26ba25
+    if (has_auto_dismiss && !auto_dismiss) {
26ba25
+        job_flags |= JOB_MANUAL_DISMISS;
26ba25
+    }
26ba25
 
26ba25
     /* Important Note:
26ba25
      *  libvirt relies on the DeviceNotFound error class in order to probe for
26ba25
diff --git a/qapi/block-core.json b/qapi/block-core.json
26ba25
index a6399af..c29c4b6 100644
26ba25
--- a/qapi/block-core.json
26ba25
+++ b/qapi/block-core.json
26ba25
@@ -1475,6 +1475,19 @@
26ba25
 #                    above @top. If this option is not given, a node name is
26ba25
 #                    autogenerated. (Since: 2.9)
26ba25
 #
26ba25
+# @auto-finalize: When false, this job will wait in a PENDING state after it has
26ba25
+#                 finished its work, waiting for @block-job-finalize before
26ba25
+#                 making any block graph changes.
26ba25
+#                 When true, this job will automatically
26ba25
+#                 perform its abort or commit actions.
26ba25
+#                 Defaults to true. (Since 3.1)
26ba25
+#
26ba25
+# @auto-dismiss: When false, this job will wait in a CONCLUDED state after it
26ba25
+#                has completely ceased all work, and awaits @block-job-dismiss.
26ba25
+#                When true, this job will automatically disappear from the query
26ba25
+#                list without user intervention.
26ba25
+#                Defaults to true. (Since 3.1)
26ba25
+#
26ba25
 # Returns: Nothing on success
26ba25
 #          If commit or stream is already active on this device, DeviceInUse
26ba25
 #          If @device does not exist, DeviceNotFound
26ba25
@@ -1495,7 +1508,8 @@
26ba25
 { 'command': 'block-commit',
26ba25
   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str', '*top': 'str',
26ba25
             '*backing-file': 'str', '*speed': 'int',
26ba25
-            '*filter-node-name': 'str' } }
26ba25
+            '*filter-node-name': 'str',
26ba25
+            '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
26ba25
 
26ba25
 ##
26ba25
 # @drive-backup:
26ba25
-- 
26ba25
1.8.3.1
26ba25