[Pkg-libvirt-commits] [libguestfs] 127/146: aarch64: launch: libvirt: As a workaround, pass -cpu parameter to qemu.

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 17:01:19 UTC 2015


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

bengen pushed a commit to branch master
in repository libguestfs.

commit a1e6239e4ef20ff4022ca3ba400f020d6ed118e1
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Jan 21 05:37:56 2015 -0500

    aarch64: launch: libvirt: As a workaround, pass -cpu parameter to qemu.
    
    When libguestfs is running using TCG on aarch64, we need to pass the
    -cpu cortex-a57 parameter to qemu.  Libvirt doesn't let us do this,
    complaining "Unable to find CPU definition".
    
    As a temporary workaround only, use <qemu:commandline> to pass this
    argument directly to qemu.  When libvirt is fixed we can remove this
    hack.
    
    This is a workaround for libvirt bug RHBZ#1184411.
    
    See:
    https://www.redhat.com/archives/libvirt-users/2014-August/msg00043.html
    https://bugzilla.redhat.com/show_bug.cgi?id=1184411
    (cherry picked from commit 7e4b7a346a4558a02aeb58f82d518509ce6e5d03)
---
 src/launch-libvirt.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 1a0e5a7..f8f6213 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -1087,12 +1087,16 @@ construct_libvirt_xml_cpu (guestfs_h *g,
         } end_element ();
       }
       else {
-        /* XXX This does not work, see:
+        /* XXX This does not work on aarch64, see:
          * https://www.redhat.com/archives/libvirt-users/2014-August/msg00043.html
+	 * https://bugzilla.redhat.com/show_bug.cgi?id=1184411
+	 * Instead we hack around it using <qemu:commandline> below.
          */
+#ifndef __aarch64__
         start_element ("model") {
           string (cpu_model);
         } end_element ();
+#endif
       }
     } end_element ();
   }
@@ -1730,6 +1734,21 @@ construct_libvirt_xml_qemu_cmdline (guestfs_h *g,
       }
     }
 
+#ifdef __aarch64__
+    /* This is a temporary hack until RHBZ#1184411 is resolved.
+     * See comments above about cpu model and aarch64.
+     */
+    const char *cpu_model = guestfs___get_cpu_model (params->data->is_kvm);
+    if (STRNEQ (cpu_model, "host")) {
+      start_element ("qemu:arg") {
+        attribute ("value", "-cpu");
+      } end_element ();
+      start_element ("qemu:arg") {
+        attribute ("value", cpu_model);
+      } end_element ();
+    }
+#endif
+
   } end_element (); /* </qemu:commandline> */
 
   return 0;

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