[Pkg-libvirt-commits] [libguestfs] 05/29: launch: Refactor guestfs_int_get_cpu_model code.

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:14:15 UTC 2015


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

bengen pushed a commit to annotated tag upstream/1.29.48
in repository libguestfs.

commit 029fc60ee509f53548f53e75ab571ff3fc6a4459
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Jun 19 19:49:41 2015 +0100

    launch: Refactor guestfs_int_get_cpu_model code.
    
    Shorter and does the same thing.
---
 src/launch.c | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/src/launch.c b/src/launch.c
index fbe9246..fd5479e 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -399,32 +399,18 @@ guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev,
 const char *
 guestfs_int_get_cpu_model (int kvm)
 {
-#if defined(__arm__)            /* 32 bit ARM. */
-  if (kvm)
-    return "host";
-  else
-    return NULL;
-
-#elif defined(__aarch64__)
+#if defined(__aarch64__)
   /* With -M virt, the default -cpu is cortex-a15.  Stupid. */
   if (kvm)
     return "host";
   else
     return "cortex-a57";
-
-#elif defined(__i386__) || defined(__x86_64__)
-  /* It is faster to pass the CPU host model to the appliance,
-   * allowing maximum speed for things like checksums, encryption.
-   * Only do this with KVM.  It is broken in subtle ways on TCG, and
-   * fairly pointless anyway.
-   */
-  if (kvm)
-    return "host";
-  else
-    return NULL;
-
 #else
-  /* Hope for the best ... */
+  /* On most architectures, it is faster to pass the CPU host model to
+   * the appliance, allowing maximum speed for things like checksums
+   * and encryption.  Only do this with KVM.  It is broken in subtle
+   * ways on TCG, and fairly pointless when you're emulating anyway.
+   */
   if (kvm)
     return "host";
   else

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