Nicholas A. Bellinger
2012-Jul-11 20:55 UTC
[PATCH] hw/virtio-scsi: Set max_target=0 during vhost-scsi operation
From: Nicholas Bellinger <nab at linux-iscsi.org> This QEMU patch sets VirtIOSCSIConfig->max_target=0 for vhost-scsi operation to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID instance) when connected to individual tcm_vhost endpoints as requested by Paolo. This ensures that virtio-scsi LLD only attempts to scan target IDs up to VIRTIO_SCSI_MAX_TARGET when connected via virtio-scsi-raw. It's currently cut against Zhi's qemu vhost-scsi tree here: https://github.com/wuzhy/qemu/tree/vhost-scsi Cc: Stefan Hajnoczi <stefanha at linux.vnet.ibm.com> Cc: Zhi Yong Wu <wuzhy at linux.vnet.ibm.com> Cc: Paolo Bonzini <pbonzini at redhat.com> Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org> --- hw/virtio-scsi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index e38cdd0..71276b6 100644 --- a/hw/virtio-scsi.c +++ b/hw/virtio-scsi.c @@ -523,7 +523,11 @@ static void virtio_scsi_get_config(VirtIODevice *vdev, stl_raw(&scsiconf->sense_size, s->sense_size); stl_raw(&scsiconf->cdb_size, s->cdb_size); stl_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL); - stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); + if (s->vhost_scsi) { + stl_raw(&scsiconf->max_target, 0); + } else { + stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); + } stl_raw(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN); } -- 1.7.2.5
Zhi Yong Wu
2012-Jul-12 05:34 UTC
[PATCH] hw/virtio-scsi: Set max_target=0 during vhost-scsi operation
HI, Do we need to maintain one QEMU branch to collect all useful latest patches for tcm_vhost support? You know, those patches will not get merged into qemu.git/master. On Thu, Jul 12, 2012 at 4:55 AM, Nicholas A. Bellinger <nab at linux-iscsi.org> wrote:> From: Nicholas Bellinger <nab at linux-iscsi.org> > > This QEMU patch sets VirtIOSCSIConfig->max_target=0 for vhost-scsi operation > to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID > instance) when connected to individual tcm_vhost endpoints as requested by > Paolo. > > This ensures that virtio-scsi LLD only attempts to scan target IDs up to > VIRTIO_SCSI_MAX_TARGET when connected via virtio-scsi-raw. > > It's currently cut against Zhi's qemu vhost-scsi tree here: > > https://github.com/wuzhy/qemu/tree/vhost-scsi > > Cc: Stefan Hajnoczi <stefanha at linux.vnet.ibm.com> > Cc: Zhi Yong Wu <wuzhy at linux.vnet.ibm.com> > Cc: Paolo Bonzini <pbonzini at redhat.com> > Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org> > --- > hw/virtio-scsi.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c > index e38cdd0..71276b6 100644 > --- a/hw/virtio-scsi.c > +++ b/hw/virtio-scsi.c > @@ -523,7 +523,11 @@ static void virtio_scsi_get_config(VirtIODevice *vdev, > stl_raw(&scsiconf->sense_size, s->sense_size); > stl_raw(&scsiconf->cdb_size, s->cdb_size); > stl_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL); > - stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); > + if (s->vhost_scsi) { > + stl_raw(&scsiconf->max_target, 0); > + } else { > + stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); > + } > stl_raw(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN); > } > > -- > 1.7.2.5 > > -- > You received this message because you are subscribed to the Google Groups "Linux-iSCSI.org Target Development" group. > To post to this group, send email to linux-iscsi-target-dev at googlegroups.com. > To unsubscribe from this group, send email to linux-iscsi-target-dev+unsubscribe at googlegroups.com. > For more options, visit this group at http://groups.google.com/group/linux-iscsi-target-dev?hl=en. >-- Regards, Zhi Yong Wu
Paolo Bonzini
2012-Jul-12 06:24 UTC
[PATCH] hw/virtio-scsi: Set max_target=0 during vhost-scsi operation
Il 12/07/2012 07:34, Zhi Yong Wu ha scritto:> HI, > > Do we need to maintain one QEMU branch to collect all useful latest > patches for tcm_vhost support? You know, those patches will not get > merged into qemu.git/master.Never say never, but the answer to your question is yes: please apply this patch to your vhost-scsi branch and push it to github. Paolo
Zhi Yong Wu
2012-Jul-12 06:59 UTC
[PATCH] hw/virtio-scsi: Set max_target=0 during vhost-scsi operation
thanks, it is applied to my vhost_scsi git tree git://github.com/mdroth/qemu.git vhost-scsi On Thu, Jul 12, 2012 at 4:55 AM, Nicholas A. Bellinger <nab at linux-iscsi.org> wrote:> From: Nicholas Bellinger <nab at linux-iscsi.org> > > This QEMU patch sets VirtIOSCSIConfig->max_target=0 for vhost-scsi operation > to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID > instance) when connected to individual tcm_vhost endpoints as requested by > Paolo. > > This ensures that virtio-scsi LLD only attempts to scan target IDs up to > VIRTIO_SCSI_MAX_TARGET when connected via virtio-scsi-raw. > > It's currently cut against Zhi's qemu vhost-scsi tree here: > > https://github.com/wuzhy/qemu/tree/vhost-scsi > > Cc: Stefan Hajnoczi <stefanha at linux.vnet.ibm.com> > Cc: Zhi Yong Wu <wuzhy at linux.vnet.ibm.com> > Cc: Paolo Bonzini <pbonzini at redhat.com> > Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org> > --- > hw/virtio-scsi.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c > index e38cdd0..71276b6 100644 > --- a/hw/virtio-scsi.c > +++ b/hw/virtio-scsi.c > @@ -523,7 +523,11 @@ static void virtio_scsi_get_config(VirtIODevice *vdev, > stl_raw(&scsiconf->sense_size, s->sense_size); > stl_raw(&scsiconf->cdb_size, s->cdb_size); > stl_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL); > - stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); > + if (s->vhost_scsi) { > + stl_raw(&scsiconf->max_target, 0); > + } else { > + stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); > + } > stl_raw(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN); > } > > -- > 1.7.2.5 > > -- > You received this message because you are subscribed to the Google Groups "Linux-iSCSI.org Target Development" group. > To post to this group, send email to linux-iscsi-target-dev at googlegroups.com. > To unsubscribe from this group, send email to linux-iscsi-target-dev+unsubscribe at googlegroups.com. > For more options, visit this group at http://groups.google.com/group/linux-iscsi-target-dev?hl=en. >-- Regards, Zhi Yong Wu
Zhi Yong Wu
2012-Jul-12 06:59 UTC
[PATCH] hw/virtio-scsi: Set max_target=0 during vhost-scsi operation
thanks, it is applied to my vhost_scsi git tree git://github.com/wuzhy/qemu.git vhost-scsi On Thu, Jul 12, 2012 at 4:55 AM, Nicholas A. Bellinger <nab at linux-iscsi.org> wrote:> From: Nicholas Bellinger <nab at linux-iscsi.org> > > This QEMU patch sets VirtIOSCSIConfig->max_target=0 for vhost-scsi operation > to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID > instance) when connected to individual tcm_vhost endpoints as requested by > Paolo. > > This ensures that virtio-scsi LLD only attempts to scan target IDs up to > VIRTIO_SCSI_MAX_TARGET when connected via virtio-scsi-raw. > > It's currently cut against Zhi's qemu vhost-scsi tree here: > > https://github.com/wuzhy/qemu/tree/vhost-scsi > > Cc: Stefan Hajnoczi <stefanha at linux.vnet.ibm.com> > Cc: Zhi Yong Wu <wuzhy at linux.vnet.ibm.com> > Cc: Paolo Bonzini <pbonzini at redhat.com> > Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org> > --- > hw/virtio-scsi.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c > index e38cdd0..71276b6 100644 > --- a/hw/virtio-scsi.c > +++ b/hw/virtio-scsi.c > @@ -523,7 +523,11 @@ static void virtio_scsi_get_config(VirtIODevice *vdev, > stl_raw(&scsiconf->sense_size, s->sense_size); > stl_raw(&scsiconf->cdb_size, s->cdb_size); > stl_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL); > - stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); > + if (s->vhost_scsi) { > + stl_raw(&scsiconf->max_target, 0); > + } else { > + stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); > + } > stl_raw(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN); > } > > -- > 1.7.2.5 > > -- > You received this message because you are subscribed to the Google Groups "Linux-iSCSI.org Target Development" group. > To post to this group, send email to linux-iscsi-target-dev at googlegroups.com. > To unsubscribe from this group, send email to linux-iscsi-target-dev+unsubscribe at googlegroups.com. > For more options, visit this group at http://groups.google.com/group/linux-iscsi-target-dev?hl=en. >-- Regards, Zhi Yong Wu
Maybe Matching Threads
- [PATCH] hw/virtio-scsi: Set max_target=0 during vhost-scsi operation
- [PATCH 0/5] vhost-scsi: Add support for host virtualized target
- [PATCH 0/5] vhost-scsi: Add support for host virtualized target
- [RFC-v3 0/5] vhost-scsi: Add support for host virtualized target
- [RFC-v3 0/5] vhost-scsi: Add support for host virtualized target