Re: [PATCH 08/11] qemu: Simplify QEMU binary search

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

 



On Thu, Sep 20, 2018 at 05:25:26PM +0200, Andrea Bolognani wrote:
Now that we have reduced the number of sensible options down
to either the native QEMU binary or RHEL's qemu-kvm, we can
make virQEMUCapsInitGuest() a bit simpler.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
src/qemu/qemu_capabilities.c | 29 +++++++----------------------
1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index fd8badc60b..72fa19a2b7 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -746,7 +746,6 @@ virQEMUCapsInitGuest(virCapsPtr caps,
                     virArch hostarch,
                     virArch guestarch)
{
-    size_t i;
    char *binary = NULL;
    virQEMUCapsPtr qemubinCaps = NULL;
    int ret = -1;
@@ -756,6 +755,13 @@ virQEMUCapsInitGuest(virCapsPtr caps,
     */
    binary = virQEMUCapsFindBinaryForArch(hostarch, guestarch);

+    /* RHEL doesn't follow the usual naming for QEMU binaries and ships
+     * a single binary named qemu-kvm outside of $PATH instead */

This does not look like something upstream libvirt should worry about.

Jano

+    if (virQEMUCapsGuestIsNative(hostarch, guestarch) && !binary) {
+        if (VIR_STRDUP(binary, "/usr/libexec/qemu-kvm") < 0)
+            return -1;
+    }
+
    /* Ignore binary if extracting version info fails */
    if (binary) {
        if (!(qemubinCaps = virQEMUCapsCacheLookup(cache, binary))) {

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]

  Powered by Linux