]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Improve domainSetTime error info report
authorShanzhi Yu <shyu@redhat.com>
Tue, 30 Sep 2014 13:36:23 +0000 (21:36 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 3 Oct 2014 13:48:07 +0000 (15:48 +0200)
check domain's status before call virQEMUCapsGet to report a accurate
error when domain is shut off

Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1147847
Signed-off-by: Shanzhi Yu <shyu@redhat.com>
src/qemu/qemu_driver.c

index 7c0999871eb8cf0239277e995213f0d05b772c07..d111ccd3d4368f15a66a79f44e85827a9e744cd2 100644 (file)
@@ -17377,13 +17377,6 @@ qemuDomainSetTime(virDomainPtr dom,
 
     priv = vm->privateData;
 
-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) {
-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("cannot set time: qemu doesn't support "
-                         "rtc-reset-reinjection command"));
-        goto cleanup;
-    }
-
     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
         goto cleanup;
 
@@ -17393,6 +17386,13 @@ qemuDomainSetTime(virDomainPtr dom,
         goto endjob;
     }
 
+    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) {
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("cannot set time: qemu doesn't support "
+                         "rtc-reset-reinjection command"));
+        goto endjob;
+    }
+
     if (!qemuDomainAgentAvailable(priv, true))
         goto endjob;