[libvirt] [PATCHv1 5/7] qemu_capabilities: Find QEMU binary for S390 arch

Chris Venteicher posted 7 patches 7 years ago
[libvirt] [PATCHv1 5/7] qemu_capabilities: Find QEMU binary for S390 arch
Posted by Chris Venteicher 7 years ago
S390 uses qemu-kvm in /usr/libexec.
---
 src/qemu/qemu_capabilities.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 9ffbf91a90..ac7569679c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -687,6 +687,11 @@ virQEMUCapsFindBinaryForArch(virArch hostarch,
             goto out;
     }
 
+    /* Fourth attempt: try 'qemu-kvm' */
+    if ((ret = virQEMUCapsFindBinary("%s", "/usr/libexec/qemu-kvm")) != NULL)
+        goto out;
+
+
  out:
     return ret;
 }
-- 
2.14.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv1 5/7] qemu_capabilities: Find QEMU binary for S390 arch
Posted by Jiri Denemark 6 years, 12 months ago
On Sat, May 05, 2018 at 12:48:47 -0500, Chris Venteicher wrote:
> S390 uses qemu-kvm in /usr/libexec.

That's incorrect, /usr/libexec/qemu-kvm is the native binary on
RHEL/CentOS. That is it's arch matches host arch.

> ---
>  src/qemu/qemu_capabilities.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 9ffbf91a90..ac7569679c 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -687,6 +687,11 @@ virQEMUCapsFindBinaryForArch(virArch hostarch,
>              goto out;
>      }
>  
> +    /* Fourth attempt: try 'qemu-kvm' */
> +    if ((ret = virQEMUCapsFindBinary("%s", "/usr/libexec/qemu-kvm")) != NULL)
> +        goto out;
> +
> +
>   out:
>      return ret;
>  }

NACK, this is handled elsewhere.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv1 5/7] qemu_capabilities: Find QEMU binary for S390 arch
Posted by Collin Walling 6 years, 12 months ago
On 05/17/2018 04:41 PM, Jiri Denemark wrote:
> On Sat, May 05, 2018 at 12:48:47 -0500, Chris Venteicher wrote:
>> S390 uses qemu-kvm in /usr/libexec.
> 
> That's incorrect, /usr/libexec/qemu-kvm is the native binary on
> RHEL/CentOS. That is it's arch matches host arch.
> 
>> ---
>>  src/qemu/qemu_capabilities.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
>> index 9ffbf91a90..ac7569679c 100644
>> --- a/src/qemu/qemu_capabilities.c
>> +++ b/src/qemu/qemu_capabilities.c
>> @@ -687,6 +687,11 @@ virQEMUCapsFindBinaryForArch(virArch hostarch,
>>              goto out;
>>      }
>>  
>> +    /* Fourth attempt: try 'qemu-kvm' */
>> +    if ((ret = virQEMUCapsFindBinary("%s", "/usr/libexec/qemu-kvm")) != NULL)
>> +        goto out;
>> +
>> +
>>   out:
>>      return ret;
>>  }
> 
> NACK, this is handled elsewhere.

This is going to sound silly since the string "redhat" is found everywhere in these
emails, but do you think it's worthwhile to also add the ability to probe the other 
native binaries that are used by other distros?

For example (and I believe is why you mention "this is handled elsewhere") 
virQEMUCapsInitGuest (src/qemu/qemu_capabilities.c) will check for the different "kvmbins" 
for RHEL, Fedora, and Debian/Ubuntu. A little bit of work would allow us to reuse this to 
get the appropriate qemu caps for the other distros.

A "virQEMUCapsFindNativeBinary" or something like that comes to mind.

Just a thought.

> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 


-- 
Respectfully,
- Collin Walling

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv1 5/7] qemu_capabilities: Find QEMU binary for S390 arch
Posted by Jiri Denemark 6 years, 12 months ago
On Thu, May 17, 2018 at 17:02:23 -0400, Collin Walling wrote:
> On 05/17/2018 04:41 PM, Jiri Denemark wrote:
> > On Sat, May 05, 2018 at 12:48:47 -0500, Chris Venteicher wrote:
> >> S390 uses qemu-kvm in /usr/libexec.
> > 
> > That's incorrect, /usr/libexec/qemu-kvm is the native binary on
> > RHEL/CentOS. That is it's arch matches host arch.
> > 
> >> ---
> >>  src/qemu/qemu_capabilities.c | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> >> index 9ffbf91a90..ac7569679c 100644
> >> --- a/src/qemu/qemu_capabilities.c
> >> +++ b/src/qemu/qemu_capabilities.c
> >> @@ -687,6 +687,11 @@ virQEMUCapsFindBinaryForArch(virArch hostarch,
> >>              goto out;
> >>      }
> >>  
> >> +    /* Fourth attempt: try 'qemu-kvm' */
> >> +    if ((ret = virQEMUCapsFindBinary("%s", "/usr/libexec/qemu-kvm")) != NULL)
> >> +        goto out;
> >> +
> >> +
> >>   out:
> >>      return ret;
> >>  }
> > 
> > NACK, this is handled elsewhere.
> 
> This is going to sound silly since the string "redhat" is found everywhere in these
> emails, but do you think it's worthwhile to also add the ability to probe the other 
> native binaries that are used by other distros?

Sure, but do you know any other distro which would use another stupid
non-standard location and name for QEMU binaries? I hope they would all
use upstream names and locations, i.e., /usr/bin/qemu-system-$ARCH or
/usr/libexec/qemu-kvm if they are derived from RHEL. If there are other
options, I guess we should handle them.

Currently, we probe for /usr/libexec/qemu-kvm, qemu-kvm, and kvm in
virQEMUCapsInitGuest and we could easily extend this list if needed.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list