qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] vhost-scsi: support VIRTIO_SCSI_F_HOTPLUG
@ 2025-02-03  0:52 Dongli Zhang
  2025-02-11 16:26 ` Stefano Garzarella
  0 siblings, 1 reply; 3+ messages in thread
From: Dongli Zhang @ 2025-02-03  0:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, fam, mst, sgarzare

So far there isn't way to test host kernel vhost-scsi event queue path,
because VIRTIO_SCSI_F_HOTPLUG isn't supported by QEMU.

virtio-scsi.c and vhost-user-scsi.c already support VIRTIO_SCSI_F_HOTPLUG
as property "hotplug".

Add support to vhost-scsi.c to help evaluate and test event queue.

To test the feature:

1. Create vhost-scsi target with targetcli.

targetcli /backstores/fileio create name=storage file_or_dev=disk01.raw
targetcli /vhost create naa.1123451234512345
targetcli /vhost/naa.1123451234512345/tpg1/luns create /backstores/fileio/storage

2. Create QEMU instance with vhost-scsi.

-device vhost-scsi-pci,wwpn=naa.1123451234512345,hotplug=true

3. Once guest bootup, hotplug a new LUN from host.

targetcli /backstores/fileio create name=storage02 file_or_dev=disk02.raw
targetcli /vhost/naa.1123451234512345/tpg1/luns create /backstores/fileio/storage02

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 hw/scsi/vhost-scsi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 8039d13fd9..d3a260f6a7 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -359,6 +359,9 @@ static const Property vhost_scsi_properties[] = {
     DEFINE_PROP_BIT64("t10_pi", VHostSCSICommon, host_features,
                                                  VIRTIO_SCSI_F_T10_PI,
                                                  false),
+    DEFINE_PROP_BIT64("hotplug", VHostSCSICommon, host_features,
+                                                  VIRTIO_SCSI_F_HOTPLUG,
+                                                  false),
     DEFINE_PROP_BOOL("migratable", VHostSCSICommon, migratable, false),
     DEFINE_PROP_BOOL("worker_per_virtqueue", VirtIOSCSICommon,
                      conf.worker_per_virtqueue, false),
-- 
2.39.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] vhost-scsi: support VIRTIO_SCSI_F_HOTPLUG
  2025-02-03  0:52 [PATCH 1/1] vhost-scsi: support VIRTIO_SCSI_F_HOTPLUG Dongli Zhang
@ 2025-02-11 16:26 ` Stefano Garzarella
  2025-04-16 22:40   ` Dongli Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Garzarella @ 2025-02-11 16:26 UTC (permalink / raw)
  To: Dongli Zhang; +Cc: qemu-devel, pbonzini, fam, mst

On Sun, Feb 02, 2025 at 04:52:15PM -0800, Dongli Zhang wrote:
>So far there isn't way to test host kernel vhost-scsi event queue path,
>because VIRTIO_SCSI_F_HOTPLUG isn't supported by QEMU.
>
>virtio-scsi.c and vhost-user-scsi.c already support VIRTIO_SCSI_F_HOTPLUG
>as property "hotplug".
>
>Add support to vhost-scsi.c to help evaluate and test event queue.
>
>To test the feature:
>
>1. Create vhost-scsi target with targetcli.
>
>targetcli /backstores/fileio create name=storage file_or_dev=disk01.raw
>targetcli /vhost create naa.1123451234512345
>targetcli /vhost/naa.1123451234512345/tpg1/luns create /backstores/fileio/storage
>
>2. Create QEMU instance with vhost-scsi.
>
>-device vhost-scsi-pci,wwpn=naa.1123451234512345,hotplug=true
>
>3. Once guest bootup, hotplug a new LUN from host.
>
>targetcli /backstores/fileio create name=storage02 file_or_dev=disk02.raw
>targetcli /vhost/naa.1123451234512345/tpg1/luns create /backstores/fileio/storage02
>
>Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
>---
> hw/scsi/vhost-scsi.c | 3 +++
> 1 file changed, 3 insertions(+)

LGTM:

Acked-by: Stefano Garzarella <sgarzare@redhat.com>


>
>diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
>index 8039d13fd9..d3a260f6a7 100644
>--- a/hw/scsi/vhost-scsi.c
>+++ b/hw/scsi/vhost-scsi.c
>@@ -359,6 +359,9 @@ static const Property vhost_scsi_properties[] = {
>     DEFINE_PROP_BIT64("t10_pi", VHostSCSICommon, host_features,
>                                                  VIRTIO_SCSI_F_T10_PI,
>                                                  false),
>+    DEFINE_PROP_BIT64("hotplug", VHostSCSICommon, host_features,
>+                                                  VIRTIO_SCSI_F_HOTPLUG,
>+                                                  false),
>     DEFINE_PROP_BOOL("migratable", VHostSCSICommon, migratable, false),
>     DEFINE_PROP_BOOL("worker_per_virtqueue", VirtIOSCSICommon,
>                      conf.worker_per_virtqueue, false),
>-- 
>2.39.3
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] vhost-scsi: support VIRTIO_SCSI_F_HOTPLUG
  2025-02-11 16:26 ` Stefano Garzarella
