Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_monitor.c | 12 ++++++++++++
src/qemu/qemu_monitor.h | 5 +++++
src/qemu/qemu_monitor_json.c | 22 ++++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 5 +++++
4 files changed, 44 insertions(+)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index c2808c75a3..6279e75c68 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2930,6 +2930,18 @@ qemuMonitorJobDismiss(qemuMonitor *mon,
}
+int
+qemuMonitorJobFinalize(qemuMonitor *mon,
+ const char *jobname)
+{
+ VIR_DEBUG("jobname=%s", jobname);
+
+ QEMU_CHECK_MONITOR(mon);
+
+ return qemuMonitorJSONJobFinalize(mon, jobname);
+}
+
+
int
qemuMonitorJobComplete(qemuMonitor *mon,
const char *jobname)
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 63269e15bc..dc35aa52c3 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1029,6 +1029,11 @@ int qemuMonitorJobDismiss(qemuMonitor *mon,
const char *jobname)
ATTRIBUTE_NONNULL(2);
+int
+qemuMonitorJobFinalize(qemuMonitor *mon,
+ const char *jobname)
+ ATTRIBUTE_NONNULL(2);
+
int qemuMonitorJobComplete(qemuMonitor *mon,
const char *jobname)
ATTRIBUTE_NONNULL(2);
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 70fba50e6c..9d514bfacc 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -4410,6 +4410,28 @@ qemuMonitorJSONJobDismiss(qemuMonitor *mon,
}
+int
+qemuMonitorJSONJobFinalize(qemuMonitor *mon,
+ const char *jobname)
+{
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
+
+ if (!(cmd = qemuMonitorJSONMakeCommand("job-finalize",
+ "s:id", jobname,
+ NULL)))
+ return -1;
+
+ if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
+ return -1;
+
+ if (qemuMonitorJSONBlockJobError(cmd, reply, jobname) < 0)
+ return -1;
+
+ return 0;
+}
+
+
int
qemuMonitorJSONJobComplete(qemuMonitor *mon,
const char *jobname)
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index a53e6423df..37f76bcc0c 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -373,6 +373,11 @@ qemuMonitorJSONJobDismiss(qemuMonitor *mon,
const char *jobname)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+int
+qemuMonitorJSONJobFinalize(qemuMonitor *mon,
+ const char *jobname)
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+
int
qemuMonitorJSONJobComplete(qemuMonitor *mon,
const char *jobname)
--
2.37.2