yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-qapi-block-commit-expose-new-job-properties.patch

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