Makes possible to start a single QEMU instance and use that one instance
for multiple independent QMP commands without starting and stopping QEMU
for each QMP command type.

This allows functions outside qemu_capabilities
(ex.  qemuConnectBaselineHypervisorCPU in qemu_driver)
requiring multiple different QMP messages to be sent to QEMU to issue
those requests over a single QMP Command Channel without Starting and
Stopping QEMU for each independent QMP Command usage.

Now in Global Scope:
struct virQEMUCapsInitQMPCommand
virQEMUCapsInitQMPCommandFree
---
 src/qemu/qemu_capabilities.c | 21 +--------------------
 src/qemu/qemu_capabilities.h | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f2202b652d..2bbbfc83f3 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4235,25 +4235,6 @@ virQEMUCapsInitQMPMonitorTCG(virQEMUCapsPtr qemuCaps 
ATTRIBUTE_UNUSED,
 }
 
 
-typedef struct _virQEMUCapsInitQMPCommand virQEMUCapsInitQMPCommand;
-typedef virQEMUCapsInitQMPCommand *virQEMUCapsInitQMPCommandPtr;
-struct _virQEMUCapsInitQMPCommand {
-    char *binary;
-    uid_t runUid;
-    gid_t runGid;
-    char **qmperr;
-    char *qmperr_internal;
-    char *monarg;
-    char *monpath;
-    char *pidfile;
-    virCommandPtr cmd;
-    qemuMonitorPtr mon;
-    virDomainChrSourceDef config;
-    pid_t pid;
-    virDomainObjPtr vm;
-};
-
-
 static void
 virQEMUCapsInitQMPCommandAbort(virQEMUCapsInitQMPCommandPtr cmd)
 {
@@ -4288,7 +4269,7 @@ 
virQEMUCapsInitQMPCommandAbort(virQEMUCapsInitQMPCommandPtr cmd)
 }
 
 
-static void
+void
 virQEMUCapsInitQMPCommandFree(virQEMUCapsInitQMPCommandPtr cmd)
 {
     if (!cmd)
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index af263c9780..c9618bb754 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -488,6 +488,27 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
syntax-check */
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
 
+typedef struct _virQEMUCapsInitQMPCommand virQEMUCapsInitQMPCommand;
+typedef virQEMUCapsInitQMPCommand *virQEMUCapsInitQMPCommandPtr;
+
+struct _virQEMUCapsInitQMPCommand {
+    char *binary;
+    uid_t runUid;
+    gid_t runGid;
+    char **qmperr;
+    char *qmperr_internal;
+    char *monarg;
+    char *monpath;
+    char *pidfile;
+    virCommandPtr cmd;
+    qemuMonitorPtr mon;
+    virDomainChrSourceDef config;
+    pid_t pid;
+    virDomainObjPtr vm;
+};
+
+void virQEMUCapsInitQMPCommandFree(virQEMUCapsInitQMPCommandPtr cmd);
+
 typedef struct _virQEMUCaps virQEMUCaps;
 typedef virQEMUCaps *virQEMUCapsPtr;
 
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to