Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E760C433E3 for ; Tue, 30 Jun 2020 13:59:48 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55B0A20774 for ; Tue, 30 Jun 2020 13:59:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55B0A20774 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jqGnH-0007Mn-Rj; Tue, 30 Jun 2020 13:59:27 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jqGnG-0007Mi-Nl for xen-devel@lists.xenproject.org; Tue, 30 Jun 2020 13:59:26 +0000 X-Inumbo-ID: e7e30e3c-bad9-11ea-bca7-bc764e2007e4 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e7e30e3c-bad9-11ea-bca7-bc764e2007e4; Tue, 30 Jun 2020 13:59:25 +0000 (UTC) Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: CdQDhhe/vltse0IAgZlqTjOb33oITBRQkWwnnAUWMqaDjQkGRd6MqEuQLO/+CTqMXjFgNhUWqB JQBFCCHtm1puW3hrPoIjtPK8ernonrSNiXM8VsGkdgzqFokXl+t43w61LqIv1NHI3ZZfZpWHuk 9VboYHAo/oukmhdxNbvsIf3tRDtl7Z1SClc12+m0i4kYRHmiUl5tuHkqDpnMmSSkMBySYTQjdy MTaGqtKs2CeNWNR+ARHaGj9+wIe/TIJbhnbzg+H/fCR14M0LRAER+lU6hYaKtoACQVCCA34/r4 0sE= X-SBRS: 2.7 X-MesageID: 21272894 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,297,1589256000"; d="scan'208";a="21272894" Date: Tue, 30 Jun 2020 14:59:21 +0100 From: Anthony PERARD To: Jason Andryuk Subject: Re: [PATCH] xen: Fix xen-legacy-backend qdev types Message-ID: <20200630135921.GB2030@perard.uk.xensource.com> References: <20200624121939.10282-1-jandryuk@gmail.com> <000a01d64a23$4a595e90$df0c1bb0$@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: xen-devel , Stefano Stabellini , QEMU , Paul Durrant Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Wed, Jun 24, 2020 at 08:52:44AM -0400, Jason Andryuk wrote: > On Wed, Jun 24, 2020 at 8:30 AM Paul Durrant wrote: > > > > > -----Original Message----- > > > From: Jason Andryuk > > > Sent: 24 June 2020 13:20 > > > To: Stefano Stabellini ; Anthony Perard ; Paul > > > Durrant ; xen-devel@lists.xenproject.org > > > Cc: Jason Andryuk ; qemu-devel@nongnu.org > > > Subject: [PATCH] xen: Fix xen-legacy-backend qdev types > > > > > > xen-sysdev is a TYPE_SYS_BUS_DEVICE. bus_type should not be changed so > > > that it can plug into the System bus. Otherwise this assert triggers: > > > qemu-system-i386: hw/core/qdev.c:102: qdev_set_parent_bus: Assertion > > > `dc->bus_type && object_dynamic_cast(OBJECT(bus), dc->bus_type)' > > > failed. > > > > > > TYPE_XENBACKEND attaches to TYPE_XENSYSBUS, so its class_init needs to > > > be set accordingly to attach the qdev. Otherwise the following assert > > > triggers: > > > qemu-system-i386: hw/core/qdev.c:102: qdev_set_parent_bus: Assertion > > > `dc->bus_type && object_dynamic_cast(OBJECT(bus), dc->bus_type)' > > > failed. > > > > > > TYPE_XENBACKEND is not a subclass of XEN_XENSYSDEV, so it's parent > > > is just TYPE_DEVICE. Change that. > > > > > > Signed-off-by: Jason Andryuk > > > > Clearly we raced. This patch and my patch #1 are identical so I'm happy to give my ack to this. > > Yeah, looks like you beat me by a hair :) > > Either way it gets fixed is fine by me. Since there's a choice to make, I think I'll take this patch, but I will add: Fixes: 81cb05732efb ("qdev: Assert devices are plugged into a bus that can take them") Thanks, -- Anthony PERARD