qemu: monitor: Move qemuMonitorJSONDrivePivot together with block-job APIs

Move all relevant APIs dealing with existing jobs together.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Peter Krempa 2018-08-14 13:02:43 +02:00
parent 7cead0af6a
commit e94a4053dc

View File

@ -4423,33 +4423,6 @@ qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, const char *device,
return ret;
}
int
qemuMonitorJSONDrivePivot(qemuMonitorPtr mon,
const char *device)
{
int ret = -1;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
cmd = qemuMonitorJSONMakeCommand("block-job-complete",
"s:device", device,
NULL);
if (!cmd)
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup;
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
goto cleanup;
ret = 0;
cleanup:
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
}
static char *
qemuMonitorJSONDiskNameLookupOne(virJSONValuePtr image,
@ -4903,6 +4876,34 @@ qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
}
int
qemuMonitorJSONDrivePivot(qemuMonitorPtr mon,
const char *device)
{
int ret = -1;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
cmd = qemuMonitorJSONMakeCommand("block-job-complete",
"s:device", device,
NULL);
if (!cmd)
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup;
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
goto cleanup;
ret = 0;
cleanup:
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
}
int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon,
const char *protocol,
const char *fdname,