Re: [libvirt PATCH 10/11] domain_capabilities: Add blockers attribute for CPU models

2022-10-04 Thread Jiri Denemark
> On Tue, Oct 04, 2022 at 07:35:31PM +0200, Jiri Denemark wrote: > > On Tue, Oct 04, 2022 at 17:34:34 +0100, Daniel P. Berrangé wrote: > > > On Tue, Oct 04, 2022 at 04:28:53PM +0200, Jiri Denemark wrote: > > > > We already show whether a specific CPU model is usable on the current > > > > host

Re: [libvirt PATCH 10/11] domain_capabilities: Add blockers attribute for CPU models

2022-10-04 Thread Daniel P . Berrangé
On Tue, Oct 04, 2022 at 07:35:31PM +0200, Jiri Denemark wrote: > On Tue, Oct 04, 2022 at 17:34:34 +0100, Daniel P. Berrangé wrote: > > On Tue, Oct 04, 2022 at 04:28:53PM +0200, Jiri Denemark wrote: > > > We already show whether a specific CPU model is usable on the current > > > host without

Re: [libvirt PATCH 10/11] domain_capabilities: Add blockers attribute for CPU models

2022-10-04 Thread Jiri Denemark
On Tue, Oct 04, 2022 at 17:34:34 +0100, Daniel P. Berrangé wrote: > On Tue, Oct 04, 2022 at 04:28:53PM +0200, Jiri Denemark wrote: > > We already show whether a specific CPU model is usable on the current > > host without modification via the 'usable' attribute of each CPU model. > > But it may be

Re: [libvirt PATCH 10/11] domain_capabilities: Add blockers attribute for CPU models

2022-10-04 Thread Daniel P . Berrangé
On Tue, Oct 04, 2022 at 04:28:53PM +0200, Jiri Denemark wrote: > We already show whether a specific CPU model is usable on the current > host without modification via the 'usable' attribute of each CPU model. > But it may be useful to actually see what features are blocking each CPU > model from

Re: [PATCH v2 0/2] qemu: tpm: Improve TPM state files management

2022-10-04 Thread Stefan Berger
On 10/4/22 11:48, Michal Prívozník wrote: On 10/4/22 17:33, Stefan Berger wrote: On 10/4/22 10:39, Michal Prívozník wrote: Reviewed-by: Michal Privoznik and pushed. Thanks. Regarding shared storage and migration. Should shared storage support be implemented using an XML attribute

Re: [libvirt PATCH 00/11] Improve CPU model reporting in domain capabilities

2022-10-04 Thread Ján Tomko
On a Tuesday in 2022, Jiri Denemark wrote: See patches 04/11 and 10/11 for details. Patches 4, 6, and 10 were truncated as they include a lot of boring changes in tests, complete patches are available in my gitlab repo: git fetch g...@gitlab.com:jirkade/libvirt.git domaincaps Jiri Denemark

Re: [libvirt PATCH 04/11] domain_capabilities: Add vendor attribute for CPU models

2022-10-04 Thread Ján Tomko
On a Tuesday in 2022, Jiri Denemark wrote: Even though several CPU models from various vendors are reported as usable on a given host, user may still want to use only those that match the host vendor. Currently the only place where users can check the vendor of each CPU model is our CPU map,

Re: [PATCH v2 0/2] qemu: tpm: Improve TPM state files management

2022-10-04 Thread Michal Prívozník
On 10/4/22 17:33, Stefan Berger wrote: > > > On 10/4/22 10:39, Michal Prívozník wrote: > >>> >> >> Reviewed-by: Michal Privoznik >> >> and pushed. > > Thanks. > > Regarding shared storage and migration. Should shared storage support be > implemented using an XML attribute or through a new 

Re: [PATCH 00/43] XML parsing helper cleanup

2022-10-04 Thread Ján Tomko
On a Tuesday in 2022, Peter Krempa wrote: This series cleans up the use of virXMLParse* macros and tries to unify and remove the uncommon ones. In next step since virXMLParse itself has features which can replace open-coded bits in conf parsers for all various object types we have, this series

Re: [PATCH v2 0/2] qemu: tpm: Improve TPM state files management

