]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Move qemuMonitorJSONDrivePivot together with block-job APIs
authorPeter Krempa <pkrempa@redhat.com>
Tue, 14 Aug 2018 11:02:43 +0000 (13:02 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 24 Aug 2018 11:52:44 +0000 (13:52 +0200)
Move all relevant APIs dealing with existing jobs together.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_monitor_json.c

index 12ab05a88201a7b57b21505e71a34430494442b8..2af48817029b2d8dec7e3be9b439b5423bff3666 100644 (file)
@@ -4423,33 +4423,6 @@ qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, const char *device,
     return ret;
 }
 
-int
-qemuMonitorJSONDrivePivot(qemuMonitorPtr mon,
-                          const char *device)
-{
-    int ret = -1;
-    virJSONValuePtr cmd;
-    virJSONValuePtr reply = NULL;
-
-    cmd = qemuMonitorJSONMakeCommand("block-job-complete",
-                                     "s:device", device,
-                                     NULL);
-    if (!cmd)
-        return -1;
-
-    if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
-        goto cleanup;
-
-    if (qemuMonitorJSONCheckError(cmd, reply) < 0)
-        goto cleanup;
-
-    ret = 0;
- cleanup:
-    virJSONValueFree(cmd);
-    virJSONValueFree(reply);
-    return ret;
-}
-
 
 static char *
 qemuMonitorJSONDiskNameLookupOne(virJSONValuePtr image,
@@ -4903,6 +4876,34 @@ qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
 }
 
 
+int
+qemuMonitorJSONDrivePivot(qemuMonitorPtr mon,
+                          const char *device)
+{
+    int ret = -1;
+    virJSONValuePtr cmd;
+    virJSONValuePtr reply = NULL;
+
+    cmd = qemuMonitorJSONMakeCommand("block-job-complete",
+                                     "s:device", device,
+                                     NULL);
+    if (!cmd)
+        return -1;
+
+    if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
+        goto cleanup;
+
+    if (qemuMonitorJSONCheckError(cmd, reply) < 0)
+        goto cleanup;
+
+    ret = 0;
+ cleanup:
+    virJSONValueFree(cmd);
+    virJSONValueFree(reply);
+    return ret;
+}
+
+
 int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
                                 const char *protocol,
                                 const char *fdname,