@ 2025-04-16 22:40   ` Dongli Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Dongli Zhang @ 2025-04-16 22:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, fam, mst, Stefano Garzarella

Ping?

Any chance to accept this property? It is acked by Stefano Garzarella.

It helped me test vhost-scsi event queue and live migration recently.

https://lore.kernel.org/all/20250403063028.16045-9-dongli.zhang@oracle.com/

Thank you very much!

Dongli Zhang

On 2/11/25 8:26 AM, Stefano Garzarella wrote:
> On Sun, Feb 02, 2025 at 04:52:15PM -0800, Dongli Zhang wrote:
>> So far there isn't way to test host kernel vhost-scsi event queue path,
>> because VIRTIO_SCSI_F_HOTPLUG isn't supported by QEMU.
>>
>> virtio-scsi.c and vhost-user-scsi.c already support VIRTIO_SCSI_F_HOTPLUG
>> as property "hotplug".
>>
>> Add support to vhost-scsi.c to help evaluate and test event queue.
>>
>> To test the feature:
>>
>> 1. Create vhost-scsi target with targetcli.
>>
>> targetcli /backstores/fileio create name=storage file_or_dev=disk01.raw
>> targetcli /vhost create naa.1123451234512345
>> targetcli /vhost/naa.1123451234512345/tpg1/luns create /backstores/fileio/storage
>>
>> 2. Create QEMU instance with vhost-scsi.
>>
>> -device vhost-scsi-pci,wwpn=naa.1123451234512345,hotplug=true
>>
>> 3. Once guest bootup, hotplug a new LUN from host.
>>
>> targetcli /backstores/fileio create name=storage02 file_or_dev=disk02.raw
>> targetcli /vhost/naa.1123451234512345/tpg1/luns create /backstores/fileio/
>> storage02
>>
>> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
>> ---
>> hw/scsi/vhost-scsi.c | 3 +++
>> 1 file changed, 3 insertions(+)
> 
> LGTM:
> 
> Acked-by: Stefano Garzarella <sgarzare@redhat.com>
> 
> 
>>
>> diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
>> index 8039d13fd9..d3a260f6a7 100644
>> --- a/hw/scsi/vhost-scsi.c
>> +++ b/hw/scsi/vhost-scsi.c
>> @@ -359,6 +359,9 @@ static const Property vhost_scsi_properties[] = {
>>     DEFINE_PROP_BIT64("t10_pi", VHostSCSICommon, host_features,
>>                                                  VIRTIO_SCSI_F_T10_PI,
>>                                                  false),
>> +    DEFINE_PROP_BIT64("hotplug", VHostSCSICommon, host_features,
>> +                                                  VIRTIO_SCSI_F_HOTPLUG,
>> +                                                  false),
>>     DEFINE_PROP_BOOL("migratable", VHostSCSICommon, migratable, false),
>>     DEFINE_PROP_BOOL("worker_per_virtqueue", VirtIOSCSICommon,
>>                      conf.worker_per_virtqueue, false),
>> -- 
>> 2.39.3
>>
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-16 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03  0:52 [PATCH 1/1] vhost-scsi: support VIRTIO_SCSI_F_HOTPLUG Dongli Zhang
2025-02-11 16:26 ` Stefano Garzarella
2025-04-16 22:40   ` Dongli Zhang

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).