kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jike Song <jike.song@intel.com>
Cc: alex williamson <alex.williamson@redhat.com>,
	guangrong xiao <guangrong.xiao@linux.intel.com>,
	kwankhede@nvidia.com, cjia@nvidia.com,
	kevin tian <kevin.tian@intel.com>,
	kvm@vger.kernel.org
Subject: Re: [v3 3/5] KVM: move kvm_get_kvm to kvm_host.h
Date: Mon, 31 Oct 2016 04:33:06 -0400 (EDT)	[thread overview]
Message-ID: <1513747012.9629028.1477902786275.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1477895706-22824-4-git-send-email-jike.song@intel.com>

> So that external users like vfio can call it without introducing
> symbol-level dependency.
> 
> Signed-off-by: Jike Song <jike.song@intel.com>
> ---
>  include/linux/kvm_host.h | 5 ++++-
>  virt/kvm/kvm_main.c      | 6 ------
>  2 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 01c0b9c..e1e877af 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -526,7 +526,10 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned
> vcpu_align,
>  		  struct module *module);
>  void kvm_exit(void);
>  
> -void kvm_get_kvm(struct kvm *kvm);
> +static inline void kvm_get_kvm(struct kvm *kvm)
> +{
> +	atomic_inc(&kvm->users_count);
> +}
>  void kvm_put_kvm(struct kvm *kvm);
>  
>  static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int
>  as_id)
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 348d6fd..e25359b 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -740,12 +740,6 @@ static void kvm_destroy_vm(struct kvm *kvm)
>  	mmdrop(mm);
>  }
>  
> -void kvm_get_kvm(struct kvm *kvm)
> -{
> -	atomic_inc(&kvm->users_count);
> -}
> -EXPORT_SYMBOL_GPL(kvm_get_kvm);
> -
>  void kvm_put_kvm(struct kvm *kvm)
>  {
>  	if (atomic_dec_and_test(&kvm->users_count))
> --
> 1.9.1
> 
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

  reply	other threads:[~2016-10-31  8:33 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31  6:35 [v3 0/5] plumb kvm/vfio to allow getting kvm from vfio_group Jike Song
2016-10-31  6:35 ` [v3 1/5] vfio: Rearrange functions to get vfio_group from dev Jike Song
2016-10-31  6:35 ` [v3 2/5] vfio: export functions to get vfio_group from device and put it Jike Song
2016-10-31  6:35 ` [v3 3/5] KVM: move kvm_get_kvm to kvm_host.h Jike Song
2016-10-31  8:33   ` Paolo Bonzini [this message]
2016-10-31  6:35 ` [v3 4/5] vfio: implement APIs to set/put kvm to/from vfio group Jike Song
2016-11-07 18:04   ` Alex Williamson
2016-11-07 18:10     ` Paolo Bonzini
2016-11-07 18:28       ` Alex Williamson
2016-11-07 20:45         ` Paolo Bonzini
2016-11-09 12:49           ` Jike Song
2016-11-09 13:06             ` Xiao Guangrong
2016-11-09 13:31               ` Paolo Bonzini
2016-11-09 14:00                 ` Xiao Guangrong
2016-11-09 14:28                   ` Paolo Bonzini
2016-11-10  4:13                   ` Jike Song
2016-11-09 17:53             ` Alex Williamson
2016-11-10  4:10               ` Jike Song
2016-11-10  6:04                 ` Jike Song
2016-11-10 15:37                   ` Alex Williamson
2016-11-11  7:29                     ` Jike Song
2016-11-14 10:19               ` Jike Song
2016-11-14 15:52                 ` Alex Williamson
2016-11-09  2:28         ` Jike Song
2016-11-09  2:52           ` Xiao Guangrong
2016-11-09  3:07             ` Jike Song
2016-10-31  6:35 ` [v3 5/5] KVM: set/clear kvm to/from vfio group during add/delete Jike Song
2016-10-31  8:33   ` Paolo Bonzini
2016-10-31  7:06 ` [v3 0/5] plumb kvm/vfio to allow getting kvm from vfio_group Xiao Guangrong
2016-10-31  7:24   ` Jike Song
2016-10-31  7:24     ` Xiao Guangrong
2016-10-31  7:30       ` Jike Song
2016-10-31  7:35         ` Xiao Guangrong
2016-11-02  1:06 ` Jike Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513747012.9629028.1477902786275.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=cjia@nvidia.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=jike.song@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).