2022-10-04 Thread Stefan Berger
On 10/4/22 10:39, Michal Prívozník wrote: Reviewed-by: Michal Privoznik and pushed. Thanks. Regarding shared storage and migration. Should shared storage support be implemented using an XML attribute or through a new migration option (--tpm-shared-storage)? The previously proposed

Re: [PATCH 01/43] util: xml: Expose all arguments of virXMLParseHelper in virXMLParse macro

2022-10-04 Thread Ján Tomko
On a Tuesday in 2022, Peter Krempa wrote: The generic helper also has helper code to validate the root element and create an XPath context. Many places in the code duplicate code for doing these operations. Extend the helper to provide all arguments and fix all callers. In many cases this

Re: [PATCH v2 0/2] qemu: tpm: Improve TPM state files management

2022-10-04 Thread Michal Prívozník
On 10/4/22 15:38, Stefan Berger wrote: > This series of patches adds the --keep-tpm and --tpm flags to virsh for > keeping and removing the TPM state directory structure when a VM is > undefined. It also fixes the removal of state when a VM is migrated so > that the state files are removed on the

Re: [PATCH v2 2/2] qemu: tpm: Remove TPM state after successful migration

2022-10-04 Thread Michal Prívozník
On 10/4/22 15:38, Stefan Berger wrote: > This patch 'fixes' the behavior of the persistent_state TPM domain XML > attribute that intends to preserve the state of the TPM but should not > keep the state around on all the hosts a VM has been migrated to. It > removes the TPM state directory

Re: [libvirt PATCH 11/11] NEWS: Document domain capabilities improvements

2022-10-04 Thread Jiri Denemark
On Tue, Oct 04, 2022 at 16:28:54 +0200, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > NEWS.rst | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/NEWS.rst b/NEWS.rst > index 3049aa83f9..802d96d4ca 100644 > --- a/NEWS.rst > +++ b/NEWS.rst > @@ -19,6 +19,17 @@

[libvirt PATCH 08/11] cpu_arm: Don't implement virCPUGetVendorForModel

2022-10-04 Thread Jiri Denemark
This patch is effectively a no-op, but I wanted to initialize .getVendorForModel explicitly as implementing this function does not even make sense on ARM. The CPU models in our CPU map are only used for describing host CPU in capabilities XML and cannot be used for guest CPU definition in domain

[libvirt PATCH 07/11] cpu_ppc64: Implement virCPUGetVendorForModel

2022-10-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/cpu/cpu_ppc64.c | 20 tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +++--- tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 8 tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 8

[libvirt PATCH 11/11] NEWS: Document domain capabilities improvements

2022-10-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- NEWS.rst | 11 +++ 1 file changed, 11 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 3049aa83f9..802d96d4ca 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -19,6 +19,17 @@ v8.9.0 (unreleased) * **Improvements** + * Add vendor attribute for CPU models

[libvirt PATCH 05/11] Introduce virCPUGetVendorForModel and use it in QEMU driver

2022-10-04 Thread Jiri Denemark
So far QEMU driver does not get CPU model vendor from QEMU directly and it has to ask the CPU driver for the info stored in CPU map. Signed-off-by: Jiri Denemark --- src/cpu/cpu.c| 25 + src/cpu/cpu.h| 8 src/libvirt_private.syms

[libvirt PATCH 06/11] cpu_x86: Implement virCPUGetVendorForModel

2022-10-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 19 .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 88 - .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 88 - tests/domaincapsdata/qemu_4.2.0.x86_64.xml| 88

[libvirt PATCH 10/11] domain_capabilities: Add blockers attribute for CPU models

2022-10-04 Thread Jiri Denemark
We already show whether a specific CPU model is usable on the current host without modification via the 'usable' attribute of each CPU model. But it may be useful to actually see what features are blocking each CPU model from being usable. Especially when we already fetch the info from QEMU and

[libvirt PATCH 00/11] Improve CPU model reporting in domain capabilities

2022-10-04 Thread Jiri Denemark
See patches 04/11 and 10/11 for details. Patches 4, 6, and 10 were truncated as they include a lot of boring changes in tests, complete patches are available in my gitlab repo: git fetch g...@gitlab.com:jirkade/libvirt.git domaincaps Jiri Denemark (11): conf: virDomainCapsCPUModelsAdd

