We don't want to be dealing with real FDs thus we mock
'qemuMonitorIOWriteWithFD' to do the same thing as when no FD is being
passed.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
/* Call this function while holding the monitor lock. */
-static int
+int
qemuMonitorIOWriteWithFD(qemuMonitor *mon,
const char *data,
size_t len,
void
qemuMonitorResetCommandID(qemuMonitor *mon);
+
+int
+qemuMonitorIOWriteWithFD(qemuMonitor *mon,
+ const char *data,
+ size_t len,
+ int fd)
+ G_GNUC_NO_INLINE;
#include "virmock.h"
#include <fcntl.h>
+#define LIBVIRT_QEMU_MONITOR_PRIV_H_ALLOW
+#include "qemu/qemu_monitor_priv.h"
+
static bool (*real_virFileExists)(const char *path);
static void
testQemuPrepareHostBackendChardevOne,
vm);
}
+
+
+/* we don't really want to send fake FDs across the monitor */
+int
+qemuMonitorIOWriteWithFD(qemuMonitor *mon,
+ const char *data,
+ size_t len,
+ int fd G_GNUC_UNUSED)
+{
+ return write(mon->fd, data, len); /* sc_avoid_write */
+}