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

Re: [PATCH v4 01/23] xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X


  • To: Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Tue, 1 Dec 2020 12:32:46 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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-SenderADCheck; bh=xmlGrHfd9YgnaTOvCWi0PlJMwGuxD/a8aU+wUUro3gk=; b=P9UbpNwcOgCkxS9/fIX0boTv41phvAdA92HNcWMGgZAoWR3MHOxlBfLhXbjBHNsun86MP+iUxCMq6Ynq3P2IBpQ6jhBKLSuJmSw61UHY5xlCOV4I0zTU0upTzTKI0rfu8X0nuNq3136409sR7BNfW7Q0NH1+/woOx65heJMpwlZEQNH2s5/eEBkzKI7qxLjpNCJGGU1VzGvSz+4IMn3ocRYenHGK2i3G8O19ydBgevt0ib4rjiMmxcBWGqW8SQDjbbu0YiheAQeA8QpvntBHyGvFfOZcl4r6Y7qQ6jXjQAOP52mb9kG0ZHBoytq0nKEdB7Sb8Rrka6MRb39K3bOKtQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B17hIosFLe0HwpqDQ+0H/xMqDuk78BHFTYxx4NywcTn3LsZAloEFMZbZKKkCfWYLW6/7IZA9TN7rY7n1/APu1hK4fZR/dPxa4+DbBUgXw0s/0FAtPIr/xbj/hJkbzRd1JYWYXDCSO6Lt41MpYt8MSyNAAVcqMDicoFjUASTugLP4ebNzhg+2iCkxModN50lZ9qnyPvQGOY6JPxL+FHg0xTUi706pvqTh1madpffyF0Nr04Plabgqxqj29tH+fHsUZA2EZ2FzqxYmGoK974oc8NzK3wLNBOq7EP8EIpVeffZuuuawOh4uPdfl9CJqGzoFovl5x8b+RByE+07Zh8ispQ==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=epam.com;
  • Cc: Paul Durrant <pdurrant@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Tue, 01 Dec 2020 12:32:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWx94RQn6N+bgvwE2dBHmo2TdzxQ==
  • Thread-topic: [PATCH v4 01/23] xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X

Hi, Paul!

On 11/24/20 10:01 AM, Paul Durrant wrote:
> From: Paul Durrant <pdurrant@xxxxxxxxxx>
>
> The seemingly arbitrary use of 'pci' and 'pcidev' in the code in libxl_pci.c
> is confusing and also compromises use of some macros used for other device
> types. Indeed it seems that DEFINE_DEVICE_TYPE_STRUCT_X exists solely because
> of this duality.
>
> This patch purges use of 'pcidev' from the libxl code, allowing evaluation of
> DEFINE_DEVICE_TYPE_STRUCT_X to be replaced with DEFINE_DEVICE_TYPE_STRUCT,
> hence allowing removal of the former.
>
> For consistency the xl and libs/util code is also modified, but in this case
> it is purely cosmetic.
>
> NOTE: Some of the more gross formatting errors (such as lack of spaces after
>        keywords) that came into context have been fixed in libxl_pci.c.
>
> Signed-off-by: Paul Durrant <pdurrant@xxxxxxxxxx>
> ---
> Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>
> Cc: Wei Liu <wl@xxxxxxx>
> Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> ---
>   tools/include/libxl.h             |  17 +-
>   tools/libs/light/libxl_create.c   |   6 +-
>   tools/libs/light/libxl_dm.c       |  18 +-
>   tools/libs/light/libxl_internal.h |  45 ++-
>   tools/libs/light/libxl_pci.c      | 582 
> +++++++++++++++++++-------------------
>   tools/libs/light/libxl_types.idl  |   2 +-
>   tools/libs/util/libxlu_pci.c      |  36 +--
>   tools/xl/xl_parse.c               |  28 +-
>   tools/xl/xl_pci.c                 |  68 ++---
>   tools/xl/xl_sxp.c                 |  12 +-
>   10 files changed, 409 insertions(+), 405 deletions(-)
>
> diff --git a/tools/include/libxl.h b/tools/include/libxl.h
> index 1ea5b4f446..fbe4c81ba5 100644
> --- a/tools/include/libxl.h
> +++ b/tools/include/libxl.h
> @@ -445,6 +445,13 @@
>   #define LIBXL_HAVE_DISK_SAFE_REMOVE 1
>   
[snip]
> -/* Scan through /sys/.../pciback/slots looking for pcidev's BDF */
> -static int pciback_dev_has_slot(libxl__gc *gc, libxl_device_pci *pcidev)
> +/* Scan through /sys/.../pciback/slots looking for pci's BDF */
> +static int pciback_dev_has_slot(libxl__gc *gc, libxl_device_pci *pci)
>   {
>       FILE *f;
>       int rc = 0;
> @@ -635,11 +635,11 @@ static int pciback_dev_has_slot(libxl__gc *gc, 
> libxl_device_pci *pcidev)
>           return ERROR_FAIL;
>       }
>   
> -    while(fscanf(f, "%x:%x:%x.%d\n", &dom, &bus, &dev, &func)==4) {
> -        if(dom == pcidev->domain
> -           && bus == pcidev->bus
> -           && dev == pcidev->dev
> -           && func == pcidev->func) {
> +    while (fscanf(f, "%x:%x:%x.%d\n", &dom, &bus, &dev, &func)==4) {
So, then you can probably put spaces around "4" if touching this line
> +        if (dom == pci->domain
> +            && bus == pci->bus
> +            && dev == pci->dev
> +            && func == pci->func) {
>               rc = 1;
>               goto out;
>           }
> @@ -649,7 +649,7 @@ out:
>       return rc;
>   }
>   

Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>

Thank you,

Oleksandr

 


Rackspace

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