[libvirt PATCH 04/11] domain_capabilities: Add vendor attribute for CPU models

2022-10-04 Thread Jiri Denemark
Even though several CPU models from various vendors are reported as usable on a given host, user may still want to use only those that match the host vendor. Currently the only place where users can check the vendor of each CPU model is our CPU map, which is considered internal and users should

[libvirt PATCH 09/11] qemu_capabilities: Translate CPU blockers

2022-10-04 Thread Jiri Denemark
The list of features reported by QEMU as blocking a particular CPU model on the current host cannot be directly used by libvirt (or its users) as QEMU uses different names for some features. We need to translate them before using them or presenting them to users. Signed-off-by: Jiri Denemark ---

[libvirt PATCH 01/11] conf: virDomainCapsCPUModelsAdd never fails

2022-10-04 Thread Jiri Denemark
Since the function always returns 0, we can just return void and make callers simpler. Signed-off-by: Jiri Denemark --- src/conf/domain_capabilities.c | 24 +--- src/conf/domain_capabilities.h | 11 ++- src/qemu/qemu_capabilities.c | 9 - tests/cputest.c

[libvirt PATCH 02/11] cpu_ppc64: Avoid repeated loading of CPU map

2022-10-04 Thread Jiri Denemark
The ppc64 CPU code still has to load and parse the CPU map everytime it needs to look at it, which can make some operations pretty slow. Other archs already switched to loading the CPU map once and keeping the parsed structure in memory. Let's switch ppc64 as well. Signed-off-by: Jiri Denemark

[libvirt PATCH 03/11] qemu: Do not pass qemuCaps to virQEMUCapsCPUFeature{To, From}QEMU

2022-10-04 Thread Jiri Denemark
The only part of qemuCaps both functions are interested in is the CPU architecture. Changing them to expect just virArch makes the functions more reusable. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 18 +- src/qemu/qemu_capabilities.h | 4 ++--

[PATCH v2 2/2] qemu: tpm: Remove TPM state after successful migration

2022-10-04 Thread Stefan Berger
This patch 'fixes' the behavior of the persistent_state TPM domain XML attribute that intends to preserve the state of the TPM but should not keep the state around on all the hosts a VM has been migrated to. It removes the TPM state directory structure from the source host upon successful

[PATCH v2 1/2] qemu: Add UNDEFINE_TPM and UNDEFINE_KEEP_TPM flags

2022-10-04 Thread Stefan Berger
Add UNDEFINE_TPM and UNDEFINE_KEEP_TPM flags to qemuDomainUndefineFlags() API and --tpm and --keep-tpm to 'virsh undefine'. Pass the virDomainUndefineFlagsValues via qemuDomainRemoveInactive() from qemuDomainUndefineFlags() all the way down to qemuTPMEmulatorCleanupHost() and delete TPM storage

[PATCH v2 0/2] qemu: tpm: Improve TPM state files management

2022-10-04 Thread Stefan Berger
This series of patches adds the --keep-tpm and --tpm flags to virsh for keeping and removing the TPM state directory structure when a VM is undefined. It also fixes the removal of state when a VM is migrated so that the state files are removed on the source upon successful migration and deleted on

[libvirt PATCH 1/2] ci: adapt integration test dependencies for job rename

2022-10-04 Thread Daniel P . Berrangé
The jobs in other libvirt projects have all been renamed, due to the need to have two parallel sets of jobs for different execution scenarios. Since the integration tests are targetting 'master' branch pipelines in the external repos, we need to reference the '-prebuilt-env' variants of the jobs.

[libvirt PATCH 0/2] ci: stop triggering CI jobs on branch push by default

2022-10-04 Thread Daniel P . Berrangé
This series refreshes the CI config with lcitool, which brings in a very significant architectural and operational change. * Contributor forks will never create container images anymore, only the master upstream. If a user makes a CI change, it will test the changes in a throwaway

Re: [PATCH v2] rpc: fix memory leak in virNetServerClientNew and virNetServerProgramDispatchCall

2022-10-04 Thread Michal Prívozník
On 10/4/22 13:50, Peng Liang wrote: > > > On 10/04/2022 19:43, Michal Prívozník wrote: >> On 10/4/22 12:24, Peng Liang wrote: >>> >>> >>> On 10/03/2022 15:38, Michal Prívozník wrote: On 10/1/22 05:35, Peng Liang wrote: > > > On 09/29/2022 21:31, Michal Prívozník wrote: >> On

