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

2018-08-23 Thread Andrea Bolognani
On Thu, 2018-08-23 at 16:46 +0800, Yi Min Zhao wrote: > 在 2018/8/23 下午4:12, Andrea Bolognani 写道: > > This got me thinking that the extension flags *also* belongs to > > virPCIDeviceAddress, since we need them to know whether the zPCI > > part should be taken into account when formatting and such: y

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

2018-08-23 Thread Yi Min Zhao
在 2018/8/23 下午6:01, Andrea Bolognani 写道: On Thu, 2018-08-23 at 17:15 +0800, Yi Min Zhao wrote: 在 2018/8/23 下午4:12, Andrea Bolognani 写道: Exactly. You can either just add zpci_uid and zpci_fid to the virPCIDeviceAddress struct, or have struct _virZPCIDeviceAddress { unsigned int ui

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

2018-08-23 Thread Andrea Bolognani
On Thu, 2018-08-23 at 17:15 +0800, Yi Min Zhao wrote: > > 在 2018/8/23 下午4:12, Andrea Bolognani 写道: > > Exactly. You can either just add zpci_uid and zpci_fid to the > > virPCIDeviceAddress struct, or have > > > >struct _virZPCIDeviceAddress { > >unsigned int uid; > >unsigned i

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

2018-08-23 Thread Yi Min Zhao
在 2018/8/23 下午4:12, Andrea Bolognani 写道: Exactly. You can either just add zpci_uid and zpci_fid to the virPCIDeviceAddress struct, or have struct _virZPCIDeviceAddress { unsigned int uid; unsigned int fid; }; struct _virPCIDeviceAddress { unsigned int domain;

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

2018-08-23 Thread Yi Min Zhao
在 2018/8/23 下午4:12, Andrea Bolognani 写道: On Thu, 2018-08-23 at 14:40 +0800, Yi Min Zhao wrote: 在 2018/8/22 下午6:09, Andrea Bolognani 写道: On Wed, 2018-08-22 at 17:39 +0800, Yi Min Zhao wrote: I tried as your idea. It makes everything complicated, especially alloc/reserve/release zpci address.

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

2018-08-23 Thread Andrea Bolognani
On Thu, 2018-08-23 at 14:40 +0800, Yi Min Zhao wrote: > 在 2018/8/22 下午6:09, Andrea Bolognani 写道: > > On Wed, 2018-08-22 at 17:39 +0800, Yi Min Zhao wrote: > > > I tried as your idea. It makes everything complicated, especially > > > alloc/reserve/release > > > zpci address. If the user defines uid=

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

2018-08-22 Thread Yi Min Zhao
在 2018/8/22 下午6:09, Andrea Bolognani 写道: On Wed, 2018-08-22 at 17:39 +0800, Yi Min Zhao wrote: 在 2018/8/21 下午9:19, Andrea Bolognani 写道: On Tue, 2018-08-21 at 19:55 +0800, Yi Min Zhao wrote: For zPCI address, if we use the same strategy as PCI part and user wants to assign fid=0 to the specif

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

2018-08-22 Thread Andrea Bolognani
On Wed, 2018-08-22 at 17:39 +0800, Yi Min Zhao wrote: > 在 2018/8/21 下午9:19, Andrea Bolognani 写道: > > On Tue, 2018-08-21 at 19:55 +0800, Yi Min Zhao wrote: > > > > > For zPCI address, if we use the same strategy as PCI part and user > > > > > wants to assign fid=0 to the specific device, he might en

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

2018-08-22 Thread Yi Min Zhao
在 2018/8/21 下午9:19, Andrea Bolognani 写道: On Tue, 2018-08-21 at 19:55 +0800, Yi Min Zhao wrote: 在 2018/8/21 下午7:00, Andrea Bolognani 写道: On Tue, 2018-08-21 at 17:35 +0800, Yi Min Zhao wrote: I want to ask a question. For pci address, any pci device can't use slot 0. Is that a reason why PCI p

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

2018-08-21 Thread Andrea Bolognani
On Tue, 2018-08-21 at 19:55 +0800, Yi Min Zhao wrote: > 在 2018/8/21 下午7:00, Andrea Bolognani 写道: > > On Tue, 2018-08-21 at 17:35 +0800, Yi Min Zhao wrote: > > > I want to ask a question. For pci address, any pci device can't use slot > > > 0. > > > Is that a reason why PCI part could treat all zer

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

2018-08-21 Thread Yi Min Zhao
在 2018/8/21 下午7:00, Andrea Bolognani 写道: On Tue, 2018-08-21 at 17:35 +0800, Yi Min Zhao wrote: I want to ask a question. For pci address, any pci device can't use slot 0. Is that a reason why PCI part could treat all zeros as empty address? A PCI address where all attributes are zero can't be

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

2018-08-21 Thread Andrea Bolognani
On Tue, 2018-08-21 at 17:35 +0800, Yi Min Zhao wrote: > I want to ask a question. For pci address, any pci device can't use slot 0. > Is that a reason why PCI part could treat all zeros as empty address? A PCI address where all attributes are zero can't be used, so there's no ambiguity there; same

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

2018-08-21 Thread Yi Min Zhao
在 2018/8/21 下午4:06, Andrea Bolognani 写道: On Tue, 2018-08-21 at 11:24 +0800, Yi Min Zhao wrote: 在 2018/8/20 下午6:35, Andrea Bolognani 写道: You could do the same thing those functions do: * the zPCI address is empty if both uid and fid are zero; uid=0 and fid=0 can't mean zPCI address is em

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

2018-08-21 Thread Andrea Bolognani
On Tue, 2018-08-21 at 11:24 +0800, Yi Min Zhao wrote: > 在 2018/8/20 下午6:35, Andrea Bolognani 写道: > > You could do the same thing those functions do: > > > >* the zPCI address is empty if both uid and fid are zero; > > uid=0 and fid=0 can't mean zPCI address is empty, because the user might >

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

2018-08-20 Thread Yi Min Zhao
在 2018/8/20 下午6:35, Andrea Bolognani 写道: On Mon, 2018-08-20 at 16:19 +0800, Yi Min Zhao wrote: 在 2018/8/16 下午10:38, Andrea Bolognani 写道: On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: +struct _virZPCIDeviceAddress { +unsigned int zpci_fid; +unsigned int zpci_uid; +bool fid

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

2018-08-20 Thread Andrea Bolognani
On Mon, 2018-08-20 at 16:19 +0800, Yi Min Zhao wrote: > 在 2018/8/16 下午10:38, Andrea Bolognani 写道: > > On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > > > +struct _virZPCIDeviceAddress { > > > +unsigned int zpci_fid; > > > +unsigned int zpci_uid; > > > +bool fid_assigned; > > > +

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

2018-08-20 Thread Yi Min Zhao
在 2018/8/16 下午10:38, Andrea Bolognani 写道: On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: +typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress; +typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr; +struct _virZPCIDeviceAddress { +unsigned int zpci_fid; +unsigned int zpci

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

2018-08-20 Thread Yi Min Zhao
在 2018/8/16 下午10:38, Andrea Bolognani 写道: On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: +typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress; +typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr; +struct _virZPCIDeviceAddress { +unsigned int zpci_fid; +unsigned int zpci

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

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > +typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress; > +typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr; > +struct _virZPCIDeviceAddress { > +unsigned int zpci_fid; > +unsigned int zpci_uid; > +bool fid_assigned; > +

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

2018-08-07 Thread Yi Min Zhao
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 Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko --- src/ut