qemu: remove json argument from qemuMonitorOpen

Always assume JSON monitor was requested, since all the callers
pass true anyway.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko 2019-06-14 20:08:00 +02:00
parent 466764346d
commit 7bf679aec6
4 changed files with 5 additions and 14 deletions

View File

@ -809,7 +809,6 @@ static qemuMonitorPtr
qemuMonitorOpenInternal(virDomainObjPtr vm,
int fd,
bool hasSendFD,
bool json,
qemuMonitorCallbacksPtr cb,
void *opaque)
{
@ -840,9 +839,8 @@ qemuMonitorOpenInternal(virDomainObjPtr vm,
mon->fd = fd;
mon->hasSendFD = hasSendFD;
mon->vm = virObjectRef(vm);
mon->json = json;
if (json)
mon->waitGreeting = true;
mon->json = true;
mon->waitGreeting = true;
mon->cb = cb;
mon->callbackOpaque = opaque;
@ -893,7 +891,6 @@ qemuMonitorOpenInternal(virDomainObjPtr vm,
* qemuMonitorOpen:
* @vm: domain object
* @config: monitor configuration
* @json: enable JSON on the monitor
* @timeout: number of seconds to add to default timeout
* @cb: monitor event handles
* @opaque: opaque data for @cb
@ -909,7 +906,6 @@ qemuMonitorOpenInternal(virDomainObjPtr vm,
qemuMonitorPtr
qemuMonitorOpen(virDomainObjPtr vm,
virDomainChrSourceDefPtr config,
bool json,
bool retry,
unsigned long long timeout,
qemuMonitorCallbacksPtr cb,
@ -941,7 +937,7 @@ qemuMonitorOpen(virDomainObjPtr vm,
return NULL;
}
ret = qemuMonitorOpenInternal(vm, fd, hasSendFD, json, cb, opaque);
ret = qemuMonitorOpenInternal(vm, fd, hasSendFD, cb, opaque);
if (!ret)
VIR_FORCE_CLOSE(fd);
return ret;
@ -951,11 +947,10 @@ qemuMonitorOpen(virDomainObjPtr vm,
qemuMonitorPtr
qemuMonitorOpenFD(virDomainObjPtr vm,
int sockfd,
bool json,
qemuMonitorCallbacksPtr cb,
void *opaque)
{
return qemuMonitorOpenInternal(vm, sockfd, true, json, cb, opaque);
return qemuMonitorOpenInternal(vm, sockfd, true, cb, opaque);
}

View File

@ -339,7 +339,6 @@ char *qemuMonitorUnescapeArg(const char *in);
qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm,
virDomainChrSourceDefPtr config,
bool json,
bool retry,
unsigned long long timeout,
qemuMonitorCallbacksPtr cb,
@ -347,7 +346,6 @@ qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6);
qemuMonitorPtr qemuMonitorOpenFD(virDomainObjPtr vm,
int sockfd,
bool json,
qemuMonitorCallbacksPtr cb,
void *opaque)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);

View File

@ -1895,7 +1895,6 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
mon = qemuMonitorOpen(vm,
monConfig,
true,
retry,
timeout,
&monitorCallbacks,
@ -8467,7 +8466,7 @@ qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc)
proc->vm->pid = proc->pid;
if (!(proc->mon = qemuMonitorOpen(proc->vm, &monConfig, true, true,
if (!(proc->mon = qemuMonitorOpen(proc->vm, &monConfig, true,
0, &callbacks, NULL)))
goto cleanup;

View File

@ -1192,7 +1192,6 @@ qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
if (!(test->mon = qemuMonitorOpen(test->vm,
&src,
true,
true,
0,
&qemuMonitorTestCallbacks,
driver)))