Re: [PATCH v2] rpc: fix memory leak in virNetServerClientNew and virNetServerProgramDispatchCall

2022-10-04 Thread Peng Liang
On 10/04/2022 19:43, Michal Prívozník wrote: On 10/4/22 12:24, Peng Liang wrote: On 10/03/2022 15:38, Michal Prívozník wrote: On 10/1/22 05:35, Peng Liang wrote: On 09/29/2022 21:31, Michal Prívozník wrote: On 9/27/22 17:38, Jiang Jiacheng wrote: From: jiangjiacheng In

Re: [PATCH v2] rpc: fix memory leak in virNetServerClientNew and virNetServerProgramDispatchCall

2022-10-04 Thread Michal Prívozník
On 10/4/22 12:24, Peng Liang wrote: > > > On 10/03/2022 15:38, Michal Prívozník wrote: >> On 10/1/22 05:35, Peng Liang wrote: >>> >>> >>> On 09/29/2022 21:31, Michal Prívozník wrote: On 9/27/22 17:38, Jiang Jiacheng wrote: > From: jiangjiacheng > > In

Re: [PATCH v2] rpc: fix memory leak in virNetServerClientNew and virNetServerProgramDispatchCall

2022-10-04 Thread Peng Liang
On 10/03/2022 15:38, Michal Prívozník wrote: On 10/1/22 05:35, Peng Liang wrote: On 09/29/2022 21:31, Michal Prívozník wrote: On 9/27/22 17:38, Jiang Jiacheng wrote: From: jiangjiacheng In virNetServerProgramDispatchCall, The arg is passed as a void* and used to point to a certain

[PATCH 43/43] util: xml: Remove virXMLParseStringCtxtRoot

2022-10-04 Thread Peter Krempa
Remove the seldom used helper in favor of full virXMLParse. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 6 -- src/conf/storage_conf.c | 6 ++ src/util/virxml.h | 4 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c

[PATCH 26/43] conf: node_device: Remove virNodeDeviceDefParseNode

2022-10-04 Thread Peter Krempa
Both callers be easily made to call virNodeDeviceDefParseXML directly. Signed-off-by: Peter Krempa --- src/conf/node_device_conf.c | 34 ++ src/conf/node_device_conf.h | 7 +++ src/libvirt_private.syms| 2 +- src/test/test_driver.c | 7 +++ 4

[PATCH 37/43] qemu: capabilities: Convert virQEMUCapsLoadCache to virXMLParse

2022-10-04 Thread Peter Krempa
Use virXMLParse so that the code doesn't have to explicitly allocate an XPath context and validate the root element. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/qemu/qemu_capabilities.c

[PATCH 09/43] conf: networkport: Remove virNetworkPortDefParseNode

2022-10-04 Thread Peter Krempa
The function is exported but used only intenally, additionally everything it did for the only caller can be replaced by properly using virXMLParse. Signed-off-by: Peter Krempa --- src/conf/virnetworkportdef.c | 32 +--- src/conf/virnetworkportdef.h | 4

[PATCH 22/43] conf: checkpoint: Remove virDomainCheckpointDefParseNode

2022-10-04 Thread Peter Krempa
Replace all it does by properly using virXMLParse. Signed-off-by: Peter Krempa --- src/conf/checkpoint_conf.c | 36 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index

[PATCH 39/43] util: xml: Remove virXMLParseCtxt

2022-10-04 Thread Peter Krempa
Convert the two outstanding uses to virXMLParseFileCtxt as they always pass a filename and remove the helper macro. Signed-off-by: Peter Krempa --- src/conf/virnetworkobj.c | 2 +- src/conf/virstorageobj.c | 2 +- src/util/virxml.h| 15 --- 3 files changed, 2

[PATCH 42/43] test_driver: Make callers of testOpenParse ensure the root element name

2022-10-04 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/test/test_driver.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 373e5f7846..8675f8ad07 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1306,12

[PATCH 25/43] conf: nwfilter: Provide only virNWFilterDefParse

