[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-mode
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional |
Date: |
Thu, 10 Jan 2019 12:35:26 +0400 |
Hi
On Thu, Jan 10, 2019 at 6:05 AM Eduardo Habkost <address@hidden> wrote:
>
> The disable-legacy and disable-modern properties apply only to
> some virtio-pci devices. Make those properties optional.
>
> This fixes the crash introduced by commit f6e501a28ef9 ("virtio: Provide
> version-specific variants of virtio PCI devices"):
>
> $ qemu-system-x86_64 -machine pc-i440fx-2.6 \
> -device virtio-net-pci-non-transitional
> Unexpected error in object_property_find() at qom/object.c:1092:
> qemu-system-x86_64: -device virtio-net-pci-non-transitional: can't apply \
> global virtio-pci.disable-modern=on: Property '.disable-modern' not found
> Aborted (core dumped)
>
> Reported-by: Thomas Huth <address@hidden>
> Fixes: f6e501a28ef9 ("virtio: Provide version-specific variants of virtio PCI
> devices")
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> hw/core/machine.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 5530b71981..a19143aa44 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -91,8 +91,9 @@ const size_t hw_compat_2_7_len =
> G_N_ELEMENTS(hw_compat_2_7);
>
> GlobalProperty hw_compat_2_6[] = {
> { "virtio-mmio", "format_transport_address", "off" },
> - { "virtio-pci", "disable-modern", "on" },
> - { "virtio-pci", "disable-legacy", "off" },
> + /* Optional because not all virtio-pci devices support legacy mode */
> + { "virtio-pci", "disable-modern", "on", .optional = true },
> + { "virtio-pci", "disable-legacy", "off", .optional = true },
Could the generic devices implement a specific interface instead?
virtio-pci-generic?
Adding "optional" handling looks like it may hide some other errors.
> };
> const size_t hw_compat_2_6_len = G_N_ELEMENTS(hw_compat_2_6);
>
> --
> 2.18.0.rc1.1.g3f1ff2140
>
>
--
Marc-André Lureau
- [Qemu-devel] [PATCH v2 0/3] Fix virtio-*(-non)-transitional crash on 2.6 machine-types, Eduardo Habkost, 2019/01/09
- [Qemu-devel] [PATCH v2 1/3] qom: Don't keep error value between object_property_parse() calls, Eduardo Habkost, 2019/01/09
- [Qemu-devel] [PATCH v2 2/3] globals: Allow global properties to be optional, Eduardo Habkost, 2019/01/09
- [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional, Eduardo Habkost, 2019/01/09
- Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional,
Marc-André Lureau <=
- Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional, Dr. David Alan Gilbert, 2019/01/10
- Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional, Eduardo Habkost, 2019/01/10
- Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional, Michael S. Tsirkin, 2019/01/10
- Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional, Dr. David Alan Gilbert, 2019/01/10
- Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional, Eduardo Habkost, 2019/01/10
- Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional, Marc-André Lureau, 2019/01/10
- Re: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional, Cornelia Huck, 2019/01/11