From nobody Tue Feb 10 05:46:55 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=1563325557; cv=none; d=zoho.com; s=zohoarc; b=Mwtls1dVE/tdE3pdUDQUgiUq1JCSfuKjwFyVWXUQJAf6zXPOmkcV//Y8tAHCmD36poDwbNGrRKN5QJXP2NkHMgn+uIsWylLSwNSfst1QpdtAOh1OgSsbqT2IH3AqC8LYscYVAt/YjH1FcsyoG54UdZoC2mKpU1lDpzbPe+nHzMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563325557; 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=ZI8eKH2WgJlFga/yDIKiH0NpTdwgzr9YAdEm/gSdhVs=; b=BsWUjekCTURCPLgxbTKIY+SOmWE17+zvJWToTo/CTSNz+5jaG7C+KhiorKsYEz2NF7Q0NzDMxIrhhHOovxMtNPdB0Q4y76kz9mG9lmycD26CHa1qvuf1xCDOcYK3j1rdK2L0CPoK2x8RmOb9356c5Z+mNx+A1QVzNsa5GTSARaI= 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 156332555767142.289973119469096; Tue, 16 Jul 2019 18:05:57 -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 1hnYNG-0005eu-Sj; Wed, 17 Jul 2019 01:04:50 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hnYNE-0005el-R2 for xen-devel@lists.xenproject.org; Wed, 17 Jul 2019 01:04:48 +0000 Received: from wout4-smtp.messagingengine.com (unknown [64.147.123.20]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6607eb62-a82e-11e9-ac5a-cb9da3a1b495; Wed, 17 Jul 2019 01:01:24 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id CA2003FA; Tue, 16 Jul 2019 21:01:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 16 Jul 2019 21:01:24 -0400 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 64852380089; Tue, 16 Jul 2019 21:01:22 -0400 (EDT) X-Inumbo-ID: 6607eb62-a82e-11e9-ac5a-cb9da3a1b495 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=4TEx41rBDtnAVuYynPevXwnuw1J6hoytIjvxfT36S /8=; b=pQ0Ka6Dqlol6W5Cy2p1L3KdFvBRIWRJKihyfJm3QSBfX8t1I26fL/Ucsc ou4rhRddxrXHwzDc8Am8P4c9AnJzdBadlB10YTbr8N7Ey7qZbacRDxO3eCpbAz6k o5Zt3iOeODGcLb1n+dWyYh7SHkommdCaf0e7QaS/gv9Stka0ZbWjlW6OpSHoLBKM Sn6FeBE/NviIt2odnbjEveHnHsa3oBPuZ/132mwaDNO0gYYgSJvaozF+jB3dgERS EomS7cKwh3XKn9nv2PTfyUApRKqihDYRz5UNhw5lxVj+FgLKtPXJxkVpsQvtOBnV 9fGZvS0eXQTl90w7FnhlZ1PEhAOig== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddriedugdegvdcutefuodetggdotefrodftvf 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: Wed, 17 Jul 2019 03:00:40 +0200 Message-Id: <9ced73c8ec8569b90cbdf413e5db2ada5121c973.1563325215.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v5 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 7ffab89..18089ea 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