From patchwork Thu Jan 10 02:02:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1022661 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Zq6w5dTdz9sMQ for ; Thu, 10 Jan 2019 13:04:08 +1100 (AEDT) Received: from localhost ([127.0.0.1]:50771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghPhW-0006Ww-On for incoming@patchwork.ozlabs.org; Wed, 09 Jan 2019 21:04:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghPgy-0006V2-02 for qemu-devel@nongnu.org; Wed, 09 Jan 2019 21:03:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghPgw-0003OF-OQ for qemu-devel@nongnu.org; Wed, 09 Jan 2019 21:03:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33204) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghPgw-0003Lt-IW for qemu-devel@nongnu.org; Wed, 09 Jan 2019 21:03:30 -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 8A92158E3D; Thu, 10 Jan 2019 02:03:28 +0000 (UTC) Received: from localhost (ovpn-116-5.gru2.redhat.com [10.97.116.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB3A55C54B; Thu, 10 Jan 2019 02:03:23 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 00:02:59 -0200 Message-Id: <20190110020259.8492-4-ehabkost@redhat.com> In-Reply-To: <20190110020259.8492-1-ehabkost@redhat.com> References: <20190110020259.8492-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.39]); Thu, 10 Jan 2019 02:03:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 3/3] virtio: Make disable-legacy/disable-modern compat properties optional 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 , Eduardo Habkost , "Michael S. Tsirkin" , Cornelia Huck , "Dr. David Alan Gilbert" , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Fixes: f6e501a28ef9 ("virtio: Provide version-specific variants of virtio PCI devices") Signed-off-by: Eduardo Habkost --- 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 }, }; const size_t hw_compat_2_6_len = G_N_ELEMENTS(hw_compat_2_6);