From nobody Wed Apr 16 13:42:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15813268118211012.5702771961651; Mon, 10 Feb 2020 01:26:51 -0800 (PST) Received: from localhost ([::1]:58890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j15L8-00025K-IH for importer@patchew.org; Mon, 10 Feb 2020 04:26:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43928) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j15Ib-0007KR-1l for qemu-devel@nongnu.org; Mon, 10 Feb 2020 04:24:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j15IZ-00048q-Um for qemu-devel@nongnu.org; Mon, 10 Feb 2020 04:24:12 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:41498 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j15IZ-00048X-QW for qemu-devel@nongnu.org; Mon, 10 Feb 2020 04:24:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-209-3fE5YQs-PbK4PbrrhuZIuQ-1; Mon, 10 Feb 2020 04:24:09 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD6DC800EBB; Mon, 10 Feb 2020 09:24:07 +0000 (UTC) Received: from localhost (unknown [10.36.118.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2FFF8ED1C; Mon, 10 Feb 2020 09:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581326651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JFGWeVit+UK++rdbbm90uJbjVOAPmWOyPnQx3Uw0Kyg=; b=fnWCiGn56sPz1V6z9sKE66daI4OpxSdM2SUxbrSCFZCy8IabBFAOaqKp3xI0hYhtnIqhdV C/NDQBjWuwknYCHgnecscDaOzMf8aKs0Yetl1ldHdNO3y6eapQGsEgT8fDhSsRX2GgfKHu CSLqNowUSaxBteoBkz5hpsrjCuVlzoU= From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL 2/2] hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host Date: Mon, 10 Feb 2020 09:23:48 +0000 Message-Id: <20200210092348.398611-3-stefanha@redhat.com> In-Reply-To: <20200210092348.398611-1-stefanha@redhat.com> References: <20200210092348.398611-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 3fE5YQs-PbK4PbrrhuZIuQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Stefan Hajnoczi , qemu-block@nongnu.org, "Michael S . Tsirkin" , Cornelia Huck , Max Reitz , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Commit ed65fd1a2750 ("virtio-blk: switch off scsi-passthrough by default") changed the default value of the 'scsi' property of virtio-blk, which is only available on Linux hosts. It also added an unconditional compat entry for 2.4 or earlier machines. Trying to set this property on a pre-2.5 machine on OSX, we get: Unexpected error in object_property_find() at qom/object.c:1201: qemu-system-x86_64: -device virtio-blk-pci,id=3Dscsi0,drive=3Ddrive0: ca= n't apply global virtio-blk-device.scsi=3Dtrue: Property '.scsi' not found Fix this error by marking the property optional. Fixes: ed65fd1a27 ("virtio-blk: switch off scsi-passthrough by default") Suggested-by: Cornelia Huck Reviewed-by: Cornelia Huck Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Message-id: 20200207001404.1739-1-philmd@redhat.com Signed-off-by: Stefan Hajnoczi --- 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 3e288bfceb..d8e30e4895 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -148,7 +148,8 @@ GlobalProperty hw_compat_2_5[] =3D { const size_t hw_compat_2_5_len =3D G_N_ELEMENTS(hw_compat_2_5); =20 GlobalProperty hw_compat_2_4[] =3D { - { "virtio-blk-device", "scsi", "true" }, + /* Optional because the 'scsi' property is Linux-only */ + { "virtio-blk-device", "scsi", "true", .optional =3D true }, { "e1000", "extra_mac_registers", "off" }, { "virtio-pci", "x-disable-pcie", "on" }, { "virtio-pci", "migrate-extra", "off" }, --=20 2.24.1