]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: monitor: Move declaration of struct _qemuMonitor to qemu_monitor_priv.h
authorPeter Krempa <pkrempa@redhat.com>
Mon, 14 Feb 2022 15:07:41 +0000 (16:07 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 15 Feb 2022 08:32:23 +0000 (09:32 +0100)
In order to mock the SCM_RIGHTS sendmsg to simulate sending
filedescriptors to fake qemu in tests we need access to some fields of
'struct _qemuMonitor'. Move its declaration to the private header file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_priv.h

index 3de04eb1ccd82ca42648ad14da9a82287707d882..327d6d978a9154f9734a721a8c8cc61c0b033961 100644 (file)
@@ -65,56 +65,6 @@ VIR_LOG_INIT("qemu.qemu_monitor");
  */
 #define QEMU_MONITOR_MAX_RESPONSE (10 * 1024 * 1024)
 
-struct _qemuMonitor {
-    virObjectLockable parent;
-
-    virCond notify;
-
-    int fd;
-
-    GMainContext *context;
-    GSocket *socket;
-    GSource *watch;
-
-    virDomainObj *vm;
-    char *domainName;
-
-    qemuMonitorCallbacks *cb;
-    void *callbackOpaque;
-
-    /* If there's a command being processed this will be
-     * non-NULL */
-    qemuMonitorMessage *msg;
-
-    /* Buffer incoming data ready for Text/QMP monitor
-     * code to process & find message boundaries */
-    size_t bufferOffset;
-    size_t bufferLength;
-    char *buffer;
-
-    /* If anything went wrong, this will be fed back
-     * the next monitor msg */
-    virError lastError;
-
-    /* Set to true when EOF is detected on the monitor */
-    bool goteof;
-
-    int nextSerial;
-
-    bool waitGreeting;
-
-    /* If found, path to the virtio memballoon driver */
-    char *balloonpath;
-    bool ballooninit;
-
-    /* Log file context of the qemu process to dig for usable info */
-    qemuMonitorReportDomainLogError logFunc;
-    void *logOpaque;
-    virFreeCallback logDestroy;
-
-    /* true if qemu no longer wants 'props' sub-object of object-add */
-    bool objectAddNoWrap;
-};
 
 /**
  * QEMU_CHECK_MONITOR_FULL:
index 6115f830def7c392f853e492fc58034f90f7b9d6..606aa79fbd4caab2a332262a6c23c226851971d8 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "qemu_monitor.h"
 
+#include <gio/gio.h>
+
 
 struct _qemuMonitorMessage {
     int txFD;
@@ -40,5 +42,57 @@ struct _qemuMonitorMessage {
 };
 
 
+struct _qemuMonitor {
+    virObjectLockable parent;
+
+    virCond notify;
+
+    int fd;
+
+    GMainContext *context;
+    GSocket *socket;
+    GSource *watch;
+
+    virDomainObj *vm;
+    char *domainName;
+
+    qemuMonitorCallbacks *cb;
+    void *callbackOpaque;
+
+    /* If there's a command being processed this will be
+     * non-NULL */
+    qemuMonitorMessage *msg;
+
+    /* Buffer incoming data ready for Text/QMP monitor
+     * code to process & find message boundaries */
+    size_t bufferOffset;
+    size_t bufferLength;
+    char *buffer;
+
+    /* If anything went wrong, this will be fed back
+     * the next monitor msg */
+    virError lastError;
+
+    /* Set to true when EOF is detected on the monitor */
+    bool goteof;
+
+    int nextSerial;
+
+    bool waitGreeting;
+
+    /* If found, path to the virtio memballoon driver */
+    char *balloonpath;
+    bool ballooninit;
+
+    /* Log file context of the qemu process to dig for usable info */
+    qemuMonitorReportDomainLogError logFunc;
+    void *logOpaque;
+    virFreeCallback logDestroy;
+
+    /* true if qemu no longer wants 'props' sub-object of object-add */
+    bool objectAddNoWrap;
+};
+
+
 void
 qemuMonitorResetCommandID(qemuMonitor *mon);