mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
qemu: monitor: Remove support for "legacy" block jobs
Drop all the monitor code necessary to do the downstream block jobs. Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
2350d10149
commit
771a38609d
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user