/* @mon is supposed to be locked by callee */
- if (qemuMonitorSetCapabilities(mon) < 0) {
- VIR_DEBUG("Failed to set monitor capabilities %s",
- virGetLastErrorMessage());
- goto cleanup;
- }
-
if (qemuMonitorGetVersion(mon,
&major, &minor, µ,
&package) < 0) {
{
int ret = -1;
- if (qemuMonitorSetCapabilities(mon) < 0) {
- VIR_DEBUG("Failed to set monitor capabilities %s",
- virGetLastErrorMessage());
- goto cleanup;
- }
-
if (virQEMUCapsProbeQMPCPUDefinitions(qemuCaps, mon, true) < 0)
goto cleanup;
}
+int
+qemuProcessQMPInitMonitor(qemuMonitorPtr mon)
+{
+ if (qemuMonitorSetCapabilities(mon) < 0) {
+ VIR_DEBUG("Failed to set monitor capabilities %s",
+ virGetLastErrorMessage());
+ return -1;
+ }
+
+ return 0;
+}
+
+
static int
qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc)
{
virObjectLock(proc->mon);
+ if (qemuProcessQMPInitMonitor(proc->mon) < 0)
+ goto cleanup;
+
ret = 0;
cleanup:
const char *devAlias,
void *opaque);
+int qemuProcessQMPInitMonitor(qemuMonitorPtr mon);
+
#endif /* LIBVIRT_QEMU_PROCESSPRIV_H */
#include "qemu/qemu_capspriv.h"
#define LIBVIRT_QEMU_MONITOR_PRIV_H_ALLOW
#include "qemu/qemu_monitor_priv.h"
+#define LIBVIRT_QEMU_PROCESSPRIV_H_ALLOW
+#include "qemu/qemu_processpriv.h"
#define VIR_FROM_THIS VIR_FROM_NONE
if (!(mon = qemuMonitorTestNewFromFileFull(repliesFile, &data->driver, NULL)))
goto cleanup;
+ if (qemuProcessQMPInitMonitor(qemuMonitorTestGetMonitor(mon)) < 0)
+ goto cleanup;
+
if (!(capsActual = virQEMUCapsNew()) ||
virQEMUCapsInitQMPMonitor(capsActual,
qemuMonitorTestGetMonitor(mon)) < 0)
if (virQEMUCapsGet(capsActual, QEMU_CAPS_KVM)) {
qemuMonitorResetCommandID(qemuMonitorTestGetMonitor(mon));
+
+ if (qemuProcessQMPInitMonitor(qemuMonitorTestGetMonitor(mon)) < 0)
+ goto cleanup;
+
if (virQEMUCapsInitQMPMonitorTCG(capsActual,
qemuMonitorTestGetMonitor(mon)) < 0)
goto cleanup;