2022-10-04 Thread Peter Krempa
Replace virNWFilterDefParseString/File with the common function. Signed-off-by: Peter Krempa --- src/conf/nwfilter_conf.c | 17 + src/conf/nwfilter_conf.h | 8 +++- src/conf/virnwfilterobj.c| 2 +- src/libvirt_private.syms | 3 +--

[PATCH 38/43] util: xml: Remove virXMLParseFile

2022-10-04 Thread Peter Krempa
Most callers prefer using the XPath context. Convert the last user to use virXMLParseFileCtxt and remove the helper macro. Signed-off-by: Peter Krempa --- src/util/virxml.h | 11 --- tests/virschematest.c | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git

[PATCH 40/43] conf: savecookie: Remove virSaveCookieParseNode

2022-10-04 Thread Peter Krempa
The function provided just checking of the root XML node name which can be easily moved into the caller wich doesn't do that already and checking of the pointers which is trivial. Remove the helper. Signed-off-by: Peter Krempa --- src/conf/virsavecookie.c | 31 +++ 1

[PATCH 21/43] prlsdkParseSnapshotTree: Simplify XML parsing code

2022-10-04 Thread Peter Krempa
Use features of virXMLParse to validate root node and fetch XPath context. Signed-off-by: Peter Krempa --- src/vz/vz_sdk.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 8fb7a9948d..8cd3348f5c 100644 ---

[PATCH 32/43] conf: domain: Remove virDomainObjParseNode

2022-10-04 Thread Peter Krempa
virDomainObjParseFile is the only caller of virDomainObjParseNode. The code can be merged into it, simplified by using virXMLParse and the function removed. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 36 ++-- src/conf/domain_conf.h | 4

[PATCH 12/43] testParseXMLDocFromFile: Remove 'type' argument

2022-10-04 Thread Peter Krempa
virXMLParse ignores the 'url' argument which is what 'type' was passed to it as when a filename is used as source for the XML. Signed-off-by: Peter Krempa --- src/test/test_driver.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git

[PATCH 36/43] util: xml: Remove virXMLParseString

2022-10-04 Thread Peter Krempa
Most callers use virXMLParseStringCtxt. Convert the last use case and remove the helper. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/util/virxml.h | 12 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/conf/domain_conf.c

[PATCH 35/43] virsh: Use proper helper for parsing XML in virshDumpXML

2022-10-04 Thread Peter Krempa
Use virXMLParseStringCtxt instead of virXMLParseString since the code requires a XPath context anyways. Signed-off-by: Peter Krempa --- tools/virsh-util.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/virsh-util.c b/tools/virsh-util.c index 8a20f627a1..3c4a084441

[PATCH 41/43] security: aa-helper: Use virXMLParse instead of virXMLParseString

2022-10-04 Thread Peter Krempa
Use the helper with more features to validate the root XML element name instead of open-coding it. Signed-off-by: Peter Krempa --- src/security/virt-aa-helper.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/security/virt-aa-helper.c

[PATCH 33/43] conf: domain: Simplify validation in virDomainDefParse

2022-10-04 Thread Peter Krempa
Use virXMLParse's features to validate the top level element and fetch the XPath context. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH 34/43] virDomainDefParseNode: Pass only the XPath context as argument

2022-10-04 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/checkpoint_conf.c | 6 -- src/conf/domain_conf.c | 11 ++- src/conf/domain_conf.h | 3 +-- src/conf/snapshot_conf.c | 16 ++-- src/qemu/qemu_migration_cookie.c | 10 ++

[PATCH 31/43] conf: network: Provide only virNetworkDefParse

2022-10-04 Thread Peter Krempa
Replace virNetworkDefParseString/File by direct calls to virNetworkDefParse. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/conf/network_conf.c | 21 ++--- src/conf/network_conf.h | 11 --- src/conf/virnetworkobj.c

[PATCH 28/43] conf: interface: Remove virInterfaceDefParseNode

2022-10-04 Thread Peter Krempa
Both callers be easily made to call virInterfaceDefParseXML directly. Signed-off-by: Peter Krempa --- src/conf/interface_conf.c | 35 +-- src/conf/interface_conf.h | 4 ++-- src/libvirt_private.syms | 2 +- src/test/test_driver.c| 8 4 files

