]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: time: Report errors if agent command fails
authorPeter Krempa <pkrempa@redhat.com>
Tue, 16 Sep 2014 13:37:08 +0000 (15:37 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 16 Sep 2014 15:51:39 +0000 (17:51 +0200)
Commit b606bbb4 broke reporting of errors when setting of guest time
fails via the guest agent as the return value is not checked and later
overwritten by the return value qemuMonitorRTCResetReinjection();

Fix this by checking the return value before resetting the RTC
reinjection.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1142294

src/qemu/qemu_driver.c

index 6008aeb0783c69ed616811248461ca4e60b02547..15ad64de433fee0cd4660195074dc3aa79967496 100644 (file)
@@ -17134,6 +17134,9 @@ qemuDomainSetTime(virDomainPtr dom,
     rv = qemuAgentSetTime(priv->agent, seconds, nseconds, rtcSync);
     qemuDomainObjExitAgent(vm);
 
+    if (rv < 0)
+        goto endjob;
+
     if (!virDomainObjIsActive(vm)) {
         virReportError(VIR_ERR_OPERATION_INVALID,
                        "%s", _("domain is not running"));