Re: [PATCH] qemu: Only issue the rtc-reset-reinjection QMP command on x86.

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

 



On Mon, May 25, 2015 at 05:26:01PM +0200, Peter Krempa wrote:
On Mon, May 25, 2015 at 16:59:08 +0200, Andrea Bolognani wrote:
The command is only defined in QEMU for TARGET_I386, so issuing it on
any other architecture can't possibly work.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1211938
---
 src/qemu/qemu_driver.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index aa0acde..743ca6e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18945,7 +18945,10 @@ qemuDomainSetTime(virDomainPtr dom,
         goto endjob;
     }

-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) {
+    /* The rtc-reset-reinjection QMP command is only available on x86 */

Since we properly track support for this command via the capabilities
and qemu does not expose it:

+    if (ARCH_IS_X86(vm->def->os.arch) &&
+        !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"));

I'd simply remove this error message since it is semantically wrong once
PPC does not require to reset the RTC reinjection.

@@ -18968,13 +18971,16 @@ qemuDomainSetTime(virDomainPtr dom,
         goto endjob;
     }

-    qemuDomainObjEnterMonitor(driver, vm);
-    rv = qemuMonitorRTCResetReinjection(priv->mon);
-    if (qemuDomainObjExitMonitor(driver, vm) < 0)
-        goto endjob;
+    /* The rtc-reset-reinjection QMP command is only available on x86 */
+    if (ARCH_IS_X86(vm->def->os.arch)) {
+        qemuDomainObjEnterMonitor(driver, vm);
+        rv = qemuMonitorRTCResetReinjection(priv->mon);

And just conditionally call this when the
QEMU_CAPS_RTC_RESET_REINJECTION is present and not in an architecture
specific way.

By this you get rid of the arch specific hackery.


But on x86 we don't even want to call the SetTime command when we
cannot reset the rtc reinjection.  On ppc there is no reinjection
being done, hence nothing to reset.

+        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            goto endjob;

-    if (rv < 0)
-        goto endjob;
+        if (rv < 0)
+            goto endjob;
+    }

     ret = 0;


Peter



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

Attachment: signature.asc
Description: PGP signature

--
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]