[PATCH 2/2] qemu: remove YAJL check for qemuDomainReboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Xu He Jie <xuhj@xxxxxxxxxxxxxxxxxx>


Signed-off-by: Xu He Jie <xuhj@xxxxxxxxxxxxxxxxxx>
---
 src/qemu/qemu_driver.c |   41 ++++++++++++++---------------------------
 1 files changed, 14 insertions(+), 27 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b0c9c02..ee98662 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1535,11 +1535,7 @@ static int qemuDomainReboot(virDomainPtr dom, unsigned int flags) {
     struct qemud_driver *driver = dom->conn->privateData;
     virDomainObjPtr vm;
     int ret = -1;
-#if HAVE_YAJL
     qemuDomainObjPrivatePtr priv;
-#endif
-
-    virCheckFlags(0, -1);
 
     qemuDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -1553,35 +1549,26 @@ static int qemuDomainReboot(virDomainPtr dom, unsigned int flags) {
         goto cleanup;
     }
 
-#if HAVE_YAJL
     priv = vm->privateData;
 
-    if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON)) {
-        if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
-            goto cleanup;
+    if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
+        goto cleanup;
 
-        if (!virDomainObjIsActive(vm)) {
-            qemuReportError(VIR_ERR_OPERATION_INVALID,
-                            "%s", _("domain is not running"));
-            goto endjob;
-        }
+    if (!virDomainObjIsActive(vm)) {
+        qemuReportError(VIR_ERR_OPERATION_INVALID,
+                        "%s", _("domain is not running"));
+        goto endjob;
+    }
 
-        qemuDomainObjEnterMonitor(driver, vm);
-        ret = qemuMonitorSystemReset(priv->mon);
-        qemuDomainObjExitMonitor(driver, vm);
+    qemuDomainObjEnterMonitor(driver, vm);
+    ret = qemuMonitorSystemReset(priv->mon);
+    qemuDomainObjExitMonitor(driver, vm);
 
-        priv->fakeReboot = true;
+    priv->fakeReboot = false;
 
-    endjob:
-        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
+endjob:
+    if (qemuDomainObjEndJob(driver, vm) == 0)
+        vm = NULL;
 
 cleanup:
     if (vm)
-- 
1.7.4.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]