Re: [libvirt PATCH 09/20] qemu: Introduce virQEMUCapsTypeIsAccelerated

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

 



On Mon, Jan 17, 2022 at 11:52:49AM +0100, Andrea Bolognani wrote:
> From: Roman Bolshakov <r.bolshakov@xxxxxxxxx>
> 
> It replaces hardcoded checks for KVM. It'll be cleaner to use
> the function once multiple accelerators are supported in the
> QEMU driver.
> 
> Explicit KVM domain checks should be done only when a feature is
> available only for KVM.
> 
> Signed-off-by: Roman Bolshakov <r.bolshakov@xxxxxxxxx>
> Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
> Tested-by: Brad Laue <brad@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 8d3e8b3afb..85dd36e274 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -803,6 +803,13 @@ virQEMUCapsAccelStr(virDomainVirtType type)
>  }
>  
>  
> +static bool
> +virQEMUCapsTypeIsAccelerated(virDomainVirtType type)
> +{
> +    return type == VIR_DOMAIN_VIRT_KVM;
> +}

 type !=  VIR_DOMAIN_VIRT_QEMU

and then we'll never need to change it again when adding more
hardware virt types.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




[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