[libvirt] [PATCH] qemu_process: Initialize domain definition for QMP query

Michal Privoznik mprivozn at redhat.com
Thu Oct 10 07:56:27 UTC 2019


When constructing QMP capabilities we allocate a dummy domain
object to pass to qemuMonitorOpen(). However, after 75dd595861
the function also expects domain definition to be allocated for
the domain object. The referenced commit already fixed
qemumonitortestutils.c but forgot to fix the other caller:
qemuProcessQMPConnectMonitor().

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---

Pushed under trivial rule.

 src/qemu/qemu_process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ca2a5cab5b..c14c09da11 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8654,7 +8654,8 @@ qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc)
     monConfig.data.nix.listen = false;
 
     if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL)) ||
-        !(proc->vm = virDomainObjNew(xmlopt)))
+        !(proc->vm = virDomainObjNew(xmlopt)) ||
+        !(proc->vm->def = virDomainDefNew()))
         goto cleanup;
 
     proc->vm->pid = proc->pid;
-- 
2.21.0




More information about the libvir-list mailing list