[PATCH 30/43] conf: network: Remove virNetworkDefParseNode

2022-10-04 Thread Peter Krempa
Both callers can be easily converted to call virNetworkDefParseXML directly. Signed-off-by: Peter Krempa --- src/conf/network_conf.c | 37 - src/conf/network_conf.h | 5 - src/libvirt_private.syms | 1 - src/test/test_driver.c | 8 4 files

[PATCH 29/43] conf: interface: Remove virInterfaceDefParseFile

2022-10-04 Thread Peter Krempa
The function was not used. Remove it and merge virInterfaceDefParse into virInterfaceDefParseString. Signed-off-by: Peter Krempa --- src/conf/interface_conf.c | 24 src/conf/interface_conf.h | 3 --- src/libvirt_private.syms | 1 - 3 files changed, 4 insertions(+),

[PATCH 27/43] conf: nodedev: Provide only virNodeDeviceDefParse

2022-10-04 Thread Peter Krempa
Replace the thin wrappers virNodeDeviceDefParseString/File by directly calling the main parser. Signed-off-by: Peter Krempa --- src/conf/node_device_conf.c | 24 +--- src/conf/node_device_conf.h | 18 ++ src/hypervisor/domain_driver.c

[PATCH 23/43] conf: backup: Remove virDomainBackupDefParseNode

2022-10-04 Thread Peter Krempa
Rename virDomainBackupDefParse to virDomainBackupDefParseXML and use it in place of virDomainBackupDefParseNode. This is possible as virXMLParse can be used to replace XPath context allocation and root node checking. Signed-off-by: Peter Krempa --- src/conf/backup_conf.c | 41

[PATCH 24/43] conf: nwfilter: Remove virNWFilterDefParseNode

2022-10-04 Thread Peter Krempa
Use virXMLParse to fetch the XML context and validate the top level XML element name so that virNWFilterDefParseNode is no longer needed. Signed-off-by: Peter Krempa --- src/conf/nwfilter_conf.c | 32 +--- src/conf/nwfilter_conf.h | 4 2 files changed, 5

[PATCH 20/43] conf: secret: Provide only virSecretDefParse

2022-10-04 Thread Peter Krempa
Replace the virSecretDefParseFile/String shims by calls to virSecretDefParse. Signed-off-by: Peter Krempa --- src/conf/secret_conf.c | 14 +- src/conf/secret_conf.h | 7 +-- src/conf/virsecretobj.c| 2 +- src/libvirt_private.syms | 3 +--

[PATCH 18/43] conf: snapshot: Remove virDomainSnapshotDefParseNode

2022-10-04 Thread Peter Krempa
Check the root XML node name and fetch XPath context by properly configuring virXMLParse. Callers can use virDomainSnapshotDefParse instead. Signed-off-by: Peter Krempa --- src/conf/snapshot_conf.c | 40 +--- src/conf/snapshot_conf.h | 13 +++--

[PATCH 19/43] conf: secret: Refactor secretXMLParseNode

2022-10-04 Thread Peter Krempa
Rename it to virSecretParseXML and move the root node validation and context fetching into the caller (by properly calling virXMLParse). Signed-off-by: Peter Krempa --- src/conf/secret_conf.c | 29 - 1 file changed, 8 insertions(+), 21 deletions(-) diff --git

[PATCH 15/43] conf: storage: Provide only virStoragePoolDefParse

2022-10-04 Thread Peter Krempa
Replace the virStoragePoolDefParseString/File thin wrappers by virStoragePoolDefParse. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/conf/storage_conf.c | 17 + src/conf/storage_conf.h | 8 +++- src/conf/virstorageobj.c

[PATCH 16/43] conf: storage: Remove virStorageVolDefParseNode

2022-10-04 Thread Peter Krempa
Proper use of virXMLParse replaces everything the function provides. Callers can use virStorageVolDefParseXML instead. Signed-off-by: Peter Krempa --- src/conf/storage_conf.c | 37 ++--- src/conf/storage_conf.h | 7 +++ src/libvirt_private.syms | 2 +-

[PATCH 14/43] conf: storage: Remove virStoragePoolDefParseNode

