mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +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);
|
baseSource);
|
||||||
if (!baseSource || basePath)
|
if (!baseSource || basePath)
|
||||||
ret = qemuMonitorBlockStream(priv->mon, device, basePath, backingPath,
|
ret = qemuMonitorBlockStream(priv->mon, device, basePath, backingPath,
|
||||||
speed, true);
|
speed);
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
@ -16578,7 +16578,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
ret = qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), device, true);
|
ret = qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), device);
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0) {
|
if (qemuDomainObjExitMonitor(driver, vm) < 0) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto endjob;
|
goto endjob;
|
||||||
@ -16798,8 +16798,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
|
|||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
ret = qemuMonitorBlockJobSetSpeed(qemuDomainGetMonitor(vm),
|
ret = qemuMonitorBlockJobSetSpeed(qemuDomainGetMonitor(vm),
|
||||||
device,
|
device,
|
||||||
speed,
|
speed);
|
||||||
true);
|
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ qemuMigrationCancelOneDriveMirror(virQEMUDriverPtr driver,
|
|||||||
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
rv = qemuMonitorBlockJobCancel(priv->mon, diskAlias, true);
|
rv = qemuMonitorBlockJobCancel(priv->mon, diskAlias);
|
||||||
|
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -3475,43 +3475,39 @@ qemuMonitorBlockStream(qemuMonitorPtr mon,
|
|||||||
const char *device,
|
const char *device,
|
||||||
const char *base,
|
const char *base,
|
||||||
const char *backingName,
|
const char *backingName,
|
||||||
unsigned long long bandwidth,
|
unsigned long long bandwidth)
|
||||||
bool modern)
|
|
||||||
{
|
{
|
||||||
VIR_DEBUG("device=%s, base=%s, backingName=%s, bandwidth=%lluB, modern=%d",
|
VIR_DEBUG("device=%s, base=%s, backingName=%s, bandwidth=%lluB",
|
||||||
device, NULLSTR(base), NULLSTR(backingName), bandwidth, modern);
|
device, NULLSTR(base), NULLSTR(backingName), bandwidth);
|
||||||
|
|
||||||
QEMU_CHECK_MONITOR_JSON(mon);
|
QEMU_CHECK_MONITOR_JSON(mon);
|
||||||
|
|
||||||
return qemuMonitorJSONBlockStream(mon, device, base, backingName,
|
return qemuMonitorJSONBlockStream(mon, device, base, backingName, bandwidth);
|
||||||
bandwidth, modern);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
qemuMonitorBlockJobCancel(qemuMonitorPtr mon,
|
qemuMonitorBlockJobCancel(qemuMonitorPtr mon,
|
||||||
const char *device,
|
const char *device)
|
||||||
bool modern)
|
|
||||||
{
|
{
|
||||||
VIR_DEBUG("device=%s, modern=%d", device, modern);
|
VIR_DEBUG("device=%s", device);
|
||||||
|
|
||||||
QEMU_CHECK_MONITOR_JSON(mon);
|
QEMU_CHECK_MONITOR_JSON(mon);
|
||||||
|
|
||||||
return qemuMonitorJSONBlockJobCancel(mon, device, modern);
|
return qemuMonitorJSONBlockJobCancel(mon, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon,
|
qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon,
|
||||||
const char *device,
|
const char *device,
|
||||||
unsigned long long bandwidth,
|
unsigned long long bandwidth)
|
||||||
bool modern)
|
|
||||||
{
|
{
|
||||||
VIR_DEBUG("device=%s, bandwidth=%lluB, modern=%d", device, bandwidth, modern);
|
VIR_DEBUG("device=%s, bandwidth=%lluB", device, bandwidth);
|
||||||
|
|
||||||
QEMU_CHECK_MONITOR_JSON(mon);
|
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 *device,
|
||||||
const char *base,
|
const char *base,
|
||||||
const char *backingName,
|
const char *backingName,
|
||||||
unsigned long long bandwidth,
|
unsigned long long bandwidth)
|
||||||
bool modern)
|
|
||||||
ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int qemuMonitorBlockJobCancel(qemuMonitorPtr mon,
|
int qemuMonitorBlockJobCancel(qemuMonitorPtr mon,
|
||||||
const char *device,
|
const char *device)
|
||||||
bool modern)
|
|
||||||
ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon,
|
int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon,
|
||||||
const char *device,
|
const char *device,
|
||||||
unsigned long long bandwidth,
|
unsigned long long bandwidth);
|
||||||
bool modern);
|
|
||||||
|
|
||||||
typedef struct _qemuMonitorBlockJobInfo qemuMonitorBlockJobInfo;
|
typedef struct _qemuMonitorBlockJobInfo qemuMonitorBlockJobInfo;
|
||||||
typedef qemuMonitorBlockJobInfo *qemuMonitorBlockJobInfoPtr;
|
typedef qemuMonitorBlockJobInfo *qemuMonitorBlockJobInfoPtr;
|
||||||
|
@ -4474,13 +4474,12 @@ qemuMonitorJSONBlockStream(qemuMonitorPtr mon,
|
|||||||
const char *device,
|
const char *device,
|
||||||
const char *base,
|
const char *base,
|
||||||
const char *backingName,
|
const char *backingName,
|
||||||
unsigned long long speed,
|
unsigned long long speed)
|
||||||
bool modern)
|
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virJSONValuePtr cmd = NULL;
|
virJSONValuePtr cmd = NULL;
|
||||||
virJSONValuePtr reply = NULL;
|
virJSONValuePtr reply = NULL;
|
||||||
const char *cmd_name = modern ? "block-stream" : "block_stream";
|
const char *cmd_name = "block-stream";
|
||||||
|
|
||||||
if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name,
|
if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name,
|
||||||
"s:device", device,
|
"s:device", device,
|
||||||
@ -4507,13 +4506,12 @@ qemuMonitorJSONBlockStream(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
int
|
int
|
||||||
qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
|
qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
|
||||||
const char *device,
|
const char *device)
|
||||||
bool modern)
|
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virJSONValuePtr cmd = NULL;
|
virJSONValuePtr cmd = NULL;
|
||||||
virJSONValuePtr reply = 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,
|
if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name,
|
||||||
"s:device", device,
|
"s:device", device,
|
||||||
@ -4538,17 +4536,16 @@ qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
|
|||||||
int
|
int
|
||||||
qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
|
qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
|
||||||
const char *device,
|
const char *device,
|
||||||
unsigned long long speed,
|
unsigned long long speed)
|
||||||
bool modern)
|
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virJSONValuePtr cmd;
|
virJSONValuePtr cmd;
|
||||||
virJSONValuePtr reply = NULL;
|
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,
|
if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name,
|
||||||
"s:device", device,
|
"s:device", device,
|
||||||
modern ? "J:speed" : "J:value", speed,
|
"J:speed", speed,
|
||||||
NULL)))
|
NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -300,19 +300,16 @@ int qemuMonitorJSONBlockStream(qemuMonitorPtr mon,
|
|||||||
const char *device,
|
const char *device,
|
||||||
const char *base,
|
const char *base,
|
||||||
const char *backingName,
|
const char *backingName,
|
||||||
unsigned long long speed,
|
unsigned long long speed)
|
||||||
bool modern)
|
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
|
int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
|
||||||
const char *device,
|
const char *device)
|
||||||
bool modern)
|
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
|
int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
|
||||||
const char *device,
|
const char *device,
|
||||||
unsigned long long speed,
|
unsigned long long speed)
|
||||||
bool modern)
|
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon)
|
virHashTablePtr qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon)
|
||||||
|
Loading…
Reference in New Issue
Block a user