From: Paolo Bonzini <pbonzini@redhat.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
kvm-devel <kvm@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Zhi Yong Wu <wuzhy@cn.ibm.com>,
Anthony Liguori <aliguori@linux.vnet.ibm.com>,
target-devel <target-devel@vger.kernel.org>,
lf-virt <virtualization@lists.linux-foundation.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [RFC 6/9] virtio-scsi: Open and initialize /dev/vhost-scsi
Date: Wed, 25 Jul 2012 09:05:31 +0200 [thread overview]
Message-ID: <500F9ABB.4050704@redhat.com> (raw)
In-Reply-To: <1343169246-17636-7-git-send-email-nab@linux-iscsi.org>
Il 25/07/2012 00:34, Nicholas A. Bellinger ha scritto:
> From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
>
> Begin adding vhost support by opening /dev/vhost-scsi.
>
> (v2: Drop legacy ->vhost_vqs[] usage)
>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
> ---
> hw/virtio-scsi.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
> index 4a787d3..dea3269 100644
> --- a/hw/virtio-scsi.c
> +++ b/hw/virtio-scsi.c
> @@ -18,6 +18,7 @@
> #include "virtio-scsi.h"
> #include <hw/scsi.h>
> #include <hw/scsi-defs.h>
> +#include "vhost.h"
>
> #define VIRTIO_SCSI_VQ_SIZE 128
> #define VIRTIO_SCSI_CDB_SIZE 32
> @@ -137,6 +138,9 @@ typedef struct {
> VirtQueue *ctrl_vq;
> VirtQueue *event_vq;
> VirtQueue *cmd_vqs[0];
> +
> + bool vhost_started;
> + VHostSCSI *vhost_scsi;
> } VirtIOSCSI;
>
> typedef struct VirtIOSCSIReq {
> @@ -456,6 +460,11 @@ static void virtio_scsi_fail_cmd_req(VirtIOSCSIReq *req)
> virtio_scsi_complete_req(req);
> }
>
> +static VirtIOSCSI *to_virtio_scsi(VirtIODevice *vdev)
> +{
> + return (VirtIOSCSI *)vdev;
> +}
This function is unused and, because it is static, it will break
compilation. Not that it would compile anyway since VHostSCSI is not
defined yet... ;)
> static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq)
> {
> VirtIOSCSI *s = (VirtIOSCSI *)vdev;
> @@ -605,6 +614,8 @@ VirtIODevice *virtio_scsi_init(DeviceState *dev, VirtIOSCSIConf *proxyconf)
>
> s->qdev = dev;
> s->conf = proxyconf;
> + s->vhost_started = false;
> + s->vhost_scsi = proxyconf->vhost_scsi;
No need for this, just use s->conf->vhost_scsi.
Also, please do not register the QEMU SCSI bus if vhost-scsi is active.
Paolo
>
> /* TODO set up vdev function pointers */
> s->vdev.get_config = virtio_scsi_get_config;
> @@ -636,5 +647,6 @@ void virtio_scsi_exit(VirtIODevice *vdev)
> {
> VirtIOSCSI *s = (VirtIOSCSI *)vdev;
> unregister_savevm(s->qdev, "virtio-scsi", s);
> + vhost_dev_cleanup(&s->vhost_scsi);
> virtio_cleanup(vdev);
> }
>
WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
kvm-devel <kvm@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Zhi Yong Wu <wuzhy@cn.ibm.com>,
Anthony Liguori <aliguori@linux.vnet.ibm.com>,
target-devel <target-devel@vger.kernel.org>,
Hannes Reinecke <hare@suse.de>,
lf-virt <virtualization@lists.linux-foundation.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [Qemu-devel] [RFC 6/9] virtio-scsi: Open and initialize /dev/vhost-scsi
Date: Wed, 25 Jul 2012 09:05:31 +0200 [thread overview]
Message-ID: <500F9ABB.4050704@redhat.com> (raw)
In-Reply-To: <1343169246-17636-7-git-send-email-nab@linux-iscsi.org>
Il 25/07/2012 00:34, Nicholas A. Bellinger ha scritto:
> From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
>
> Begin adding vhost support by opening /dev/vhost-scsi.
>
> (v2: Drop legacy ->vhost_vqs[] usage)
>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
> ---
> hw/virtio-scsi.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
> index 4a787d3..dea3269 100644
> --- a/hw/virtio-scsi.c
> +++ b/hw/virtio-scsi.c
> @@ -18,6 +18,7 @@
> #include "virtio-scsi.h"
> #include <hw/scsi.h>
> #include <hw/scsi-defs.h>
> +#include "vhost.h"
>
> #define VIRTIO_SCSI_VQ_SIZE 128
> #define VIRTIO_SCSI_CDB_SIZE 32
> @@ -137,6 +138,9 @@ typedef struct {
> VirtQueue *ctrl_vq;
> VirtQueue *event_vq;
> VirtQueue *cmd_vqs[0];
> +
> + bool vhost_started;
> + VHostSCSI *vhost_scsi;
> } VirtIOSCSI;
>
> typedef struct VirtIOSCSIReq {
> @@ -456,6 +460,11 @@ static void virtio_scsi_fail_cmd_req(VirtIOSCSIReq *req)
> virtio_scsi_complete_req(req);
> }
>
> +static VirtIOSCSI *to_virtio_scsi(VirtIODevice *vdev)
> +{
> + return (VirtIOSCSI *)vdev;
> +}
This function is unused and, because it is static, it will break
compilation. Not that it would compile anyway since VHostSCSI is not
defined yet... ;)
> static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq)
> {
> VirtIOSCSI *s = (VirtIOSCSI *)vdev;
> @@ -605,6 +614,8 @@ VirtIODevice *virtio_scsi_init(DeviceState *dev, VirtIOSCSIConf *proxyconf)
>
> s->qdev = dev;
> s->conf = proxyconf;
> + s->vhost_started = false;
> + s->vhost_scsi = proxyconf->vhost_scsi;
No need for this, just use s->conf->vhost_scsi.
Also, please do not register the QEMU SCSI bus if vhost-scsi is active.
Paolo
>
> /* TODO set up vdev function pointers */
> s->vdev.get_config = virtio_scsi_get_config;
> @@ -636,5 +647,6 @@ void virtio_scsi_exit(VirtIODevice *vdev)
> {
> VirtIOSCSI *s = (VirtIOSCSI *)vdev;
> unregister_savevm(s->qdev, "virtio-scsi", s);
> + vhost_dev_cleanup(&s->vhost_scsi);
> virtio_cleanup(vdev);
> }
>
next prev parent reply other threads:[~2012-07-25 7:05 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-24 22:33 [RFC 0/9] vhost-scsi: Add support for host virtualized target Nicholas A. Bellinger
2012-07-24 22:33 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-24 22:33 ` [RFC 1/9] notifier: add validity check and notify function Nicholas A. Bellinger
2012-07-24 22:33 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-25 6:53 ` Paolo Bonzini
2012-07-25 6:53 ` Paolo Bonzini
2012-07-25 6:53 ` [Qemu-devel] " Paolo Bonzini
2012-07-24 22:33 ` Nicholas A. Bellinger
2012-07-24 22:33 ` [RFC 2/9] virtio-pci: support host notifiers in TCG mode Nicholas A. Bellinger
2012-07-24 22:33 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-25 6:50 ` Paolo Bonzini
2012-07-25 6:50 ` [Qemu-devel] " Paolo Bonzini
2012-07-24 22:33 ` Nicholas A. Bellinger
2012-07-24 22:34 ` [RFC 3/9] virtio-pci: check that event notification worked Nicholas A. Bellinger
2012-07-24 22:34 ` Nicholas A. Bellinger
2012-07-24 22:34 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-24 22:34 ` [RFC 4/9] vhost: Pass device path to vhost_dev_init() Nicholas A. Bellinger
2012-07-24 22:34 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-24 22:34 ` Nicholas A. Bellinger
2012-07-24 22:34 ` [RFC 5/9] virtio-scsi: Add wwpn and tgpt properties Nicholas A. Bellinger
2012-07-24 22:34 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-24 22:34 ` Nicholas A. Bellinger
2012-07-24 22:34 ` [RFC 6/9] virtio-scsi: Open and initialize /dev/vhost-scsi Nicholas A. Bellinger
2012-07-24 22:34 ` Nicholas A. Bellinger
2012-07-24 22:34 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-25 7:05 ` Paolo Bonzini [this message]
2012-07-25 7:05 ` Paolo Bonzini
2012-07-24 22:34 ` [RFC 7/9] virtio-scsi: Start/stop vhost Nicholas A. Bellinger
2012-07-24 22:34 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-25 7:01 ` Paolo Bonzini
2012-07-25 7:01 ` Paolo Bonzini
2012-07-25 7:01 ` [Qemu-devel] " Paolo Bonzini
2012-07-25 7:03 ` Paolo Bonzini
2012-07-25 7:03 ` [Qemu-devel] " Paolo Bonzini
2012-07-25 7:03 ` Paolo Bonzini
2012-07-24 22:34 ` Nicholas A. Bellinger
2012-07-24 22:34 ` [RFC 8/9] virtio-scsi: Set max_target=0 during vhost-scsi operation Nicholas A. Bellinger
2012-07-24 22:34 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-24 22:34 ` Nicholas A. Bellinger
2012-07-24 22:34 ` [RFC 9/9] vhost-scsi: add -vhost-scsi host device Nicholas A. Bellinger
2012-07-24 22:34 ` Nicholas A. Bellinger
2012-07-24 22:34 ` [Qemu-devel] " Nicholas A. Bellinger
2012-07-25 6:58 ` Paolo Bonzini
2012-07-25 6:58 ` [Qemu-devel] " Paolo Bonzini
2012-07-25 2:53 ` [RFC 0/9] vhost-scsi: Add support for host virtualized target Zhi Yong Wu
2012-07-25 2:53 ` [Qemu-devel] " Zhi Yong Wu
2012-07-25 2:53 ` Zhi Yong Wu
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=500F9ABB.4050704@redhat.com \
--to=pbonzini@redhat.com \
--cc=aliguori@linux.vnet.ibm.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=nab@linux-iscsi.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
--cc=target-devel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=wuzhy@cn.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.