]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Make 'struct _qemuMonitorMessage' private
authorPeter Krempa <pkrempa@redhat.com>
Mon, 14 Feb 2022 14:57:21 +0000 (15:57 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 15 Feb 2022 08:32:23 +0000 (09:32 +0100)
Move the declaration of the struct into 'qemu_monitor_priv.h' as other
code has no business in peeking into the monitor messages.

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

index 12005ac624be3194766fade1627752d2d63715dd..1d21183d82abff7984d22995e4b3d911cddffde6 100644 (file)
 #include "virenum.h"
 
 typedef struct _qemuMonitor qemuMonitor;
-
 typedef struct _qemuMonitorMessage qemuMonitorMessage;
-struct _qemuMonitorMessage {
-    int txFD;
-
-    const char *txBuffer;
-    int txOffset;
-    int txLength;
-
-    /* Used by the JSON monitor to hold reply / error */
-    void *rxObject;
-
-    /* True if rxObject is ready, or a fatal error occurred on the monitor channel */
-    bool finished;
-};
 
 typedef enum {
     QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE = 0,
index 5bc1b2342cb94aaeb67cbb4c7ffbb976ffe8aaf3..1de932f638b628a2466b6cf9b7d9bd420108faf5 100644 (file)
@@ -44,6 +44,9 @@
 # include "libvirt_qemu_probes.h"
 #endif
 
+#define LIBVIRT_QEMU_MONITOR_PRIV_H_ALLOW
+#include "qemu_monitor_priv.h"
+
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
 VIR_LOG_INIT("qemu.qemu_monitor_json");
index 31bb3526b93f2ab58f18d69c12de4ce75e042e55..6115f830def7c392f853e492fc58034f90f7b9d6 100644 (file)
 
 #include "qemu_monitor.h"
 
+
+struct _qemuMonitorMessage {
+    int txFD;
+
+    const char *txBuffer;
+    int txOffset;
+    int txLength;
+
+    /* Used by the JSON monitor to hold reply / error */
+    void *rxObject;
+
+    /* True if rxObject is ready, or a fatal error occurred on the monitor channel */
+    bool finished;
+};
+
+
 void
 qemuMonitorResetCommandID(qemuMonitor *mon);
index 915036d1780a2b5bff47f0570140dbec6293b0e9..2717ed5d84de968bb71e748214fe227f7c0bfc89 100644 (file)
@@ -25,6 +25,9 @@
 #include "qemu/qemu_monitor.h"
 #include "qemu/qemu_monitor_json.h"
 
+#define LIBVIRT_QEMU_MONITOR_PRIV_H_ALLOW
+#include "qemu/qemu_monitor_priv.h"
+
 #define REAL_SYM(realFunc) \
     do { \
         if (!realFunc && !(realFunc = dlsym(RTLD_NEXT, __FUNCTION__))) { \