2022-10-04 Thread Peter Krempa
Replace it by proper use of virXMLParse to validate the root node and allocate the context. The use in the test driver can be directly replaced by virStoragePoolDefParseXML as both are validated. The change to the storage driver isn't trivial though as it requires careful xpath context juggling

[PATCH 07/43] conf: nwfilterbinding: Provide only virNWFilterBindingDefParse

2022-10-04 Thread Peter Krempa
Remove the virNWFilterBindingDefParseString/File thin wrappers. Signed-off-by: Peter Krempa --- src/conf/virnwfilterbindingdef.c | 17 + src/conf/virnwfilterbindingdef.h | 8 +++- src/libvirt_private.syms | 3 +-- src/nwfilter/nwfilter_driver.c

[PATCH 13/43] testParseXMLDocFromFile: Validate that the replaced node is identical with parsed root

2022-10-04 Thread Peter Krempa
When replacing a definition node by contents of a file the root node in the file must match the replaced node. Enforce that by passing the original node name as the 'rootnode' argument of virXMLParse. Signed-off-by: Peter Krempa --- src/test/test_driver.c | 3 ++- 1 file changed, 2

[PATCH 17/43] conf: storage: Provide only virStorageVolDefParse

2022-10-04 Thread Peter Krempa
Remove the virStorageVolDefParseFile/String shim functions. Signed-off-by: Peter Krempa --- src/conf/storage_conf.c| 20 +--- src/conf/storage_conf.h| 12 src/esx/esx_storage_backend_vmfs.c | 4 ++-- src/libvirt_private.syms | 3

[PATCH 10/43] conf: networkportdef: Provide only virNetworkPortDefParse

2022-10-04 Thread Peter Krempa
Replace the two helpers virNetworkPortDefParseString/File with the common helper. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c| 2 +- src/conf/virnetworkobj.c | 2 +- src/conf/virnetworkportdef.c | 17 + src/conf/virnetworkportdef.h |

[PATCH 11/43] testParseXMLDocFromFile: Refactor control flow

2022-10-04 Thread Peter Krempa
Move few variables definitions closer to usage, add comments explaining what's happening and simplify the control flow. Signed-off-by: Peter Krempa --- src/test/test_driver.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/test/test_driver.c

[PATCH 05/43] virVBoxSnapshotConfGet(RW|RO)DisksPathsFromLibvirtXML: Refactor

2022-10-04 Thread Peter Krempa
virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML and virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML were doing the same thing, except for one XPath query. Factor out the common code into a helper and bring it up to modern standard. Signed-off-by: Peter Krempa ---

[PATCH 01/43] util: xml: Expose all arguments of virXMLParseHelper in virXMLParse macro

2022-10-04 Thread Peter Krempa
The generic helper also has helper code to validate the root element and create an XPath context. Many places in the code duplicate code for doing these operations. Extend the helper to provide all arguments and fix all callers. In many cases this patch refactores the passing of the 'validate'

[PATCH 08/43] tests: qemuxml2argv: Use virXMLParse properly

2022-10-04 Thread Peter Krempa
Don't validate the root node and don't allocate a private XPath context when virXMLParse can do that internally. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/tests/qemuxml2argvtest.c

[PATCH 06/43] virNWFilterBindingDefParse: Properly use virXMLParse

2022-10-04 Thread Peter Krempa
Fetch the XPath context and validate the node by using virXMLParse's features. This allows to completely remove virNWFilterBindingDefParseNode as all callers now properly validate the root element name and have a XPath context handy. Signed-off-by: Peter Krempa ---

[PATCH 04/43] vbox: snapshot_conf: Don't allocate XPath context explicitly

2022-10-04 Thread Peter Krempa
Use the one provided via virXMLParse. Signed-off-by: Peter Krempa --- src/vbox/vbox_snapshot_conf.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 6dce9cdf0f..e175f1964e 100644 ---

[PATCH 02/43] conf: nwfilderbindigobj: Register automatic cleanup for virNWFilterBindingObj

2022-10-04 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/virnwfilterbindingobj.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/virnwfilterbindingobj.h b/src/conf/virnwfilterbindingobj.h index 93f693936e..17f855bda1 100644 --- a/src/conf/virnwfilterbindingobj.h +++

[PATCH 03/43] virNWFilterBindingObjParse: Refactor XML parsing code

