* [PATCH] hw: Fix crash that happens when introspecting scsi-block on older machine types
@ 2024-07-03 9:09 Thomas Huth
2024-07-03 9:28 ` Philippe Mathieu-Daudé
2024-07-03 9:30 ` Yong Huang
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2024-07-03 9:09 UTC (permalink / raw)
To: qemu-devel, Paolo Bonzini, yong.huang
Cc: qemu-trivial, Fam Zheng, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang
"make check SPEED=slow" is currently failing the device-introspect-test on
older machine types since introspecting "scsi-block" is causing an abort:
$ ./qemu-system-x86_64 -M pc-q35-8.0 -monitor stdio
QEMU 9.0.50 monitor - type 'help' for more information
(qemu) device_add scsi-block,help
Unexpected error in object_property_find_err() at
../../devel/qemu/qom/object.c:1357:
can't apply global scsi-disk-base.migrate-emulated-scsi-request=false:
Property 'scsi-block.migrate-emulated-scsi-request' not found
Aborted (core dumped)
The problem is that the compat code tries to change the
"migrate-emulated-scsi-request" property for all devices that are
derived from "scsi-block", but the property has only been added
to "scsi-hd" and "scsi-cd" via the DEFINE_SCSI_DISK_PROPERTIES macro.
Thus let's fix the problem by only changing the property on the devices
that really have this property.
Fixes: b4912afa5f ("scsi-disk: Fix crash for VM configured with USB CDROM after live migration")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
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 655d75c21f..60858a8565 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -36,7 +36,8 @@
GlobalProperty hw_compat_9_0[] = {
{"arm-cpu", "backcompat-cntfrq", "true" },
- {"scsi-disk-base", "migrate-emulated-scsi-request", "false" },
+ {"scsi-hd", "migrate-emulated-scsi-request", "false" },
+ {"scsi-cd", "migrate-emulated-scsi-request", "false" },
{"vfio-pci", "skip-vsc-check", "false" },
};
const size_t hw_compat_9_0_len = G_N_ELEMENTS(hw_compat_9_0);
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw: Fix crash that happens when introspecting scsi-block on older machine types
2024-07-03 9:09 [PATCH] hw: Fix crash that happens when introspecting scsi-block on older machine types Thomas Huth
@ 2024-07-03 9:28 ` Philippe Mathieu-Daudé
2024-07-03 9:30 ` Yong Huang
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-07-03 9:28 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, Paolo Bonzini, yong.huang
Cc: qemu-trivial, Fam Zheng, Eduardo Habkost, Marcel Apfelbaum,
Yanan Wang
On 3/7/24 11:09, Thomas Huth wrote:
> "make check SPEED=slow" is currently failing the device-introspect-test on
> older machine types since introspecting "scsi-block" is causing an abort:
>
> $ ./qemu-system-x86_64 -M pc-q35-8.0 -monitor stdio
> QEMU 9.0.50 monitor - type 'help' for more information
> (qemu) device_add scsi-block,help
> Unexpected error in object_property_find_err() at
> ../../devel/qemu/qom/object.c:1357:
> can't apply global scsi-disk-base.migrate-emulated-scsi-request=false:
> Property 'scsi-block.migrate-emulated-scsi-request' not found
> Aborted (core dumped)
>
> The problem is that the compat code tries to change the
> "migrate-emulated-scsi-request" property for all devices that are
> derived from "scsi-block", but the property has only been added
> to "scsi-hd" and "scsi-cd" via the DEFINE_SCSI_DISK_PROPERTIES macro.
>
> Thus let's fix the problem by only changing the property on the devices
> that really have this property.
>
> Fixes: b4912afa5f ("scsi-disk: Fix crash for VM configured with USB CDROM after live migration")
(FTR this commit was not reviewed).
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/core/machine.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw: Fix crash that happens when introspecting scsi-block on older machine types
2024-07-03 9:09 [PATCH] hw: Fix crash that happens when introspecting scsi-block on older machine types Thomas Huth
2024-07-03 9:28 ` Philippe Mathieu-Daudé
@ 2024-07-03 9:30 ` Yong Huang
1 sibling, 0 replies; 3+ messages in thread
From: Yong Huang @ 2024-07-03 9:30 UTC (permalink / raw)
To: Thomas Huth
Cc: qemu-devel, Paolo Bonzini, qemu-trivial, Fam Zheng,
Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang
[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]
On Wed, Jul 3, 2024 at 5:09 PM Thomas Huth <thuth@redhat.com> wrote:
> "make check SPEED=slow" is currently failing the device-introspect-test on
> older machine types since introspecting "scsi-block" is causing an abort:
>
> $ ./qemu-system-x86_64 -M pc-q35-8.0 -monitor stdio
> QEMU 9.0.50 monitor - type 'help' for more information
> (qemu) device_add scsi-block,help
> Unexpected error in object_property_find_err() at
> ../../devel/qemu/qom/object.c:1357:
> can't apply global scsi-disk-base.migrate-emulated-scsi-request=false:
> Property 'scsi-block.migrate-emulated-scsi-request' not found
> Aborted (core dumped)
>
> The problem is that the compat code tries to change the
> "migrate-emulated-scsi-request" property for all devices that are
> derived from "scsi-block", but the property has only been added
> to "scsi-hd" and "scsi-cd" via the DEFINE_SCSI_DISK_PROPERTIES macro.
>
> Thus let's fix the problem by only changing the property on the devices
> that really have this property.
>
Thanks for the fix.
> Fixes: b4912afa5f ("scsi-disk: Fix crash for VM configured with USB CDROM
> after live migration")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> 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 655d75c21f..60858a8565 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -36,7 +36,8 @@
>
> GlobalProperty hw_compat_9_0[] = {
> {"arm-cpu", "backcompat-cntfrq", "true" },
> - {"scsi-disk-base", "migrate-emulated-scsi-request", "false" },
> + {"scsi-hd", "migrate-emulated-scsi-request", "false" },
> + {"scsi-cd", "migrate-emulated-scsi-request", "false" },
> {"vfio-pci", "skip-vsc-check", "false" },
> };
> const size_t hw_compat_9_0_len = G_N_ELEMENTS(hw_compat_9_0);
> --
> 2.45.2
>
Acked-by: Hyman Huang <yong.huang@smartx.com>
--
Best regards
[-- Attachment #2: Type: text/html, Size: 3656 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-03 9:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 9:09 [PATCH] hw: Fix crash that happens when introspecting scsi-block on older machine types Thomas Huth
2024-07-03 9:28 ` Philippe Mathieu-Daudé
2024-07-03 9:30 ` Yong Huang
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).