Skip to contentSkip to conversation

hw/virtio-scsi: Set max_target=0 during vhost-scsi operation

PATCH In review Nicholas A. Bellinger 3 participants 12 messages Jul 11, 2012 – Jul 16, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/virtio-scsi: Set max_target=0 during vhost-scsi operation

From: Nicholas Bellinger <[email protected]>

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 <[email protected]>
Cc Zhi Yong Wu <[email protected]>
Cc Paolo Bonzini <[email protected]>
---
 hw/virtio-scsi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
hw/virtio-scsi.c +5 -1
index e38cdd0..71276b6 100644
@@ -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);
 }
 
Signature · 1 line
1.7.2.5
#1 lore raw

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.

Quoted 48 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

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 <[email protected]>
Cc Zhi Yong Wu <[email protected]>
Cc Paolo Bonzini <[email protected]>
---
 hw/virtio-scsi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
hw/virtio-scsi.c +5 -2
index e38cdd0..71276b6 100644
@@ -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 [email protected].
To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/linux-iscsi-target-dev?hl=en.

Signature · 3 lines
Regards,

Zhi Yong Wu
maintainer
#2 lore raw

Il 12/07/2012 07:34, Zhi Yong Wu ha scritto:

Quoted 5 lines

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

maintainer
#3 lore raw
In reply to Zhi Yong Wu

Il 12/07/2012 07:34, Zhi Yong Wu ha scritto:

Quoted 5 lines

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

#4 lore raw
In reply to Nicholas A. Bellinger

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.

Quoted 48 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

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 <[email protected]>
Cc Zhi Yong Wu <[email protected]>
Cc Paolo Bonzini <[email protected]>
---
 hw/virtio-scsi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
hw/virtio-scsi.c +5 -2
index e38cdd0..71276b6 100644
@@ -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 [email protected].
To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/linux-iscsi-target-dev?hl=en.

Signature · 3 lines
Regards,

Zhi Yong Wu
#5 lore raw
In reply to Nicholas A. Bellinger

thanks, it is applied to my vhost_scsi git tree
git://github.com/mdroth/qemu.git vhost-scsi

Quoted 48 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

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 <[email protected]>
Cc Zhi Yong Wu <[email protected]>
Cc Paolo Bonzini <[email protected]>
---
 hw/virtio-scsi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
hw/virtio-scsi.c +5 -2
index e38cdd0..71276b6 100644
@@ -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 [email protected].
To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/linux-iscsi-target-dev?hl=en.

Signature · 3 lines
Regards,

Zhi Yong Wu
#6 lore raw
In reply to Nicholas A. Bellinger

thanks, it is applied to my vhost_scsi git tree
git://github.com/wuzhy/qemu.git vhost-scsi

Quoted 48 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

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 <[email protected]>
Cc Zhi Yong Wu <[email protected]>
Cc Paolo Bonzini <[email protected]>
---
 hw/virtio-scsi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
hw/virtio-scsi.c +5 -2
index e38cdd0..71276b6 100644
@@ -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 [email protected].
To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/linux-iscsi-target-dev?hl=en.

Signature · 3 lines
Regards,

Zhi Yong Wu
#7 lore raw

Hi Zhi,

Quoted 3 lines · Zhi Yong Wu

thanks, it is applied to my vhost_scsi git tree
git://github.com/wuzhy/qemu.git vhost-scsi

Thanks for picking up this patch in your vhost-scsi tree.

As mentioned off-list, I'd like to rebase to a more recent qemu.git to include megasas 8708EM2 HBA emulation from Dr. Hannes so we can experiment with a few more types of target setups. ;)

I'll likely do this on my local branch for now, but if you have the extra cycles please feel free to update vhost-scsi to the latest qemu.git HEAD so we can have both vhost-scsi + megasas HBA emulation in the same working tree.

Depending upon how long we'll need to hold vhost-scsi patches out-of-tree (hopefully it's less than infinity ;) a qemu/vhost-scsi working tree on kernel.org might also be helpful.

Thanks!

--nab

#8 lore raw
In reply to Zhi Yong Wu

