All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host
@ 2020-02-07  0:14 Philippe Mathieu-Daudé
  2020-02-07  6:31 ` Michael S. Tsirkin
  2020-02-07 16:49 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-07  0:14 UTC (permalink / raw)
  To: qemu-devel, Michael S. Tsirkin
  Cc: Cornelia Huck, Philippe Mathieu-Daudé, Eduardo Habkost

Commit ed65fd1a2750 ("virtio-blk: switch off scsi-passthrough by
default") changed the default value of the 'scsi' property of
virtio-blk, which is only available on Linux hosts. It also added
an unconditional compat entry for 2.4 or earlier machines.

Trying to set this property on a pre-2.5 machine on OSX, we get:

   Unexpected error in object_property_find() at qom/object.c:1201:
   qemu-system-x86_64: -device virtio-blk-pci,id=scsi0,drive=drive0: can't apply global virtio-blk-device.scsi=true: Property '.scsi' not found

Fix this error by marking the property optional.

Fixes: ed65fd1a27 ("virtio-blk: switch off scsi-passthrough by default")
Suggested-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: Reworded description (Cornelia)

Extracted from testing series:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg675074.html
---
 hw/core/machine.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 3e288bfceb..d8e30e4895 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -148,7 +148,8 @@ GlobalProperty hw_compat_2_5[] = {
 const size_t hw_compat_2_5_len = G_N_ELEMENTS(hw_compat_2_5);
 
 GlobalProperty hw_compat_2_4[] = {
-    { "virtio-blk-device", "scsi", "true" },
+    /* Optional because the 'scsi' property is Linux-only */
+    { "virtio-blk-device", "scsi", "true", .optional = true },
     { "e1000", "extra_mac_registers", "off" },
     { "virtio-pci", "x-disable-pcie", "on" },
     { "virtio-pci", "migrate-extra", "off" },
-- 
2.21.1



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

* Re: [PATCH v2] hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host
  2020-02-07  0:14 [PATCH v2] hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host Philippe Mathieu-Daudé
@ 2020-02-07  6:31 ` Michael S. Tsirkin
  2020-02-07 16:49 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2020-02-07  6:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Cornelia Huck, stefanha, qemu-devel, Eduardo Habkost

On Fri, Feb 07, 2020 at 01:14:04AM +0100, Philippe Mathieu-Daudé wrote:
> Commit ed65fd1a2750 ("virtio-blk: switch off scsi-passthrough by
> default") changed the default value of the 'scsi' property of
> virtio-blk, which is only available on Linux hosts. It also added
> an unconditional compat entry for 2.4 or earlier machines.
> 
> Trying to set this property on a pre-2.5 machine on OSX, we get:
> 
>    Unexpected error in object_property_find() at qom/object.c:1201:
>    qemu-system-x86_64: -device virtio-blk-pci,id=scsi0,drive=drive0: can't apply global virtio-blk-device.scsi=true: Property '.scsi' not found
> 
> Fix this error by marking the property optional.
> 
> Fixes: ed65fd1a27 ("virtio-blk: switch off scsi-passthrough by default")
> Suggested-by: Cornelia Huck <cohuck@redhat.com>
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

Stefan I think this makes sense in your tree same as
the original patch it's fixing. Right?

> ---
> v2: Reworded description (Cornelia)
> 
> Extracted from testing series:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg675074.html
> ---
>  hw/core/machine.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 3e288bfceb..d8e30e4895 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -148,7 +148,8 @@ GlobalProperty hw_compat_2_5[] = {
>  const size_t hw_compat_2_5_len = G_N_ELEMENTS(hw_compat_2_5);
>  
>  GlobalProperty hw_compat_2_4[] = {
> -    { "virtio-blk-device", "scsi", "true" },
> +    /* Optional because the 'scsi' property is Linux-only */
> +    { "virtio-blk-device", "scsi", "true", .optional = true },
>      { "e1000", "extra_mac_registers", "off" },
>      { "virtio-pci", "x-disable-pcie", "on" },
>      { "virtio-pci", "migrate-extra", "off" },
> -- 
> 2.21.1



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

* Re: [PATCH v2] hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host
  2020-02-07  0:14 [PATCH v2] hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host Philippe Mathieu-Daudé
  2020-02-07  6:31 ` Michael S. Tsirkin
@ 2020-02-07 16:49 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2020-02-07 16:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Cornelia Huck, qemu-devel, Eduardo Habkost, Michael S. Tsirkin

[-- Attachment #1: Type: text/plain, Size: 1265 bytes --]

On Fri, Feb 07, 2020 at 01:14:04AM +0100, Philippe Mathieu-Daudé wrote:
> Commit ed65fd1a2750 ("virtio-blk: switch off scsi-passthrough by
> default") changed the default value of the 'scsi' property of
> virtio-blk, which is only available on Linux hosts. It also added
> an unconditional compat entry for 2.4 or earlier machines.
> 
> Trying to set this property on a pre-2.5 machine on OSX, we get:
> 
>    Unexpected error in object_property_find() at qom/object.c:1201:
>    qemu-system-x86_64: -device virtio-blk-pci,id=scsi0,drive=drive0: can't apply global virtio-blk-device.scsi=true: Property '.scsi' not found
> 
> Fix this error by marking the property optional.
> 
> Fixes: ed65fd1a27 ("virtio-blk: switch off scsi-passthrough by default")
> Suggested-by: Cornelia Huck <cohuck@redhat.com>
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2: Reworded description (Cornelia)
> 
> Extracted from testing series:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg675074.html
> ---
>  hw/core/machine.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2020-02-07 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07  0:14 [PATCH v2] hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host Philippe Mathieu-Daudé
2020-02-07  6:31 ` Michael S. Tsirkin
2020-02-07 16:49 ` Stefan Hajnoczi

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.