[PATCH v2 2/2] scsi-disk: Advertise FUA support by default

Alberto Faria posted 2 patches 7 months, 1 week ago
Maintainers: Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>
There is a newer version of this series
[PATCH v2 2/2] scsi-disk: Advertise FUA support by default
Posted by Alberto Faria 7 months, 1 week ago
Allow the guest to submit FUA requests directly, instead of forcing it
to emulate them using a regular flush.

Signed-off-by: Alberto Faria <afaria@redhat.com>
---
 hw/core/machine.c   | 1 +
 hw/scsi/scsi-disk.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 63c6ef93d2..e4e6474a4e 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -46,6 +46,7 @@ GlobalProperty hw_compat_9_2[] = {
     { "migration", "multifd-clean-tls-termination", "false" },
     { "migration", "send-switchover-start", "off"},
     { "vfio-pci", "x-migration-multifd-transfer", "off" },
+    { "scsi-disk", "dpofua", "off" },
 };
 const size_t hw_compat_9_2_len = G_N_ELEMENTS(hw_compat_9_2);
 
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index f62dcded64..2f62f6069d 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -3192,7 +3192,7 @@ static const Property scsi_hd_properties[] = {
     DEFINE_PROP_BIT("removable", SCSIDiskState, features,
                     SCSI_DISK_F_REMOVABLE, false),
     DEFINE_PROP_BIT("dpofua", SCSIDiskState, features,
-                    SCSI_DISK_F_DPOFUA, false),
+                    SCSI_DISK_F_DPOFUA, true),
     DEFINE_PROP_UINT64("wwn", SCSIDiskState, qdev.wwn, 0),
     DEFINE_PROP_UINT64("port_wwn", SCSIDiskState, qdev.port_wwn, 0),
     DEFINE_PROP_UINT16("port_index", SCSIDiskState, port_index, 0),
-- 
2.49.0
Re: [PATCH v2 2/2] scsi-disk: Advertise FUA support by default
Posted by Kevin Wolf 6 months, 3 weeks ago
Am 11.04.2025 um 13:30 hat Alberto Faria geschrieben:
> Allow the guest to submit FUA requests directly, instead of forcing it
> to emulate them using a regular flush.
> 
> Signed-off-by: Alberto Faria <afaria@redhat.com>
> ---
>  hw/core/machine.c   | 1 +
>  hw/scsi/scsi-disk.c | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 63c6ef93d2..e4e6474a4e 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -46,6 +46,7 @@ GlobalProperty hw_compat_9_2[] = {
>      { "migration", "multifd-clean-tls-termination", "false" },
>      { "migration", "send-switchover-start", "off"},
>      { "vfio-pci", "x-migration-multifd-transfer", "off" },
> +    { "scsi-disk", "dpofua", "off" },
>  };
>  const size_t hw_compat_9_2_len = G_N_ELEMENTS(hw_compat_9_2);

This needs to go to hw_compat_10_0 now.

And shouldn't it be "scsi-hd" rather than "scsi-disk"? Did you test that
the property is disabled when you use an older machine type?

Kevin
Re: [PATCH v2 2/2] scsi-disk: Advertise FUA support by default
Posted by Alberto Faria 6 months, 2 weeks ago
On Fri, Apr 25, 2025 at 4:05 PM Kevin Wolf <kwolf@redhat.com> wrote:
>
> Am 11.04.2025 um 13:30 hat Alberto Faria geschrieben:
> > Allow the guest to submit FUA requests directly, instead of forcing it
> > to emulate them using a regular flush.
> >
> > Signed-off-by: Alberto Faria <afaria@redhat.com>
> > ---
> >  hw/core/machine.c   | 1 +
> >  hw/scsi/scsi-disk.c | 2 +-
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/core/machine.c b/hw/core/machine.c
> > index 63c6ef93d2..e4e6474a4e 100644
> > --- a/hw/core/machine.c
> > +++ b/hw/core/machine.c
> > @@ -46,6 +46,7 @@ GlobalProperty hw_compat_9_2[] = {
> >      { "migration", "multifd-clean-tls-termination", "false" },
> >      { "migration", "send-switchover-start", "off"},
> >      { "vfio-pci", "x-migration-multifd-transfer", "off" },
> > +    { "scsi-disk", "dpofua", "off" },
> >  };
> >  const size_t hw_compat_9_2_len = G_N_ELEMENTS(hw_compat_9_2);
>
> This needs to go to hw_compat_10_0 now.
>
> And shouldn't it be "scsi-hd" rather than "scsi-disk"? Did you test that
> the property is disabled when you use an older machine type?

Sorry about that, fixed in v3.

> Kevin
>