Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Dmitrii Shcherbakov
On Fri, Oct 1, 2021 at 8:28 PM Daniel P. Berrangé wrote: > > On Fri, Oct 01, 2021 at 01:13:00PM -0400, Laine Stump wrote: > > On 10/1/21 5:57 AM, Daniel P. Berrangé wrote: > > > On Mon, Sep 27, 2021 at 10:30:47PM +0300, Dmitrii Shcherbakov wrote: > > > > [...] > > > > > +GType > > > > +vir_pci_vpd

Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Dmitrii Shcherbakov
On Fri, Oct 1, 2021 at 7:49 PM Daniel P. Berrangé wrote: > > A GTree is used as a data structure in order to maintain key ordering > > which will be important in XML to XML tests later. > > Now, I've learnt a bit more about VPD and considering my comments on > the XML format in the last patch, I

Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Dmitrii Shcherbakov
> > +if (VIR_CLOSE(vpdFileFd) < 0) { > > +virReportSystemError(errno, _("Unable to close the VPD file, fd: > > %d"), vpdFileFd); > > +return NULL; > > +} > > This is closing an FD that is owned & passed in by the caller. I'd > consider that an undesirable pattern. Whomever

Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Daniel P . Berrangé
On Fri, Oct 01, 2021 at 01:13:00PM -0400, Laine Stump wrote: > On 10/1/21 5:57 AM, Daniel P. Berrangé wrote: > > On Mon, Sep 27, 2021 at 10:30:47PM +0300, Dmitrii Shcherbakov wrote: > > [...] > > > +GType > > > +vir_pci_vpd_resource_type_get_type(void) > > I know you had asked about using under_

Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Dmitrii Shcherbakov
Thanks a lot for the review! Responses inline - ACKs to address in v6. On Fri, Oct 1, 2021 at 12:58 PM Daniel P. Berrangé wrote: > I don't know what the thread concurrency rules are of the callers of > this code, but regardless we generally aim to make any one-time > initializers thread safe by

Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Laine Stump
On 10/1/21 5:57 AM, Daniel P. Berrangé wrote: On Mon, Sep 27, 2021 at 10:30:47PM +0300, Dmitrii Shcherbakov wrote: [...] +GType +vir_pci_vpd_resource_type_get_type(void) I know you had asked about using under_scored_naming in a reply to Peter pointing out "non-standard" names in V3 of you

Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Daniel P . Berrangé
On Mon, Sep 27, 2021 at 10:30:47PM +0300, Dmitrii Shcherbakov wrote: > Add support for deserializing the binary PCI/PCIe VPD format and storing > results in memory. > > The VPD format is specified in "I.3. VPD Definitions" in PCI specs > (2.2+) and "6.28.1 VPD Format" PCIe 4.0. As section 6.28 in

Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Daniel P . Berrangé
On Mon, Sep 27, 2021 at 10:30:47PM +0300, Dmitrii Shcherbakov wrote: > Add support for deserializing the binary PCI/PCIe VPD format and storing > results in memory. > > The VPD format is specified in "I.3. VPD Definitions" in PCI specs > (2.2+) and "6.28.1 VPD Format" PCIe 4.0. As section 6.28 in

Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-10-01 Thread Daniel P . Berrangé
On Mon, Sep 27, 2021 at 10:30:47PM +0300, Dmitrii Shcherbakov wrote: > Add support for deserializing the binary PCI/PCIe VPD format and storing > results in memory. > > The VPD format is specified in "I.3. VPD Definitions" in PCI specs > (2.2+) and "6.28.1 VPD Format" PCIe 4.0. As section 6.28 in

[libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

2021-09-27 Thread Dmitrii Shcherbakov
Add support for deserializing the binary PCI/PCIe VPD format and storing results in memory. The VPD format is specified in "I.3. VPD Definitions" in PCI specs (2.2+) and "6.28.1 VPD Format" PCIe 4.0. As section 6.28 in PCIe 4.0 notes, the PCI Local Bus and PCIe VPD formats are binary compatible an