From cbac773c0218dc23f2c434f2d04e3e3cc1d081a9 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 16 Jan 2019 23:18:19 +0000 Subject: [PATCH 4/7] virtio: Make disable-legacy/disable-modern compat properties optional RH-Author: Eduardo Habkost Message-id: <20190116231819.29310-5-ehabkost@redhat.com> Patchwork-id: 84030 O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 4/4] virtio: Make disable-legacy/disable-modern compat properties optional Bugzilla: 1648023 RH-Acked-by: Cornelia Huck RH-Acked-by: Thomas Huth RH-Acked-by: Laurent Vivier RH-Acked-by: Michael S. Tsirkin Upstream tree: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git Upstream commit: 53921bfdce3f8fffcc22338633855247fb7b7a74 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) Backport notes: HW_COMPAT_RHEL7_2 (include/hw/compat.h) being patched instead of hw_compat_2_6 (hw/core/machine.c). Our downstream tree doesn't have the equivalent of commit ff8f261f113b ("compat: replace PC_COMPAT_2_6 & HW_COMPAT_2_6 macros") Reported-by: Thomas Huth Fixes: f6e501a28ef9 ("virtio: Provide version-specific variants of virtio PCI devices") Signed-off-by: Eduardo Habkost Reviewed-by: Cornelia Huck Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 1b0ba10643110f9590c0da0167d0cb1db48ca2e4) Signed-off-by: Eduardo Habkost Signed-off-by: Danilo C. L. de Paula --- include/hw/compat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hw/compat.h b/include/hw/compat.h index 40db243..aeb2f73 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -380,10 +380,14 @@ .driver = "virtio-pci",\ .property = "disable-modern",\ .value = "on",\ + /* Optional because not all virtio-pci devices support legacy mode */ \ + .optional = true,\ },{ /* HW_COMPAT_RHEL7_2 */ \ .driver = "virtio-pci",\ .property = "disable-legacy",\ .value = "off",\ + /* Optional because not all virtio-pci devices support legacy mode */ \ + .optional = true,\ },{ /* HW_COMPAT_RHEL7_2 */ \ .driver = TYPE_PCI_DEVICE,\ .property = "x-pcie-lnksta-dllla",\ -- 1.8.3.1