[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ping: [PATCH] libxl/PCI: defer backend wait upon attaching to PV guest


  • To: Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 4 Jan 2022 08:53:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DJ2VoCKV4bLugnlAWgwuLfO+9b75Eqzo5U0x4Xeu+TI=; b=jPaELyJs+QC+8cTPI2kp0aV636sAtGBQfg1Glo/uIvtR4AGYZinVZL0MUGGmk+7Vd17EGtJiBQmGqpKb7t6uce1Mnq7wWvNJs4nYLFH79o+NRxJismEkJri3wKk9GIlntjNGjO0NXnhUuoy78qtsBTnnx3BkBEnp4/4raej1QQlPt9Z6YMFaif5Yx7Zh4JXw/Hh6V9r89jsu6j3cjsez6rBlDLdccDlPgJwnWpN3mlj1u7MLMtmdM8SDEC9VfBqmaRAMQHoR9plzN1x6S79Qv44NLdEaaMh3RU+y6KDBMvXu3qZlb4OaPpeVJRHX+nXAqlHmbI3V6xVaqTNU8PzmkA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CxdM1G/D6xVMyj3BIg7T2SLGvwoIqKiKbE5tpff679vhKBKehup6vhfqXIUfHZRwv48P06AJZA2Skw3MoMwCTMySCFrUbvQ0xUdEwmSWubSixA5uK9E3bWNdFeymHQga9lyJC0WM/4cTv47xGnyQ/e3NhroYK9voyOkKjE2ozm90ZyKRRlV3GsOU1+qhbHEybZb4uOBTtD7kSKNk+fcMGhNL4kS+V896eBY/qQru4yNVHXp9NrQvbse5p8hmQsSpcJybjKkC8WJLJZ/9t7Kdx45Y+or5u+i16OwcF56uYrO3x9ldw929nzIBLQ/nMEAiNHtR6apZiX98YdHXSg1mvQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Stefano Stabellini <stefano@xxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 04 Jan 2022 07:53:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.12.2021 08:49, Jan Beulich wrote:
> Attempting to wait when the backend hasn't been created yet can't work:
> the function will complain "Backend ... does not exist". Move the
> waiting past the creation of the backend (and that of other related
> nodes), hoping that there are no other dependencies that would now be
> broken.
> 
> Fixes: 0fdb48ffe7a1 ("libxl: Make sure devices added by pci-attach are 
> reflected in the config")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> Just to make it explicit: I have no idea why the waiting is needed in
> the first place. It's been there from the very introduction of PCI
> passthrough support (commit b0a1af61678b). I therefore can't exclude
> that an even better fix would be to simply omit the 2nd hunk here.

Anyone, be it an ack or an alternative?

Jan

> --- a/tools/libs/light/libxl_pci.c
> +++ b/tools/libs/light/libxl_pci.c
> @@ -157,11 +157,6 @@ static int libxl__device_pci_add_xenstor
>      if (domtype == LIBXL_DOMAIN_TYPE_INVALID)
>          return ERROR_FAIL;
>  
> -    if (!starting && domtype == LIBXL_DOMAIN_TYPE_PV) {
> -        if (libxl__wait_for_backend(gc, be_path, GCSPRINTF("%d", 
> XenbusStateConnected)) < 0)
> -            return ERROR_FAIL;
> -    }
> -
>      back = flexarray_make(gc, 16, 1);
>  
>      LOGD(DEBUG, domid, "Adding new pci device to xenstore");
> @@ -213,6 +208,9 @@ static int libxl__device_pci_add_xenstor
>          if (rc < 0) goto out;
>      }
>  
> +    if (!starting && domtype == LIBXL_DOMAIN_TYPE_PV)
> +        rc = libxl__wait_for_backend(gc, be_path, GCSPRINTF("%d", 
> XenbusStateConnected));
> +
>  out:
>      libxl__xs_transaction_abort(gc, &t);
>      if (lock) libxl__unlock_file(lock);
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.