qemu: Make 'struct _qemuMonitorMessage' private

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>
This commit is contained in:
Peter Krempa 2022-02-14 15:57:21 +01:00
parent c5eb99a9d9
commit f9ae469a6e
4 changed files with 22 additions and 14 deletions

View File

@ -34,21 +34,7 @@
#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,

View 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");

View File

@ -24,5 +24,21 @@
#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);

View 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__))) { \