Hi Zhi,

Quoted 3 lines · Zhi Yong Wu

thanks, it is applied to my vhost_scsi git tree
git://github.com/wuzhy/qemu.git vhost-scsi

Thanks for picking up this patch in your vhost-scsi tree.

As mentioned off-list, I'd like to rebase to a more recent qemu.git to include megasas 8708EM2 HBA emulation from Dr. Hannes so we can experiment with a few more types of target setups. ;)

I'll likely do this on my local branch for now, but if you have the extra cycles please feel free to update vhost-scsi to the latest qemu.git HEAD so we can have both vhost-scsi + megasas HBA emulation in the same working tree.

Depending upon how long we'll need to hold vhost-scsi patches out-of-tree (hopefully it's less than infinity ;) a qemu/vhost-scsi working tree on kernel.org might also be helpful.

Thanks!

--nab

#9 lore raw

HI, nab,

Quoted 7 lines · Nicholas A. Bellinger

Hi Zhi,

Quoted 3 lines · Zhi Yong Wu

thanks, it is applied to my vhost_scsi git tree
git://github.com/wuzhy/qemu.git vhost-scsi

Quoted 5 lines

Thanks for picking up this patch in your vhost-scsi tree.

As mentioned off-list, I'd like to rebase to a more recent qemu.git to include megasas 8708EM2 HBA emulation from Dr. Hannes so we can experiment with a few more types of target setups. ;)

I have rebased my vhost-scsi tree to latest qemu.git.

Quoted 5 lines

I'll likely do this on my local branch for now, but if you have the extra cycles please feel free to update vhost-scsi to the latest qemu.git HEAD so we can have both vhost-scsi + megasas HBA emulation in the same working tree.

I have push rebased vhost-scsi tree to my public git.

Quoted 3 lines

Depending upon how long we'll need to hold vhost-scsi patches out-of-tree (hopefully it's less than infinity ;) a qemu/vhost-scsi

Heh, i also hope so, but have not anthority to push it to kernel.org.

Quoted 8 lines

working tree on kernel.org might also be helpful.

Thanks!

--nab

Signature · 3 lines
Regards,

Zhi Yong Wu
#10 lore raw
In reply to Nicholas A. Bellinger

HI, nab,

Quoted 7 lines · Nicholas A. Bellinger

Hi Zhi,

Quoted 3 lines · Zhi Yong Wu

thanks, it is applied to my vhost_scsi git tree
git://github.com/wuzhy/qemu.git vhost-scsi

Quoted 5 lines

Thanks for picking up this patch in your vhost-scsi tree.

As mentioned off-list, I'd like to rebase to a more recent qemu.git to include megasas 8708EM2 HBA emulation from Dr. Hannes so we can experiment with a few more types of target setups. ;)

I have rebased my vhost-scsi tree to latest qemu.git.

Quoted 5 lines

I'll likely do this on my local branch for now, but if you have the extra cycles please feel free to update vhost-scsi to the latest qemu.git HEAD so we can have both vhost-scsi + megasas HBA emulation in the same working tree.

I have push rebased vhost-scsi tree to my public git.

Quoted 3 lines

Depending upon how long we'll need to hold vhost-scsi patches out-of-tree (hopefully it's less than infinity ;) a qemu/vhost-scsi

Heh, i also hope so, but have not anthority to push it to kernel.org.

Quoted 8 lines

working tree on kernel.org might also be helpful.

Thanks!

--nab

Signature · 3 lines
Regards,

Zhi Yong Wu
#11 lore raw
In reply to Nicholas A. Bellinger

thanks, it is applied to my vhost_scsi git tree
git://github.com/wuzhy/qemu.git vhost-scsi

Quoted 48 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

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 <[email protected]>
Cc Zhi Yong Wu <[email protected]>
Cc Paolo Bonzini <[email protected]>
---
 hw/virtio-scsi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
hw/virtio-scsi.c +5 -2
index e38cdd0..71276b6 100644
@@ -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 [email protected].
To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/linux-iscsi-target-dev?hl=en.

Signature · 3 lines
Regards,

Zhi Yong Wu