]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_process: Stop retaining monitor config in qemuProcessQMP
authorChris Venteicher <cventeic@redhat.com>
Sun, 13 Jan 2019 00:50:14 +0000 (18:50 -0600)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 19 Feb 2019 17:44:10 +0000 (18:44 +0100)
The monitor config data is removed from the qemuProcessQMP struct.

The monitor config data can be initialized immediately before call to
qemuMonitorOpen and does not need to be maintained after the call
because qemuMonitorOpen copies any strings it needs.

Signed-off-by: Chris Venteicher <cventeic@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c
src/qemu/qemu_process.h

index 9341aa43a7e71cf3c8f2fc36f07e4cf17ba7ff2a..79896b6232dfa84a0361594dce4c164e75d35cb0 100644 (file)
@@ -8480,14 +8480,15 @@ static int
 qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc)
 {
     virDomainXMLOptionPtr xmlopt = NULL;
+    virDomainChrSourceDef monConfig;
     int ret = -1;
 
     VIR_DEBUG("proc=%p, emulator=%s, proc->pid=%lld",
               proc, proc->binary, (long long)proc->pid);
 
-    proc->config.type = VIR_DOMAIN_CHR_TYPE_UNIX;
-    proc->config.data.nix.path = proc->monpath;
-    proc->config.data.nix.listen = false;
+    monConfig.type = VIR_DOMAIN_CHR_TYPE_UNIX;
+    monConfig.data.nix.path = proc->monpath;
+    monConfig.data.nix.listen = false;
 
     if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL)) ||
         !(proc->vm = virDomainObjNew(xmlopt)))
@@ -8495,7 +8496,7 @@ qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc)
 
     proc->vm->pid = proc->pid;
 
-    if (!(proc->mon = qemuMonitorOpen(proc->vm, &proc->config, true, true,
+    if (!(proc->mon = qemuMonitorOpen(proc->vm, &monConfig, true, true,
                                       0, &callbacks, NULL)))
         goto cleanup;
 
index 9ab885c6c3e8f77e6075bb0747cc19d913010a0c..2422d1eb7c4e8970cc40152e30e1f4084a3852da 100644 (file)
@@ -227,7 +227,6 @@ struct _qemuProcessQMP {
     char *pidfile;
     virCommandPtr cmd;
     qemuMonitorPtr mon;
-    virDomainChrSourceDef config;
     pid_t pid;
     virDomainObjPtr vm;
     bool forceTCG;