[PATCH 0/7] Remove last instances of looped XML element lookup from domain_conf.c

Peter Krempa posted 7 patches 1 year, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1675350966.git.pkrempa@redhat.com
src/conf/device_conf.c                    | 16 +---
src/conf/domain_conf.c                    | 97 +++++++++++------------
src/conf/domain_conf.h                    | 31 +++-----
src/conf/netdev_vport_profile_conf.c      | 20 ++---
src/conf/network_conf.c                   | 28 ++-----
src/conf/virconftypes.h                   |  2 -
src/hypervisor/virhostdev.c               | 25 +++---
src/util/virbitmap.c                      |  4 +-
src/util/virbitmap.h                      |  2 +-
tests/qemustatusxml2xmldata/modern-in.xml | 12 +++
10 files changed, 107 insertions(+), 130 deletions(-)
[PATCH 0/7] Remove last instances of looped XML element lookup from domain_conf.c
Posted by Peter Krempa 1 year, 3 months ago
Had this around for a while but it needed some finishing touches.

This ousts the last loop-based XML parser iterating over XML nodes and
replaces it by something more modern, fixing a few bugs i the process
and cleaning stuff up.

There are a few of such parsers still around e.g in the network XML
parsing part.

Peter Krempa (7):
  virPCIDeviceAddressParseXML: Use virXMLNodeGetSubelement to find
    'zpci'
  virNetDevVPortProfileParse: Use virXMLNodeGetSubelement to find
    '<parameters>'
  virNetworkDHCPRangeDefParseXML: Use virXMLNodeGetSubelement to find
    'lease'
  virNetworkDHCPHostDefParseXML: Use virXMLNodeGetSubelement to find
    'lease'
  virBitmapIsBitSet: Allow NULL bitmap
  qemustatusxml2xmltest: Add test data for testing '<origstates>' of PCI
    hostdev
  conf: Store 'origstates' of PCI hostdevs in a bitmap

 src/conf/device_conf.c                    | 16 +---
 src/conf/domain_conf.c                    | 97 +++++++++++------------
 src/conf/domain_conf.h                    | 31 +++-----
 src/conf/netdev_vport_profile_conf.c      | 20 ++---
 src/conf/network_conf.c                   | 28 ++-----
 src/conf/virconftypes.h                   |  2 -
 src/hypervisor/virhostdev.c               | 25 +++---
 src/util/virbitmap.c                      |  4 +-
 src/util/virbitmap.h                      |  2 +-
 tests/qemustatusxml2xmldata/modern-in.xml | 12 +++
 10 files changed, 107 insertions(+), 130 deletions(-)

-- 
2.39.1
Re: [PATCH 0/7] Remove last instances of looped XML element lookup from domain_conf.c
Posted by Martin Kletzander 1 year, 3 months ago
On Thu, Feb 02, 2023 at 04:18:03PM +0100, Peter Krempa wrote:
>Had this around for a while but it needed some finishing touches.
>
>This ousts the last loop-based XML parser iterating over XML nodes and
>replaces it by something more modern, fixing a few bugs i the process
>and cleaning stuff up.
>
>There are a few of such parsers still around e.g in the network XML
>parsing part.
>
>Peter Krempa (7):
>  virPCIDeviceAddressParseXML: Use virXMLNodeGetSubelement to find
>    'zpci'
>  virNetDevVPortProfileParse: Use virXMLNodeGetSubelement to find
>    '<parameters>'
>  virNetworkDHCPRangeDefParseXML: Use virXMLNodeGetSubelement to find
>    'lease'
>  virNetworkDHCPHostDefParseXML: Use virXMLNodeGetSubelement to find
>    'lease'
>  virBitmapIsBitSet: Allow NULL bitmap
>  qemustatusxml2xmltest: Add test data for testing '<origstates>' of PCI
>    hostdev
>  conf: Store 'origstates' of PCI hostdevs in a bitmap
>

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

> src/conf/device_conf.c                    | 16 +---
> src/conf/domain_conf.c                    | 97 +++++++++++------------
> src/conf/domain_conf.h                    | 31 +++-----
> src/conf/netdev_vport_profile_conf.c      | 20 ++---
> src/conf/network_conf.c                   | 28 ++-----
> src/conf/virconftypes.h                   |  2 -
> src/hypervisor/virhostdev.c               | 25 +++---
> src/util/virbitmap.c                      |  4 +-
> src/util/virbitmap.h                      |  2 +-
> tests/qemustatusxml2xmldata/modern-in.xml | 12 +++
> 10 files changed, 107 insertions(+), 130 deletions(-)
>
>-- 
>2.39.1
>
Re: [PATCH 0/7] Remove last instances of looped XML element lookup from domain_conf.c
Posted by Ján Tomko 1 year, 3 months ago
On a Thursday in 2023, Peter Krempa wrote:
>Had this around for a while but it needed some finishing touches.
>
>This ousts the last loop-based XML parser iterating over XML nodes and
>replaces it by something more modern, fixing a few bugs i the process

s/ i / in /

>and cleaning stuff up.
>
>There are a few of such parsers still around e.g in the network XML
>parsing part.
>
>Peter Krempa (7):
>  virPCIDeviceAddressParseXML: Use virXMLNodeGetSubelement to find
>    'zpci'
>  virNetDevVPortProfileParse: Use virXMLNodeGetSubelement to find
>    '<parameters>'
>  virNetworkDHCPRangeDefParseXML: Use virXMLNodeGetSubelement to find
>    'lease'
>  virNetworkDHCPHostDefParseXML: Use virXMLNodeGetSubelement to find
>    'lease'
>  virBitmapIsBitSet: Allow NULL bitmap
>  qemustatusxml2xmltest: Add test data for testing '<origstates>' of PCI
>    hostdev
>  conf: Store 'origstates' of PCI hostdevs in a bitmap
>
> src/conf/device_conf.c                    | 16 +---
> src/conf/domain_conf.c                    | 97 +++++++++++------------
> src/conf/domain_conf.h                    | 31 +++-----
> src/conf/netdev_vport_profile_conf.c      | 20 ++---
> src/conf/network_conf.c                   | 28 ++-----
> src/conf/virconftypes.h                   |  2 -
> src/hypervisor/virhostdev.c               | 25 +++---
> src/util/virbitmap.c                      |  4 +-
> src/util/virbitmap.h                      |  2 +-
> tests/qemustatusxml2xmldata/modern-in.xml | 12 +++
> 10 files changed, 107 insertions(+), 130 deletions(-)
>

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

Jano