Blame SOURCES/0009-launch-direct-Specify-cpu-host-kvmclock.patch

022f11
From b385c694f1028413c36188ae99279ed0d56bccd5 Mon Sep 17 00:00:00 2001
022f11
From: "Richard W.M. Jones" <rjones@redhat.com>
022f11
Date: Mon, 5 Aug 2013 16:35:47 +0100
022f11
Subject: [PATCH] launch: direct: Specify -cpu host,+kvmclock.
022f11
022f11
'-cpu host' makes the CPU look like the host CPU.  This is useful
022f11
because it means the appliance can use all the host CPU's features,
022f11
eg. for fast checksumming or MD XORing.
022f11
022f11
'kvmclock' is the paravirtualized clock for qemu/KVM.  It's much more
022f11
stable than relying on tsc or a virtualized device such as HPET, and
022f11
clock instability is one of the problems we have encountered when
022f11
running libguestfs on a heavily loaded machine, especially in a nested VM.
022f11
022f11
Note that we require qemu >= 1.2 (and have for a while) which has long
022f11
supported both of these options.
022f11
022f11
(cherry picked from commit 038ed0a08eaed33e62a27c9f91780a25de0bc08c)
022f11
---
022f11
 TODO                | 8 --------
022f11
 src/launch-direct.c | 4 ++++
022f11
 2 files changed, 4 insertions(+), 8 deletions(-)
022f11
022f11
diff --git a/TODO b/TODO
022f11
index 0a8cf57..61cde40 100644
022f11
--- a/TODO
022f11
+++ b/TODO
022f11
@@ -477,14 +477,6 @@ image would be replaced by equivalent files of zeroes, thus minimizing
022f11
 the size of the debug image that needs to be shipped to us by the
022f11
 customer.
022f11
 
022f11
-Optimize the appliance
022f11
-----------------------
022f11
-
022f11
-Pass -cpu host.  Anything else?
022f11
-
022f11
-[The libvirt backend uses 'host-model' which is basically
022f11
-the same as this]
022f11
-
022f11
 Sort out partitioning
022f11
 ---------------------
022f11
 
022f11
diff --git a/src/launch-direct.c b/src/launch-direct.c
022f11
index f1edb53..90d0df9 100644
022f11
--- a/src/launch-direct.c
022f11
+++ b/src/launch-direct.c
022f11
@@ -315,6 +315,10 @@ launch_direct (guestfs_h *g, const char *arg)
022f11
         add_cmdline (g, "-enable-kvm");
022f11
     }
022f11
 
022f11
+    /* Specify the host CPU for speed, and kvmclock for stability. */
022f11
+    add_cmdline (g, "-cpu");
022f11
+    add_cmdline (g, "host,+kvmclock");
022f11
+
022f11
     if (g->smp > 1) {
022f11
       snprintf (buf, sizeof buf, "%d", g->smp);
022f11
       add_cmdline (g, "-smp");
022f11
-- 
022f11
1.8.3.1
022f11