2022-10-04 Thread Peter Krempa
Remove the redundant root node checking and XPath context creation by using virXMLParse properly. Signed-off-by: Peter Krempa --- src/conf/virnwfilterbindingobj.c | 65 +--- src/conf/virnwfilterbindingobj.h | 2 +- src/conf/virnwfilterbindingobjlist.c | 2 +-

[PATCH 00/43] XML parsing helper cleanup

2022-10-04 Thread Peter Krempa
This series cleans up the use of virXMLParse* macros and tries to unify and remove the uncommon ones. In next step since virXMLParse itself has features which can replace open-coded bits in conf parsers for all various object types we have, this series cleans them up too. Peter Krempa (43):

[RFC PATCH 0/2] logging: add service to cleanup internal log files

2022-10-04 Thread aleksandr.leskin
Hi, all. I kindly want to ask you to review our patch from Nikolay Shirokovskiy: https://listman.redhat.com/archives/libvir-list/2022-February/msg00865.html There is no answer or discussion since February and we really need  it to be done. It would be very good to apply patch in libvirt. This

Re: [libvirt PATCH v2 02/16] qemu: Add qemuNbdkitCaps to qemu driver

2022-10-04 Thread Peter Krempa
On Wed, Sep 28, 2022 at 10:51:12 -0500, Jonathon Jongsma wrote: > On 9/19/22 9:09 AM, Peter Krempa wrote: > > > > +{ > > > +qemuNbdkitCaps *nbdkit = QEMU_NBDKIT_CAPS(object); > > > + > > > +g_clear_pointer(>path, g_free); > > > +g_clear_pointer(>version, g_free); > > > +

Re: [PATCH 1/2] qemu: Add UNDEFINE_TPM and UNDEFINE_KEEP_TPM flags

2022-10-04 Thread Michal Prívozník
On 10/3/22 21:39, Stefan Berger wrote: > > > On 10/3/22 11:20, Michal Prívozník wrote: >> On 8/23/22 18:28, Stefan Berger wrote: >>> Add UNDEFINE_TPM and UNDEFINE_KEEP_TPM flags to >>> qemuDomainUndefineFlags() >>> API and --tpm and --keep-tpm to 'virsh undefine'. Pass the >>>

Re: [PATCH 2/2] qemu: tpm: Remove TPM state after successful migration

2022-10-04 Thread Michal Prívozník
On 10/3/22 21:46, Stefan Berger wrote: > > > On 10/3/22 11:20, Michal Prívozník wrote: >> On 8/23/22 18:28, Stefan Berger wrote: >>> This patch 'fixes' the behavior of the persistent_state TPM domain XML >>> attribute that intends to preserve the state of the TPM but should not >>> keep the

Re: [PATCH] virpcivpd: reduce errors in log due to invalid VPD

2022-10-04 Thread Michal Prívozník
On 10/4/22 08:20, Christian Ehrhardt wrote: > On Thu, Sep 29, 2022 at 2:01 PM Michal Prívozník wrote: >> >> On 9/27/22 12:17, christian.ehrha...@canonical.com wrote: >>> From: Christian Ehrhardt >>> >>> Sadly some devices provide invalid VPD data even with fully updated >>> firmware. Former

Re: [PATCH] virt-aa-helper: allow common riscv64 loader paths

2022-10-04 Thread Christian Ehrhardt
On Fri, Sep 30, 2022 at 6:37 PM Jim Fehlig wrote: > > On 9/29/22 23:43, Christian Ehrhardt wrote: > > On Thu, Sep 29, 2022 at 11:30 PM Jim Fehlig wrote: > >> > >> On 9/28/22 06:45, christian.ehrha...@canonical.com wrote: > >>> From: Christian Ehrhardt > >>> > >>> Riscv64 usually uses u-boot as

Re: [PATCH] virpcivpd: reduce errors in log due to invalid VPD

2022-10-04 Thread Christian Ehrhardt
On Thu, Sep 29, 2022 at 2:01 PM Michal Prívozník wrote: > > On 9/27/22 12:17, christian.ehrha...@canonical.com wrote: > > From: Christian Ehrhardt > > > > Sadly some devices provide invalid VPD data even with fully updated > > firmware. Former hardning like 600f580d "PCI VPD: Skip fields with >