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

Bjoern Walk bwalk at linux.ibm.com
Fri Jun 8 07:16:30 UTC 2018


Laine Stump <laine at laine.org> [2018-06-07, 09:43PM -0400]:
> On 05/24/2018 08:24 AM, Xiao Feng Ren wrote:
> > From: Yi Min Zhao <zyimin at linux.ibm.com>
> >
> > 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 at linux.ibm.com>
> > Reviewed-by: Boris Fiuczynski <fiuczy at linux.vnet.ibm.com>
> > Reviewed-by: Stefan Zimmermann <stzi at linux.ibm.com>
> > Reviewed-by: Bjoern Walk <bwalk at linux.vnet.ibm.com>
> > ---
> >  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.

Yeah, we do encode a lot of state with this member. IIRC, if the zpci
pointer is allocated, we generally do have zpci support available. The
booleans refer to if an actual zpci address has been generated by the
PCI address generation code. This only happens when the pointer is
allocated. Another way would be to check the zpci capability.

> >  };
> >  
> >  typedef enum {
> 
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 

-- 
IBM Systems
Linux on Z & Virtualization Development
------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Schönaicher Str. 220, 71032 Böblingen
Phone: +49 7031 16 1819
------------------------------------------------------------------------
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 902 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180608/be941ee8/attachment-0001.sig>


More information about the libvir-list mailing list