From nobody Tue Feb 10 11:32:56 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1568475623; cv=none; d=zoho.com; s=zohoarc; b=BnqXJ+bkxOu3rWsct3GM3NTRFFS4xmu0p9ERfZ72Z+mWLzXljSi1m88Y6hJ51EtYAsrSLNS2mGdO9RLTnhawSnAdnbmrSGMierPz6rCLkuf/yfkA1Cr8RLgGsVexfM5UOZlsZEKFfzaciJrLqYP9jHMeMaYW81KgaQhnwV5d/mA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568475623; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=1gv80ZO0nHKz4erecnyD3XG9nie/R9xxsAwxvJp8sTc=; b=JQjAV+HTzSWj4m6iDEAm32jv27TkP0EqXwrM9BlOhK8VA9WmzDGZUJJV3uUqiGep8dYB+WZSqZvLMZEy878jf6hBiiPV5TqH8gjRR+pzAZbnXYwshDR6SnjhSneDrK3h5iQCjPl3IuzXPoBLqun4dIjQlyJxwwgmEs8RpszGyOM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1568475623058707.3133006492798; Sat, 14 Sep 2019 08:40:23 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i9A7V-0001G8-D2; Sat, 14 Sep 2019 15:37:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i9A7U-0001G2-1i for xen-devel@lists.xenproject.org; Sat, 14 Sep 2019 15:37:52 +0000 Received: from wout1-smtp.messagingengine.com (unknown [64.147.123.24]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9723e218-d705-11e9-b299-bc764e2007e4; Sat, 14 Sep 2019 15:37:42 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 868FC5AD; Sat, 14 Sep 2019 11:37:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 14 Sep 2019 11:37:41 -0400 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 14A86D6005E; Sat, 14 Sep 2019 11:37:39 -0400 (EDT) X-Inumbo-ID: 9723e218-d705-11e9-b299-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=1A8lEmAUpw019VXdWnEGZkLXEHyBw42z6uUjfYtGZ q4=; b=i//iW2w8kwC+rfYeQRdS7TQLwWpx68g0LLh7GP1iwOqH8tKKjyoXA3RAV l4uRItXGdAdGvB9r7XH5OrTwYPON1bdYqEw2ICBg5ZhOcn1tRNg41dXD10je/EGp WOK7Oj1lCzfDD9JMhbdT1NzqVq/ViRFK6FfaLBRQsT7NxdZ06c8PEdILyFDZQN+4 m/+AqF+T1vW1NipeWaj2J83b1usqQ7rwXKV44DShfkeyMathV5HY20+ChIIZenFT GMJ9/4S4BFLIqM+PcJlrMDr/tP2wNrFZ6Ge+H88UwtJFD4inPsigayFz/2L/lDU/ SELgjublczIjI/tfnkSAMTs+QK6FQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrtdelgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucffohhmrghinhepvhgvrhhsihho nhdrqddqqdhtohholhhsnecukfhppeeluddrieehrdefgedrfeefnecurfgrrhgrmhepmh grihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggs rdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Sat, 14 Sep 2019 17:37:17 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v6 2/6] libxl: attach PCI device to qemu only after setting pciback/pcifront X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When qemu is running in stubdomain, handling "pci-ins" command will fail if pcifront is not initialized already. Fix this by sending such command only after confirming that pciback/front is running. Signed-off-by: Marek Marczykowski-G=C3=B3recki Acked-by: Wei Liu --- Changes in v2: - Fixed code style since previous version. --- tools/libxl/libxl_pci.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 2e06a45..578535f 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1191,6 +1191,7 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t dom= id, libxl_device_pci *pcide { libxl_ctx *ctx =3D libxl__gc_owner(gc); unsigned int orig_vdev, pfunc_mask; + char *be_path; libxl_device_pci *assigned; int num_assigned, i, rc; int stubdomid =3D 0; @@ -1245,6 +1246,14 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t do= mid, libxl_device_pci *pcide rc =3D do_pci_add(gc, stubdomid, &pcidev_s, 0); if ( rc ) goto out; + /* Wait for the device actually being connected, otherwise device = model + * running there will fail to find the device. */ + be_path =3D libxl__sprintf(gc, "%s/backend/pci/%d/0", + libxl__xs_get_dompath(gc, 0), stubdomid); + rc =3D libxl__wait_for_backend(gc, be_path, + GCSPRINTF("%d", XenbusStateConnected)= ); + if (rc) + goto out; } =20 orig_vdev =3D pcidev->vdevfn & ~7U; --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel