Re: [PATCH] .gitignore: Ignore cscope and other *tags files

2023-02-02 Thread Erik Skultety
On Thu, Feb 02, 2023 at 02:02:13PM -0500, Laine Stump wrote: > On 2/2/23 10:37 AM, Martin Kletzander wrote: > > Commit f7114e61dbc2 cleaned up way too much and now that I have cscope > > working again I noticed there are some files that ought to stay ignored. > > > > Signed-off-by: Martin

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

2023-02-02 Thread Ján Tomko
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

[PATCH 1/5] virbitmap: Allow NULL bitmap in functions returning index of a set/clear bit

2023-02-02 Thread Peter Krempa
virBitmapNextSetBit/virBitmapLastSetBit/virBitmapNextClearBit can be used for iteration of a bitmap. Allow NULL bitmap so that iteration of a bitmap can be simplified in certain cases. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 9 + src/util/virbitmap.h | 9 +++-- 2

[PATCH 0/5] Various (json related) cleanups

2023-02-02 Thread Peter Krempa
Some more patches from old branches that I didn't get around finishing before. Peter Krempa (5): virbitmap: Allow NULL bitmap in functions returning index of a set/clear bit qemuMonitorJSONQueryStats: Simplify logic to construct 'provider_list' qemu_monitor_json: Replace simplify

[PATCH 2/5] qemuMonitorJSONQueryStats: Simplify logic to construct 'provider_list'

2023-02-02 Thread Peter Krempa
Simplify construction of a single provider by using virJSONValueObjectAdd and restructuring the code. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 32 ++-- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c

[PATCH 5/5] qemuDomainGetStatsVcpu: Refactor cleanup

2023-02-02 Thread Peter Krempa
Automatically free 'cpuinfo' and remove the cleanup label and ret variable. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[PATCH 4/5] qemu: agent: Use virJSONValueObjectGetArray

2023-02-02 Thread Peter Krempa
Replace virJSONValueObjectGet + virJSONValueIsArray by the single API which returns only an array. Signed-off-by: Peter Krempa --- src/qemu/qemu_agent.c | 29 + 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_agent.c

Re: [PATCH 7/7] conf: Store 'origstates' of PCI hostdevs in a bitmap

2023-02-02 Thread Ján Tomko
On a Thursday in 2023, Peter Krempa wrote: Refactor the code to use a bitmap with an enum to avoid ugly XML parser. Looking at the new code, I think I'd end this sentence early: Refactor the code to use a bitmap with an enum. Jano Signed-off-by: Peter Krempa --- src/conf/domain_conf.c

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

2023-02-02 Thread Martin Kletzander
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.

[PATCH 3/5] qemu_monitor_json: Replace simplify fetching Array from JSON object

2023-02-02 Thread Peter Krempa
Replace instances of virJSONValueObjectGet + virJSONValueIsArray by virJSONValueObjectGetArray. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c

[PATCH 2/2] conf: Use proper type for 'type' field of struct _virDomainDeviceDef

2023-02-02 Thread Peter Krempa
Use virDomainDeviceType as type and update all switch statements which didn't mention all possible values. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 2 +- src/hyperv/hyperv_driver.c | 28 ++- src/libxl/libxl_driver.c | 158

[PATCH 1/2] virDomainDeviceDefParse: Separate code for parsing type

2023-02-02 Thread Peter Krempa
Move the code into a new function named virDomainDeviceDefParseType. The separation will make it easier to change the type of the 'type' field in side of virDomainDeviceDef. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 43 +++--- 1 file changed,

[PATCH] .gitignore: Ignore cscope and other *tags files

2023-02-02 Thread Martin Kletzander
Commit f7114e61dbc2 cleaned up way too much and now that I have cscope working again I noticed there are some files that ought to stay ignored. Signed-off-by: Martin Kletzander --- .gitignore | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore

Re: [PATCH 1/7] virPCIDeviceAddressParseXML: Use virXMLNodeGetSubelement to find 'zpci'

2023-02-02 Thread Martin Kletzander
On Thu, Feb 02, 2023 at 04:18:04PM +0100, Peter Krempa wrote: Use the helper designed to find the subelement. A slight semantic difference after this patch is that the first element will be considered instead of the last, but only one is expected in a valid XML. Signed-off-by: Peter Krempa

[PATCH 0/2] conf: Turn virDomainDeviceDef->type into proper type

2023-02-02 Thread Peter Krempa
Some more patch necromancy. Pipeline: https://gitlab.com/pipo.sk/libvirt/-/pipelines/765613613 Peter Krempa (2): virDomainDeviceDefParse: Separate code for parsing type conf: Use proper type for 'type' field of struct _virDomainDeviceDef src/conf/domain_conf.c | 43 ++

[PATCH 4/7] virNetworkDHCPHostDefParseXML: Use virXMLNodeGetSubelement to find 'lease'

2023-02-02 Thread Peter Krempa
This also prevents a potential memleak when multiple elements would be present. Signed-off-by: Peter Krempa --- src/conf/network_conf.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index

[PATCH 7/7] conf: Store 'origstates' of PCI hostdevs in a bitmap

2023-02-02 Thread Peter Krempa
Refactor the code to use a bitmap with an enum to avoid ugly XML parser. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 97 ++--- src/conf/domain_conf.h | 31 src/conf/virconftypes.h | 2 - src/hypervisor/virhostdev.c | 25

[PATCH 3/7] virNetworkDHCPRangeDefParseXML: Use virXMLNodeGetSubelement to find 'lease'

2023-02-02 Thread Peter Krempa
This also prevents a potential memleak when multiple elements would be present. Signed-off-by: Peter Krempa --- src/conf/network_conf.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index

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

2023-02-02 Thread Peter Krempa
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

[PATCH 6/7] qemustatusxml2xmltest: Add test data for testing '' of PCI hostdev

2023-02-02 Thread Peter Krempa
The XML element captures private data of a PCI device needed to restore it after a VM is started. Unfortunately at the point when it was added we didn't yet have the existing private data infrastructure. Since the element is parsed only in cases similar to the status XML we need to test it

[PATCH 2/7] virNetDevVPortProfileParse: Use virXMLNodeGetSubelement to find ''

2023-02-02 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/netdev_vport_profile_conf.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c index cdde7efcd9..26f379248f 100644 ---

[PATCH 5/7] virBitmapIsBitSet: Allow NULL bitmap

2023-02-02 Thread Peter Krempa
The virBitmapIsBitSet API is a permissive one which returns false when the bit is not set or is out of range. We can do the same if the bitmap is NULL to aid certain situations when this can happen, but we don't want to add extra checks. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 4

[PATCH 1/7] virPCIDeviceAddressParseXML: Use virXMLNodeGetSubelement to find 'zpci'

2023-02-02 Thread Peter Krempa
Use the helper designed to find the subelement. A slight semantic difference after this patch is that the first element will be considered instead of the last, but only one is expected in a valid XML. Signed-off-by: Peter Krempa --- src/conf/device_conf.c | 16 1 file changed,

Re: [PATCH] .gitignore: Ignore cscope and other *tags files

2023-02-02 Thread Ján Tomko
On a Thursday in 2023, Martin Kletzander wrote: Commit f7114e61dbc2 cleaned up way too much and now that I have cscope working again I noticed there are some files that ought to stay ignored. Signed-off-by: Martin Kletzander --- .gitignore | 12 +++- 1 file changed, 11 insertions(+), 1

[PATCH 1/2] docs: Fix examples in virt-qemu-sev-validate man page

2023-02-02 Thread Jim Fehlig
Some of the examples refer to virt-dom-sev-validate. Replace them with the proper name. Signed-off-by: Jim Fehlig --- docs/manpages/virt-qemu-sev-validate.rst | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/manpages/virt-qemu-sev-validate.rst

[PATCH 2/2] tools: Fix detection of remote libvirt access in virt-qemu-sev-validate

2023-02-02 Thread Jim Fehlig
The VM's firmware path is not extracted from the XML when invoking virt-qemu-sev-validate in insecure mode and connecting to the local libvirt virt-qemu-sev-validate --insecure --tk tek-tik.bin --domain test-sev-es ERROR: Cannot access firmware path remotely The test for remote access compares

[PATCH 0/2] tools: A few small fixes for virt-qemu-sev-validate

2023-02-02 Thread Jim Fehlig
See patches for details. Jim Fehlig (2): docs: Fix examples in virt-qemu-sev-validate man page tools: Fix detection of remote libvirt access in virt-qemu-sev-validate docs/manpages/virt-qemu-sev-validate.rst | 24 tools/virt-qemu-sev-validate | 2 +-

Re: [PATCH] .gitignore: Ignore cscope and other *tags files

2023-02-02 Thread Laine Stump
On 2/2/23 10:37 AM, Martin Kletzander wrote: Commit f7114e61dbc2 cleaned up way too much and now that I have cscope working again I noticed there are some files that ought to stay ignored. Signed-off-by: Martin Kletzander Reviewed-by-with-prejudice: Laine Stump I had sent a patch a year or