1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

qemu: monitor: Remove unused arguments of qemuMonitorBlockCommit

The 'persistjob' is always true and 'top' and 'base' are always NULL.
Adjust the functions to drop the arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-07-20 12:15:55 +02:00
parent b04482d67c
commit 01f8c55f22
6 changed files with 8 additions and 32 deletions

View File

@ -15580,10 +15580,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
ret = qemuMonitorBlockCommit(priv->mon,
qemuDomainDiskGetTopNodename(disk),
job->name,
true,
NULL,
topSource->nodeformat,
NULL,
baseSource->nodeformat,
backingPath, speed);

View File

@ -2863,24 +2863,19 @@ int
qemuMonitorBlockCommit(qemuMonitor *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, 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);
VIR_DEBUG("device=%s, jobname=%s, topNode=%s, baseNode=%s, backingName=%s, bandwidth=%llu",
device, NULLSTR(jobname), NULLSTR(topNode),
NULLSTR(baseNode), NULLSTR(backingName), bandwidth);
QEMU_CHECK_MONITOR(mon);
return qemuMonitorJSONBlockCommit(mon, device, jobname, persistjob, top,
topNode, base, baseNode, backingName,
bandwidth);
return qemuMonitorJSONBlockCommit(mon, device, jobname, topNode, baseNode,
backingName, bandwidth);
}

View File

@ -993,10 +993,7 @@ int qemuMonitorDrivePivot(qemuMonitor *mon,
int qemuMonitorBlockCommit(qemuMonitor *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)

View File

@ -4148,31 +4148,21 @@ int
qemuMonitorJSONBlockCommit(qemuMonitor *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 speed)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
virTristateBool autofinalize = VIR_TRISTATE_BOOL_ABSENT;
virTristateBool autodismiss = VIR_TRISTATE_BOOL_ABSENT;
if (persistjob) {
autofinalize = VIR_TRISTATE_BOOL_YES;
autodismiss = VIR_TRISTATE_BOOL_NO;
}
virTristateBool autofinalize = VIR_TRISTATE_BOOL_YES;
virTristateBool autodismiss = VIR_TRISTATE_BOOL_NO;
cmd = qemuMonitorJSONMakeCommand("block-commit",
"s:device", device,
"S:job-id", jobname,
"Y:speed", speed,
"S:top", top,
"S:top-node", topNode,
"S:base", base,
"S:base-node", baseNode,
"S:backing-file", backingName,
"T:auto-finalize", autofinalize,

View File

@ -327,10 +327,7 @@ int
qemuMonitorJSONBlockCommit(qemuMonitor *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)

View File

@ -1215,7 +1215,7 @@ GEN_TEST_FUNC(qemuMonitorJSONRemoveNetdev, "net0")
GEN_TEST_FUNC(qemuMonitorJSONDelDevice, "ide0")
GEN_TEST_FUNC(qemuMonitorJSONBlockdevMirror, "jobname", true, "vdb", "targetnode", 1024, 1234, 31234, true, true)
GEN_TEST_FUNC(qemuMonitorJSONBlockStream, "vdb", "jobname", true, "/foo/bar1", "backingnode", "backingfilename", 1024)
GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "jobname", true, "/foo/bar1", "topnode", "/foo/bar2", "basenode", "backingfilename", 1024)
GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "jobname", "topnode", "basenode", "backingfilename", 1024)
GEN_TEST_FUNC(qemuMonitorJSONDrivePivot, "vdb")
GEN_TEST_FUNC(qemuMonitorJSONScreendump, "devicename", 1, "/foo/bar")
GEN_TEST_FUNC(qemuMonitorJSONOpenGraphics, "spice", "spicefd", false)