From nobody Mon May 6 16:33:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=listsout.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from listsout.gnu.org (listsout.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1546572212388988.4414265137707; Thu, 3 Jan 2019 19:23:32 -0800 (PST) Received: from localhost ([127.0.0.1]:59406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfG50-0005t3-2r for importer@patchew.org; Thu, 03 Jan 2019 22:23:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfG4C-0005OE-8j for qemu-devel@nongnu.org; Thu, 03 Jan 2019 22:22:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfG48-0007y0-7p for qemu-devel@nongnu.org; Thu, 03 Jan 2019 22:22:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49584) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfG48-0007xX-0L for qemu-devel@nongnu.org; Thu, 03 Jan 2019 22:22:32 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 63787C070E05 for ; Fri, 4 Jan 2019 03:22:31 +0000 (UTC) Received: from localhost (ovpn-116-79.gru2.redhat.com [10.97.116.79]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3185F5C224; Fri, 4 Jan 2019 03:22:28 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 4 Jan 2019 01:22:26 -0200 Message-Id: <20190104032226.21428-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 04 Jan 2019 03:22:31 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] compat: Use explicit type names on HW_COMPAT_2_6 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Cornelia Huck , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The virtio-pci entries in HW_COMPAT_2_6 had an implicit assumption: that all virtio-pci subclasses support the disable-legacy and disable-modern options. That assumption was broken by commit f6e501a28ef9 ("virtio: Provide version-specific variants of virtio PCI devices"). This caused QEMU to crash if using the new -non-transitional or -transitional device types: $ 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=3Don: Property '.disable-modern' not fou= nd Aborted (core dumped) Replace the virtio-pci.disable-legacy=3Doff and virtio-pci.disable-modern=3Don entries on HW_COMPAT_2_6 with explicit entries for each generic virtio device type. The full list of generic virtio device types was extracted by just grepping for ".generic_name". Note that we don't need to worry about listing new virtio-pci devices in HW_COMPAT_2_6 in the future, because new devices won't require QEMU 2.6 compatibility. This makes the compat entries annoyingly verbose, but is simpler than the alternative of making the virtio-pci type inheritance rules even more complex. Reported-by: Thomas Huth Signed-off-by: Eduardo Habkost Reviewed-by: Cornelia Huck --- --- include/hw/compat.h | 140 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 138 insertions(+), 2 deletions(-) diff --git a/include/hw/compat.h b/include/hw/compat.h index 3ca85b037c..fbb6c1138a 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -163,11 +163,147 @@ .property =3D "format_transport_address",\ .value =3D "off",\ },{\ - .driver =3D "virtio-pci",\ + .driver =3D "vhost-scsi-pci",\ .property =3D "disable-modern",\ .value =3D "on",\ },{\ - .driver =3D "virtio-pci",\ + .driver =3D "vhost-scsi-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "vhost-user-blk-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "vhost-user-blk-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "vhost-user-scsi-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "vhost-user-scsi-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "vhost-vsock-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "vhost-vsock-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-9p-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-9p-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-balloon-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-balloon-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-blk-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-blk-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-crypto-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-crypto-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-gpu-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-gpu-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-input-host-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-input-host-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-keyboard-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-keyboard-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-mouse-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-mouse-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-net-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-net-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-rng-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-rng-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-scsi-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-scsi-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-serial-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-serial-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-tablet-pci",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-tablet-pci",\ + .property =3D "disable-legacy",\ + .value =3D "off",\ + },{\ + .driver =3D "virtio-vga",\ + .property =3D "disable-modern",\ + .value =3D "on",\ + },{\ + .driver =3D "virtio-vga",\ .property =3D "disable-legacy",\ .value =3D "off",\ }, --=20 2.18.0.rc1.1.g3f1ff2140