[Pkg-libvirt-commits] [libguestfs] 30/87: Use recommended timer settings for KVM (RHBZ#1053847).

Hilko Bengen bengen at moszumanska.debian.org
Wed Feb 19 21:10:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository libguestfs.

commit 5c91c8b3b87efa333f5d0713fcf56f6dad04677e
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Sat Jan 18 11:55:27 2014 +0000

    Use recommended timer settings for KVM (RHBZ#1053847).
    
    See: https://bugzilla.redhat.com/show_bug.cgi?id=1053847#c0
    
    Thanks: Cole Robinson, and several QEMU developers.
    
    (cherry picked from commit b6ff6421686e6fd7e5f7db8eed24419c7bd09688)
---
 src/launch-direct.c  | 24 +++++-------------------
 src/launch-libvirt.c | 21 +++++++++++++++++++--
 2 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/src/launch-direct.c b/src/launch-direct.c
index bd9068a..b97b0e7 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -384,19 +384,6 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
       ADD_CMDLINE ("-enable-kvm");
   }
 
-#if defined(__i386__) || defined (__x86_64__)
-  /* -cpu host only works if KVM is available. */
-  if (has_kvm) {
-    /* Specify the host CPU for speed, and kvmclock for stability. */
-    ADD_CMDLINE ("-cpu");
-    ADD_CMDLINE ("host,+kvmclock");
-  } else {
-    /* Specify default CPU for speed, and kvmclock for stability. */
-    ADD_CMDLINE ("-cpu");
-    ADD_CMDLINE_PRINTF ("qemu%d,+kvmclock", SIZEOF_LONG*8);
-  }
-#endif
-
   if (g->smp > 1) {
     ADD_CMDLINE ("-smp");
     ADD_CMDLINE_PRINTF ("%d", g->smp);
@@ -408,7 +395,9 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
   /* Force exit instead of reboot on panic */
   ADD_CMDLINE ("-no-reboot");
 
-  /* These options recommended by KVM developers to improve reliability. */
+  /* These are recommended settings, see RHBZ#1053847. */
+  ADD_CMDLINE ("-rtc");
+  ADD_CMDLINE ("driftfix=slew");
 #ifndef __arm__
   /* qemu-system-arm advertises the -no-hpet option but if you try
    * to use it, it usefully says:
@@ -416,12 +405,9 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
    * Cheers qemu developers.  How many years have we been asking for
    * capabilities?  Could be 3 or 4 years, I forget.
    */
-  if (qemu_supports (g, data, "-no-hpet"))
-    ADD_CMDLINE ("-no-hpet");
+  ADD_CMDLINE ("-no-hpet");
 #endif
-
-  if (qemu_supports (g, data, "-rtc-td-hack"))
-    ADD_CMDLINE ("-rtc-td-hack");
+  ADD_CMDLINE ("-no-kvm-pit-reinjection");
 
   ADD_CMDLINE ("-kernel");
   ADD_CMDLINE (kernel);
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 6b81d8b..b78590a 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -871,13 +871,30 @@ construct_libvirt_xml_cpu (guestfs_h *g,
   XMLERROR (-1,
             xmlTextWriterWriteAttribute (xo, BAD_CAST "offset",
                                          BAD_CAST "utc"));
+  /* These are recommended settings, see RHBZ#1053847. */
   XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "timer"));
   XMLERROR (-1,
             xmlTextWriterWriteAttribute (xo, BAD_CAST "name",
-                                         BAD_CAST "kvmclock"));
+                                         BAD_CAST "rtc"));
+  XMLERROR (-1,
+            xmlTextWriterWriteAttribute (xo, BAD_CAST "tickpolicy",
+                                         BAD_CAST "catchup"));
+  XMLERROR (-1, xmlTextWriterEndElement (xo));
+  XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "timer"));
+  XMLERROR (-1,
+            xmlTextWriterWriteAttribute (xo, BAD_CAST "name",
+                                         BAD_CAST "pit"));
+  XMLERROR (-1,
+            xmlTextWriterWriteAttribute (xo, BAD_CAST "tickpolicy",
+                                         BAD_CAST "delay"));
+  XMLERROR (-1, xmlTextWriterEndElement (xo));
+  XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "timer"));
+  XMLERROR (-1,
+            xmlTextWriterWriteAttribute (xo, BAD_CAST "name",
+                                         BAD_CAST "hpet"));
   XMLERROR (-1,
             xmlTextWriterWriteAttribute (xo, BAD_CAST "present",
-                                         BAD_CAST "yes"));
+                                         BAD_CAST "no"));
   XMLERROR (-1, xmlTextWriterEndElement (xo));
   XMLERROR (-1, xmlTextWriterEndElement (xo));
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list