* two features. The benefits of JSON mode now outweigh
* the downside.
*/
+#if HAVE_YAJL
if (version >= 13000)
qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON);
+#endif
if (version >= 13000)
qemuCapsSet(flags, QEMU_CAPS_PCI_MULTIFUNCTION);
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
-#if HAVE_YAJL
qemuDomainObjPrivatePtr priv;
-#endif
virCheckFlags(0, -1);
goto cleanup;
}
-#if HAVE_YAJL
priv = vm->privateData;
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON)) {
if (qemuDomainObjEndJob(driver, vm) == 0)
vm = NULL;
} else {
-#endif
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Reboot is not supported without the JSON monitor"));
-#if HAVE_YAJL
}
-#endif
cleanup:
if (vm)
if (qemuProcessPrepareMonitorChr(driver, priv->monConfig, vm->def->name) < 0)
goto cleanup;
-#if HAVE_YAJL
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON))
priv->monJSON = 1;
else
-#endif
priv->monJSON = 0;
priv->monError = false;
&version, &is_kvm, &kvm_version) == -1)
goto cleanup;
+# ifndef HAVE_YAJL
+ if (qemuCapsGet(info->flags, QEMU_CAPS_MONITOR_JSON))
+ qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON);
+# endif
+
if (qemuCapsGet(info->flags, QEMU_CAPS_DEVICE)) {
VIR_FREE(path);
VIR_FREE(help);
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
-pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+pc -m 214 -smp 1 -nographic \
+-monitor control,unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,bus=0,unit=0,\
format=qcow2,cache=off,werror=enospc -drive \
file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,bus=1,unit=0,format=raw -net \
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
-pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+pc -m 214 -smp 1 -nographic \
+-monitor control,unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,bus=0,unit=0,\
format=qcow2,cache=off,werror=stop,rerror=stop -drive \
file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,bus=1,unit=0,format=raw -net \
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
-pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+pc -m 214 -smp 1 -nographic \
+-monitor control,unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,bus=0,unit=0,\
format=qcow2,cache=off,werror=report,rerror=ignore -drive \
file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,bus=1,unit=0,format=raw -net \
virBitmapPtr extraFlags;
const char *migrateFrom;
int migrateFd;
- bool json;
bool expectError;
};
result = testCompareXMLToArgvFiles(xml, args, info->extraFlags,
info->migrateFrom, info->migrateFd,
- info->json, info->expectError);
+ qemuCapsGet(info->extraFlags,
+ QEMU_CAPS_MONITOR_JSON),
+ info->expectError);
cleanup:
free(xml);
{
int ret = 0;
char *map = NULL;
- bool json = false;
abs_top_srcdir = getenv("abs_top_srcdir");
if (!abs_top_srcdir)
# define DO_TEST_FULL(name, migrateFrom, migrateFd, expectError, ...) \
do { \
struct testInfo info = { \
- name, NULL, migrateFrom, migrateFd, json, expectError \
+ name, NULL, migrateFrom, migrateFd, expectError \
}; \
if (!(info.extraFlags = qemuCapsNew())) \
return EXIT_FAILURE; \
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_PCI_MULTIFUNCTION);
- json = true;
DO_TEST("monitor-json", false, QEMU_CAPS_DEVICE,
QEMU_CAPS_CHARDEV, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_NODEFCONFIG);
DO_TEST("no-shutdown", false, QEMU_CAPS_DEVICE,
QEMU_CAPS_CHARDEV, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_NO_SHUTDOWN);
- json = false;
free(driver.stateDir);
virCapabilitiesFree(driver.caps);