diff mbox series

[1/7] accel/kvm: Let kvm_check_extension use global KVM state

Message ID 20200623105052.1700-2-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series accel/kvm: Simplify few functions that can use global kvm_state | expand

Commit Message

Philippe Mathieu-Daudé June 23, 2020, 10:50 a.m. UTC
As KVM supported extentions those should be the same for
all VMs, it is safe to directly use the global kvm_state
in kvm_check_extension().

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 accel/kvm/kvm-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Cornelia Huck June 23, 2020, 3:25 p.m. UTC | #1
On Tue, 23 Jun 2020 12:50:46 +0200
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> As KVM supported extentions those should be the same for
> all VMs, it is safe to directly use the global kvm_state
> in kvm_check_extension().
> 
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  accel/kvm/kvm-all.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index f24d7da783..934a7d6b24 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -913,7 +913,7 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
>  {
>      int ret;
>  
> -    ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, extension);
> +    ret = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, extension);
>      if (ret < 0) {
>          ret = 0;
>      }

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
diff mbox series

Patch

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index f24d7da783..934a7d6b24 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -913,7 +913,7 @@  int kvm_check_extension(KVMState *s, unsigned int extension)
 {
     int ret;
 
-    ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, extension);
+    ret = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, extension);
     if (ret < 0) {
         ret = 0;
     }