From: "Michael S. Tsirkin" <mst@redhat.com>
To: Asias He <asias@redhat.com>
Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
target-devel@vger.kernel.org,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v9 3/3] tcm_vhost: Add ioctl to get and set events missed flag
Date: Thu, 25 Apr 2013 08:55:59 +0300 [thread overview]
Message-ID: <20130425055559.GE6710@redhat.com> (raw)
In-Reply-To: <1366859406-8963-4-git-send-email-asias@redhat.com>
On Thu, Apr 25, 2013 at 11:10:06AM +0800, Asias He wrote:
> Signed-off-by: Asias He <asias@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/vhost/tcm_vhost.c | 17 +++++++++++++++++
> drivers/vhost/tcm_vhost.h | 3 +++
> 2 files changed, 20 insertions(+)
>
> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
> index 137ae34..9c01d2a 100644
> --- a/drivers/vhost/tcm_vhost.c
> +++ b/drivers/vhost/tcm_vhost.c
> @@ -1202,8 +1202,11 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,
> struct vhost_scsi_target backend;
> void __user *argp = (void __user *)arg;
> u64 __user *featurep = argp;
> + u32 __user *eventsp = argp;
> + u32 events_missed;
> u64 features;
> int r, abi_version = VHOST_SCSI_ABI_VERSION;
> + struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT];
>
> switch (ioctl) {
> case VHOST_SCSI_SET_ENDPOINT:
> @@ -1224,6 +1227,20 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,
> if (copy_to_user(argp, &abi_version, sizeof abi_version))
> return -EFAULT;
> return 0;
> + case VHOST_SCSI_SET_EVENTS_MISSED:
> + if (get_user(events_missed, eventsp))
> + return -EFAULT;
> + mutex_lock(&vq->mutex);
> + vs->vs_events_missed = events_missed;
> + mutex_unlock(&vq->mutex);
> + return 0;
> + case VHOST_SCSI_GET_EVENTS_MISSED:
> + mutex_lock(&vq->mutex);
> + events_missed = vs->vs_events_missed;
> + mutex_unlock(&vq->mutex);
> + if (put_user(events_missed, eventsp))
> + return -EFAULT;
> + return 0;
> case VHOST_GET_FEATURES:
> features = VHOST_SCSI_FEATURES;
> if (copy_to_user(featurep, &features, sizeof features))
> diff --git a/drivers/vhost/tcm_vhost.h b/drivers/vhost/tcm_vhost.h
> index a545a5b..514b9fd 100644
> --- a/drivers/vhost/tcm_vhost.h
> +++ b/drivers/vhost/tcm_vhost.h
> @@ -123,3 +123,6 @@ struct vhost_scsi_target {
> #define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
> /* Changing this breaks userspace. */
> #define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)
> +/* Set and get the events missed flag */
> +#define VHOST_SCSI_SET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x43, __u32)
> +#define VHOST_SCSI_GET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x44, __u32)
> --
> 1.8.1.4
next prev parent reply other threads:[~2013-04-25 5:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-25 3:10 [PATCH v9 0/3] tcm_vhost hotplug Asias He
2013-04-25 3:10 ` [PATCH v9 1/3] tcm_vhost: Refactor the lock nesting rule Asias He
2013-04-25 5:44 ` Michael S. Tsirkin
2013-04-25 3:10 ` [PATCH v9 2/3] tcm_vhost: Add hotplug/hotunplug support Asias He
2013-04-25 5:52 ` Michael S. Tsirkin
2013-04-25 3:10 ` [PATCH v9 3/3] tcm_vhost: Add ioctl to get and set events missed flag Asias He
[not found] ` <1366859406-8963-4-git-send-email-asias@redhat.com>
2013-04-25 5:54 ` Michael S. Tsirkin
2013-04-25 5:55 ` Michael S. Tsirkin [this message]
2013-04-25 5:55 ` [PATCH v9 0/3] tcm_vhost hotplug Michael S. Tsirkin
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=20130425055559.GE6710@redhat.com \
--to=mst@redhat.com \
--cc=asias@redhat.com \
--cc=kvm@vger.kernel.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).