Re: [PATCH 01/13] conf: Add definitions for 'uid' and 'fid' PCI address attributes

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

 



On 05/24/2018 08:24 AM, Xiao Feng Ren wrote:
> From: Yi Min Zhao <zyimin@xxxxxxxxxxxxx>
>
> Add zPCI definitions in preparation of extending the PCI address
> with parameters uid (user-defined identifier) and fid (PCI function
> identifier).
>
> Signed-off-by: Yi Min Zhao <zyimin@xxxxxxxxxxxxx>
> Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
> Reviewed-by: Stefan Zimmermann <stzi@xxxxxxxxxxxxx>
> Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx>
> ---
>  src/util/virpci.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/util/virpci.h b/src/util/virpci.h
> index 794b7e59db..250e9278ba 100644
> --- a/src/util/virpci.h
> +++ b/src/util/virpci.h
> @@ -36,12 +36,22 @@ typedef virPCIDeviceAddress *virPCIDeviceAddressPtr;
>  typedef struct _virPCIDeviceList virPCIDeviceList;
>  typedef virPCIDeviceList *virPCIDeviceListPtr;
>  
> +typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress;
> +typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr;
> +struct _virZPCIDeviceAddress {
> +    unsigned int zpcifid;
> +    unsigned int zpciuid;
> +    bool fid_assigned;
> +    bool uid_assigned;
> +};
> +
>  struct _virPCIDeviceAddress {
>      unsigned int domain;
>      unsigned int bus;
>      unsigned int slot;
>      unsigned int function;
>      int multi; /* virTristateSwitch */
> +    virZPCIDeviceAddressPtr zpci;

Why does this need to be a pointer to a "virZPCIDeviceAddress"? The
struct itself is a fixed size, and it already has bools to indicate
whether or not each of the data attributes has been set. That's just
extra memory management churn for no useful purpose.


>  };
>  
>  typedef enum {


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux