[PATCH 00/31] pci vpd: Fix broken XML formatter and refactor questionable error reporting

Peter Krempa posted 31 patches 2 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1706633776.git.pkrempa@redhat.com
src/conf/domain_conf.c                        |  78 +--
src/conf/network_conf.c                       |  80 +--
src/conf/node_device_conf.c                   | 177 +++----
src/conf/numa_conf.c                          |  15 +-
src/conf/schemas/nodedev.rng                  |   2 +-
src/cpu/cpu_ppc64.c                           |   5 +-
src/libvirt_private.syms                      |   3 -
src/qemu/qemu_capabilities.c                  |  30 +-
src/qemu/qemu_domain.c                        |  23 +-
src/qemu/qemu_migration_cookie.c              |   5 +-
src/qemu/qemu_nbdkit.c                        |   5 +-
src/util/virpci.c                             |  34 +-
src/util/virpcivpd.c                          | 454 ++++++++----------
src/util/virpcivpd.h                          |   8 +-
src/util/virpcivpdpriv.h                      |  11 +-
src/vz/vz_sdk.c                               |   5 +-
.../pci_0000_42_00_0_vpd.xml                  |   4 +-
tests/virpcimock.c                            |   4 +-
tests/virpcitest.c                            |   3 +-
tests/virpcivpdtest.c                         | 160 +-----
20 files changed, 386 insertions(+), 720 deletions(-)
[PATCH 00/31] pci vpd: Fix broken XML formatter and refactor questionable error reporting
Posted by Peter Krempa 2 months, 3 weeks ago
The first part of the series fixes the XML formatter of nodedevs to not
generate invalid XML if a PCI device custom field contains '>' which
would be printed unescaped

The rest fixes questionable and broken error reporting from the pci vpd
device code which actually parses the above data.

 https://gitlab.com/pipo.sk/libvirt/-/pipelines/1157912774

Peter Krempa (31):
  virPCIVPDResourceIsValidTextValue: Adjust comment to reflect actual
    code
  util: pcivpd: Refactor virPCIVPDResourceIsValidTextValue
  virNodeDeviceCapVPDFormatCustom*: Escape unsanitized strings
  virNodeDeviceCapVPDFormat: Properly escape system-originated strings
  schema: nodedev: Adjust allowed characters in 'vpdFieldValueFormat'
  tests: Test the previously mishandled PCI VPD characters
  Don't overwrite error message from 'virXPathNodeSet'
  tests: virpcivpdtest: Remove 'testVirPCIVPDReadVPDBytes' case
  util: virpcivpd: Unexport 'virPCIVPDReadVPDBytes'
  util: pcivpd: Unexport virPCIVPDParseVPDLargeResourceFields
  tests: virpcivpd: Remove 'testVirPCIVPDParseVPDStringResource' case
  util: virpcivpd: Unexport 'virPCIVPDParseVPDLargeResourceString'
  virPCIVPDResourceGetKeywordPrefix: Fix logging
  util: virpcivpd: Remove return value from
    virPCIVPDResourceCustomUpsertValue
  conf: virNodeDeviceCapVPDParse*: Remove pointless NULL checks
  virpcivpdtest: testPCIVPDResourceBasic: Remove tests for uninitialized
    'ro'/'rw' section
  util: virPCIVPDResourceUpdateKeyword: Remove impossible checks
  conf: node_device: Refactor 'virNodeDeviceCapVPDParseCustomFields' to
    fix error reporting
  virNodeDeviceCapVPDParseXML: Fix error reporting
  util: virpcivpd: Remove return value from
    virPCIVPDResourceUpdateKeyword
  virPCIDeviceHasVPD: Refactor "debug" messages
  virPCIDeviceGetVPD: Fix multiple error handling bugs
  virPCIDeviceGetVPD: Handle errors in callers
  virPCIVPDReadVPDBytes: Refactor error handling
  virPCIVPDParseVPDLargeResourceString: Properly report errors
  virPCIVPDParseVPDLargeResourceFields: Merge logic conditions
  virPCIVPDParseVPDLargeResourceFields: Remove impossible 'default'
    swithch case
  virPCIVPDParseVPDLargeResourceFields: Refactor processing of read data
  virPCIVPDParseVPDLargeResourceFields: Refactor return logic
  virPCIVPDParseVPDLargeResourceFields: Report proper errors
  virPCIVPDParse: Do reasonable error reporting

 src/conf/domain_conf.c                        |  78 +--
 src/conf/network_conf.c                       |  80 +--
 src/conf/node_device_conf.c                   | 177 +++----
 src/conf/numa_conf.c                          |  15 +-
 src/conf/schemas/nodedev.rng                  |   2 +-
 src/cpu/cpu_ppc64.c                           |   5 +-
 src/libvirt_private.syms                      |   3 -
 src/qemu/qemu_capabilities.c                  |  30 +-
 src/qemu/qemu_domain.c                        |  23 +-
 src/qemu/qemu_migration_cookie.c              |   5 +-
 src/qemu/qemu_nbdkit.c                        |   5 +-
 src/util/virpci.c                             |  34 +-
 src/util/virpcivpd.c                          | 454 ++++++++----------
 src/util/virpcivpd.h                          |   8 +-
 src/util/virpcivpdpriv.h                      |  11 +-
 src/vz/vz_sdk.c                               |   5 +-
 .../pci_0000_42_00_0_vpd.xml                  |   4 +-
 tests/virpcimock.c                            |   4 +-
 tests/virpcitest.c                            |   3 +-
 tests/virpcivpdtest.c                         | 160 +-----
 20 files changed, 386 insertions(+), 720 deletions(-)

-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH 00/31] pci vpd: Fix broken XML formatter and refactor questionable error reporting
Posted by Ján Tomko 2 months, 3 weeks ago
On a Tuesday in 2024, Peter Krempa wrote:
>The first part of the series fixes the XML formatter of nodedevs to not
>generate invalid XML if a PCI device custom field contains '>' which
>would be printed unescaped
>
>The rest fixes questionable and broken error reporting from the pci vpd
>device code which actually parses the above data.
>
> https://gitlab.com/pipo.sk/libvirt/-/pipelines/1157912774
>
>Peter Krempa (31):
>  virPCIVPDResourceIsValidTextValue: Adjust comment to reflect actual
>    code
>  util: pcivpd: Refactor virPCIVPDResourceIsValidTextValue
>  virNodeDeviceCapVPDFormatCustom*: Escape unsanitized strings
>  virNodeDeviceCapVPDFormat: Properly escape system-originated strings
>  schema: nodedev: Adjust allowed characters in 'vpdFieldValueFormat'
>  tests: Test the previously mishandled PCI VPD characters
>  Don't overwrite error message from 'virXPathNodeSet'
>  tests: virpcivpdtest: Remove 'testVirPCIVPDReadVPDBytes' case
>  util: virpcivpd: Unexport 'virPCIVPDReadVPDBytes'
>  util: pcivpd: Unexport virPCIVPDParseVPDLargeResourceFields
>  tests: virpcivpd: Remove 'testVirPCIVPDParseVPDStringResource' case
>  util: virpcivpd: Unexport 'virPCIVPDParseVPDLargeResourceString'
>  virPCIVPDResourceGetKeywordPrefix: Fix logging
>  util: virpcivpd: Remove return value from
>    virPCIVPDResourceCustomUpsertValue
>  conf: virNodeDeviceCapVPDParse*: Remove pointless NULL checks
>  virpcivpdtest: testPCIVPDResourceBasic: Remove tests for uninitialized
>    'ro'/'rw' section
>  util: virPCIVPDResourceUpdateKeyword: Remove impossible checks
>  conf: node_device: Refactor 'virNodeDeviceCapVPDParseCustomFields' to
>    fix error reporting
>  virNodeDeviceCapVPDParseXML: Fix error reporting
>  util: virpcivpd: Remove return value from
>    virPCIVPDResourceUpdateKeyword
>  virPCIDeviceHasVPD: Refactor "debug" messages
>  virPCIDeviceGetVPD: Fix multiple error handling bugs
>  virPCIDeviceGetVPD: Handle errors in callers
>  virPCIVPDReadVPDBytes: Refactor error handling
>  virPCIVPDParseVPDLargeResourceString: Properly report errors
>  virPCIVPDParseVPDLargeResourceFields: Merge logic conditions
>  virPCIVPDParseVPDLargeResourceFields: Remove impossible 'default'
>    swithch case
>  virPCIVPDParseVPDLargeResourceFields: Refactor processing of read data
>  virPCIVPDParseVPDLargeResourceFields: Refactor return logic
>  virPCIVPDParseVPDLargeResourceFields: Report proper errors
>  virPCIVPDParse: Do reasonable error reporting
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org