On Wed, Dec 12, 2018 at 06:08:55PM +0100, Peter Krempa wrote:
Allow using the node name to specify the base and top of the
'commit'
operation, allow specifying explicit job name and add support for
delayed dismiss of the job so that we can reap the state even if
libvirtd was not running when qemu emitted the job completion event.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_monitor.c | 21 +++++++++++++++------
src/qemu/qemu_monitor.h | 6 +++++-
src/qemu/qemu_monitor_json.c | 22 ++++++++++++++++++++--
src/qemu/qemu_monitor_json.h | 4 ++++
tests/qemumonitorjsontest.c | 2 +-
6 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index d6cad63863..fe8d8d1bf7 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3280,18 +3280,27 @@ qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr
*actions)
/* Start a block-commit block job. bandwidth is in bytes/sec. */
int
-qemuMonitorBlockCommit(qemuMonitorPtr mon, const char *device,
- const char *top, const char *base,
+qemuMonitorBlockCommit(qemuMonitorPtr mon,
+ const char *device,
+ const char *jobname,
+ bool persistjob,
+ const char *top,
+ const char *topNode,
+ const char *base,
+ const char *baseNode,
const char *backingName,
unsigned long long bandwidth)
{
- VIR_DEBUG("device=%s, top=%s, base=%s, backingName=%s, bandwidth=%llu",
- device, top, base, NULLSTR(backingName), bandwidth);
+ VIR_DEBUG("device=%s, jobname=%s, persistjob=%d, top=%s, topNode=%s, "
+ "base=%s, baseNode=%s, backingName=%s, bandwidth=%llu",
+ device, NULLSTR(jobname), persistjob, NULLSTR(top), NULLSTR(topNode),
+ NULLSTR(base), NULLSTR(baseNode), NULLSTR(backingName), bandwidth);
No checks for mixing *Node and non-*Node variables?
QEMU_CHECK_MONITOR(mon);
- return qemuMonitorJSONBlockCommit(mon, device, top, base,
- backingName, bandwidth);
+ return qemuMonitorJSONBlockCommit(mon, device, jobname, persistjob, top,
+ topNode, base, baseNode, backingName,
+ bandwidth);
}
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano