From nobody Tue Nov 11 08:29:44 2025 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=1569379381; cv=none; d=zoho.com; s=zohoarc; b=dPoR0UuimYaj65//a69ShOacCAQ+BIcHXn0yEWJFq7JHdm4B0q+Y93XtiWOpqj8kTQmpAqTXlJwsduHbJEwNvL8EhheKggRUAkXZTN6Xg/zuzd9XZ9wRlfZ0MJAbFxzfQnQAUeoCXgnpkxPtdYFcYSXpxtol+6WH89xdKjyNt1A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569379381; 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=R9/dCj40c26mHuSKt/dwrsDDp8ZkE5oS7F42c+OX52ZQCr40lGE/Uxx8cVRIgOQ3Iht9rhfQtGtqgVnbcRfR7vH3LWL+IqHo+LqYYhUss97iqh0tlpLxKyPitB4Yi7JCwJWAxeJRrPPV2AeHbITxTMU5dbB6h5gEkpK02+HPl98= 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 1569379381778293.5728494183908; Tue, 24 Sep 2019 19:43:01 -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 1iCxFL-0000ss-45; Wed, 25 Sep 2019 02:41:39 +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 1iCxFJ-0000sh-HV for xen-devel@lists.xenproject.org; Wed, 25 Sep 2019 02:41:37 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by localhost (Halon) with ESMTPS id fdcedf01-df3d-11e9-9627-12813bfff9fa; Wed, 25 Sep 2019 02:41:35 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B680522237; Tue, 24 Sep 2019 22:41:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 24 Sep 2019 22:41:35 -0400 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id A8BB9D6005B; Tue, 24 Sep 2019 22:41:34 -0400 (EDT) X-Inumbo-ID: fdcedf01-df3d-11e9-9627-12813bfff9fa 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=TP2ATDiwzgpnROPXuxqik48FXQS0X726acH61nBEcnSIJ/BDJRplkYddu poiLK7bIxbdbdvzzx6ufNSwRSBeg2geuvnCK8H/cYsC70q7P7KU8MHIm7byHZNcu U3Y4h74S1NBlzyQhcYo6+nZBTLSvdzVh1LY2PDFDYdNqOoyalYM/GPapKvGygbjy Zc/q5TPJASChx04PJlW1vKUvBvv8e7oJEU9uBCs8+WB7Ufe+Vf4Po0w0DPeazpe/ tpvCjGvlwsMevh2zYG0SRNuDM6q9ZIh0s5Bc0yClKlBPKA90Qyi6yhmS/SOIO2+D iSIjWIRWXHW8/5cVuc5zCZ3rdnHgA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrfedugdeivdcutefuodetggdotefrodftvf 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, 25 Sep 2019 04:41:24 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v7 2/4] 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