Drop all the monitor code necessary to do the downstream block jobs. --- src/qemu/qemu_driver.c | 7 +++---- src/qemu/qemu_migration.c | 2 +- src/qemu/qemu_monitor.c | 24 ++++++++++-------------- src/qemu/qemu_monitor.h | 9 +++------ src/qemu/qemu_monitor_json.c | 17 +++++++---------- src/qemu/qemu_monitor_json.h | 9 +++------ 6 files changed, 27 insertions(+), 41 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c7d93dcb2..b334cf20b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16494,7 +16494,7 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver, baseSource); if (!baseSource || basePath) ret = qemuMonitorBlockStream(priv->mon, device, basePath, backingPath, - speed, true); + speed); if (qemuDomainObjExitMonitor(driver, vm) < 0) ret = -1; @@ -16578,7 +16578,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom, } qemuDomainObjEnterMonitor(driver, vm); - ret = qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), device, true); + ret = qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), device); if (qemuDomainObjExitMonitor(driver, vm) < 0) { ret = -1; goto endjob; @@ -16798,8 +16798,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, qemuDomainObjEnterMonitor(driver, vm); ret = qemuMonitorBlockJobSetSpeed(qemuDomainGetMonitor(vm), device, - speed, - true); + speed); if (qemuDomainObjExitMonitor(driver, vm) < 0) ret = -1; diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 272d525f1..492815b60 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -762,7 +762,7 @@ qemuMigrationCancelOneDriveMirror(virQEMUDriverPtr driver, if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) goto cleanup; - rv = qemuMonitorBlockJobCancel(priv->mon, diskAlias, true); + rv = qemuMonitorBlockJobCancel(priv->mon, diskAlias); if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0) goto cleanup; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 19082d8bf..69f14d028 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3475,43 +3475,39 @@ qemuMonitorBlockStream(qemuMonitorPtr mon, const char *device, const char *base, const char *backingName, - unsigned long long bandwidth, - bool modern) + unsigned long long bandwidth) { - VIR_DEBUG("device=%s, base=%s, backingName=%s, bandwidth=%lluB, modern=%d", - device, NULLSTR(base), NULLSTR(backingName), bandwidth, modern); + VIR_DEBUG("device=%s, base=%s, backingName=%s, bandwidth=%lluB", + device, NULLSTR(base), NULLSTR(backingName), bandwidth); QEMU_CHECK_MONITOR_JSON(mon); - return qemuMonitorJSONBlockStream(mon, device, base, backingName, - bandwidth, modern); + return qemuMonitorJSONBlockStream(mon, device, base, backingName, bandwidth); } int qemuMonitorBlockJobCancel(qemuMonitorPtr mon, - const char *device, - bool modern) + const char *device) { - VIR_DEBUG("device=%s, modern=%d", device, modern); + VIR_DEBUG("device=%s", device); QEMU_CHECK_MONITOR_JSON(mon); - return qemuMonitorJSONBlockJobCancel(mon, device, modern); + return qemuMonitorJSONBlockJobCancel(mon, device); } int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon, const char *device, - unsigned long long bandwidth, - bool modern) + unsigned long long bandwidth) { - VIR_DEBUG("device=%s, bandwidth=%lluB, modern=%d", device, bandwidth, modern); + VIR_DEBUG("device=%s, bandwidth=%lluB", device, bandwidth); QEMU_CHECK_MONITOR_JSON(mon); - return qemuMonitorJSONBlockJobSetSpeed(mon, device, bandwidth, modern); + return qemuMonitorJSONBlockJobSetSpeed(mon, device, bandwidth); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 9805a3390..6414d2483 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -896,19 +896,16 @@ int qemuMonitorBlockStream(qemuMonitorPtr mon, const char *device, const char *base, const char *backingName, - unsigned long long bandwidth, - bool modern) + unsigned long long bandwidth) ATTRIBUTE_NONNULL(2); int qemuMonitorBlockJobCancel(qemuMonitorPtr mon, - const char *device, - bool modern) + const char *device) ATTRIBUTE_NONNULL(2); int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon, const char *device, - unsigned long long bandwidth, - bool modern); + unsigned long long bandwidth); typedef struct _qemuMonitorBlockJobInfo qemuMonitorBlockJobInfo; typedef qemuMonitorBlockJobInfo *qemuMonitorBlockJobInfoPtr; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index df5fb7c8f..0fc5d2122 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4474,13 +4474,12 @@ qemuMonitorJSONBlockStream(qemuMonitorPtr mon, const char *device, const char *base, const char *backingName, - unsigned long long speed, - bool modern) + unsigned long long speed) { int ret = -1; virJSONValuePtr cmd = NULL; virJSONValuePtr reply = NULL; - const char *cmd_name = modern ? "block-stream" : "block_stream"; + const char *cmd_name = "block-stream"; if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name, "s:device", device, @@ -4507,13 +4506,12 @@ qemuMonitorJSONBlockStream(qemuMonitorPtr mon, int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, - const char *device, - bool modern) + const char *device) { int ret = -1; virJSONValuePtr cmd = NULL; virJSONValuePtr reply = NULL; - const char *cmd_name = modern ? "block-job-cancel" : "block_job_cancel"; + const char *cmd_name = "block-job-cancel"; if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name, "s:device", device, @@ -4538,17 +4536,16 @@ qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, const char *device, - unsigned long long speed, - bool modern) + unsigned long long speed) { int ret = -1; virJSONValuePtr cmd; virJSONValuePtr reply = NULL; - const char *cmd_name = modern ? "block-job-set-speed" : "block_job_set_speed"; + const char *cmd_name = "block-job-set-speed"; if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name, "s:device", device, - modern ? "J:speed" : "J:value", speed, + "J:speed", speed, NULL))) return -1; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 7462967b5..0cdfc5ead 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -300,19 +300,16 @@ int qemuMonitorJSONBlockStream(qemuMonitorPtr mon, const char *device, const char *base, const char *backingName, - unsigned long long speed, - bool modern) + unsigned long long speed) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, - const char *device, - bool modern) + const char *device) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, const char *device, - unsigned long long speed, - bool modern) + unsigned long long speed) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon) -- 2.14.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list