diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0606a5f2e8..6a6ccf932c 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1527,7 +1527,6 @@ qemuMonitorEmitSerialChange(qemuMonitorPtr mon, int qemuMonitorSetCapabilities(qemuMonitorPtr mon) { - int ret; VIR_DEBUG("mon=%p", mon); if (!mon) { @@ -1536,16 +1535,10 @@ qemuMonitorSetCapabilities(qemuMonitorPtr mon) return -1; } - if (mon->json) { - ret = qemuMonitorJSONSetCapabilities(mon); - if (ret < 0) - goto cleanup; - } else { - ret = 0; - } + if (!mon->json) + return 0; - cleanup: - return ret; + return qemuMonitorJSONSetCapabilities(mon); }