qemu: time: Report errors if agent command fails

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
This commit is contained in:
Peter Krempa 2014-09-16 15:37:08 +02:00
parent b20d39a56f
commit 98fd3b7f0b

View 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"));