From: Asias He <asias@redhat.com>
To: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
virtualization@lists.linux-foundation.org,
target-devel@vger.kernel.org,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH V3 1/2] tcm_vhost: Introduce tcm_vhost_check_feature()
Date: Tue, 12 Mar 2013 10:45:38 +0800 [thread overview]
Message-ID: <1363056339-6061-2-git-send-email-asias@redhat.com> (raw)
In-Reply-To: <1363056339-6061-1-git-send-email-asias@redhat.com>
This helper is useful to check if a feature is supported.
Signed-off-by: Asias He <asias@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
drivers/vhost/tcm_vhost.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
index c5157cd..ee6dc47 100644
--- a/drivers/vhost/tcm_vhost.c
+++ b/drivers/vhost/tcm_vhost.c
@@ -91,6 +91,18 @@ static int iov_num_pages(struct iovec *iov)
((unsigned long)iov->iov_base & PAGE_MASK)) >> PAGE_SHIFT;
}
+static bool tcm_vhost_check_feature(struct vhost_scsi *vs, int feature)
+{
+ bool ret = false;
+
+ mutex_lock(&vs->dev.mutex);
+ if (vhost_has_feature(&vs->dev, feature))
+ ret = true;
+ mutex_unlock(&vs->dev.mutex);
+
+ return ret;
+}
+
static bool tcm_vhost_check_endpoint(struct vhost_scsi *vs)
{
bool ret = false;
--
1.8.1.4
next prev parent reply other threads:[~2013-03-12 2:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 2:45 [PATCH V3 0/2] tcm_vhost hotplug/hotunplug support Asias He
2013-03-12 2:45 ` Asias He [this message]
2013-03-12 2:45 ` [PATCH V3 2/2] tcm_vhost: Add " Asias He
2013-03-18 21:46 ` [PATCH V3 0/2] tcm_vhost " Nicholas A. Bellinger
2013-03-18 21:53 ` Michael S. Tsirkin
2013-03-18 22:19 ` Nicholas A. Bellinger
[not found] ` <1363645170.3156.86.camel@haakon2.linux-iscsi.org>
2013-03-19 0:33 ` Asias He
2013-03-19 9:36 ` Paolo Bonzini
2013-03-19 13:45 ` Michael S. Tsirkin
2013-03-19 13:47 ` Paolo Bonzini
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=1363056339-6061-2-git-send-email-asias@redhat.com \
--to=asias@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=nab@linux-iscsi.org \
--cc=pbonzini@redhat.com \
--cc=stefanha@redhat.com \
--cc=target-devel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/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).