Re: [libvirt][PATCH v5 3/3] qemu: add parser and formatter for 'restrictive' mode in numatune

2021-04-15 Thread Jing Qi
@luoyao.zhong I tried to test this patch, but met some compile errors. Could you take a look at them? #gcc --version gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9) #git describe v7.2.0-194-ga0491637e1 ../src/qemu/qemu_process.c: In function ‘qemuProcessSetupPid’: ../src/qemu/qemu_process.c:2741:13:

[PATCH] ci: Refresh contents

2021-04-15 Thread Andrea Bolognani
Notable changes: * cross-building container images are smaller because they no longer include the native compilers; * ccache is enabled for clang builds. Signed-off-by: Andrea Bolognani --- Pushed under the CI refresh rule. Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines

Re: [PATCH 00/21] Refactoring conf to use XPath

2021-04-15 Thread Tim Wiederhake
On Thu, 2021-04-15 at 16:26 +0200, Kristina Hanicova wrote: > This series reworks the outdated way of parsing XML to parsing by > XPath, > which is more obvious and saves a few lines of code. > > Kristina Hanicova (21): > conf: Propagate xmlXPathContextPtr into > virDomainHostdevSubsysUSBDef

[libvirt PATCH 3/3] virQEMUCapsSetHostModel: Fix memory leak

2021-04-15 Thread Tim Wiederhake
virQEMUCapsSetHostModel is called by virQEMUCapsInitHostCPUModel, which in turn is typically called twice (for KVM and QEMU), e.g. in virQEMUCapsLoadCache and virQEMUCapsNewForBinaryInternal. The second call leaks memory pointed to by "reported", "migratable" and "full". Signed-off-by: Tim Wieder

[libvirt PATCH 2/3] virDomainFeaturesDefParse: Fix memory leak

2021-04-15 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 029f2d8d9c..5591681283 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18994,12 +18994,12 @@ virD

[libvirt PATCH 0/3] Fix some memory leaks

2021-04-15 Thread Tim Wiederhake
These memory leaks were found by llvm's address sanitizer asan. Tim Wiederhake (3): xenParseHypervisorFeatures: Fix memory leak virDomainFeaturesDefParse: Fix memory leak virQEMUCapsSetHostModel: Fix memory leak src/conf/domain_conf.c | 2 +- src/libxl/xen_common.c | 1 + src/q

[libvirt PATCH 1/3] xenParseHypervisorFeatures: Fix memory leak

2021-04-15 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/libxl/xen_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 12a44280cb..ad5a3de116 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -567,6 +567,7 @@ xenParseHypervisorFeatures

Re: [PATCH 09/21] Refactoring virDomainDiskDefParseXML() to use XPath

2021-04-15 Thread Peter Krempa
On Thu, Apr 15, 2021 at 16:26:24 +0200, Kristina Hanicova wrote: > Signed-off-by: Kristina Hanicova > --- > src/conf/domain_conf.c | 241 - > 1 file changed, 118 insertions(+), 123 deletions(-) I'm currently working on a bit deeper refactor of the disk par

[PATCH 15/21] Refactoring virDomainChrSourceDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 190 - 1 file changed, 94 insertions(+), 96 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ca9d54a47a..0748c93567 100644 --- a/src/conf/domain_conf.c +++ b/src/c

[PATCH 10/21] Refactoring virDomainControllerDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 69 ++ 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2af3ec6ec3..69f25c30a8 100644 --- a/src/conf/domain_conf.c +++ b/src/c

[PATCH 20/21] Refactoring virDomainVideoDriverDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b9816c46ed..a5dce8a8af 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1504

[PATCH 14/21] Refactoring virDomainChrDefParseTargetXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 163c47b7e0..ca9d54a47a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11614,

[PATCH 11/21] Refactoring virDomainFSDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 108 ++--- 1 file changed, 48 insertions(+), 60 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 69f25c30a8..22700c3064 100644 --- a/src/conf/domain_conf.c +++ b/src/c

[PATCH 18/21] Refactoring virDomainGraphicsDefParseXMLSpice() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 303 - 1 file changed, 114 insertions(+), 189 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ece34403a7..1115a3104d 100644 --- a/src/conf/domain_conf.c +++ b/src

[PATCH 19/21] conf: Propagate xmlXPathContextPtr into virDomainVideoDriverDefParseXML()

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1115a3104d..b9816c46ed 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15048,7 +15048,8 @

[PATCH 13/21] conf: Propagate xmlXPathContextPtr into virDomainChrDefParseTargetXML()

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5ea2061766..163c47b7e0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11614,6 +11614,7 @@ v

[PATCH 21/21] Refactoring virDomainVideoDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 88 -- 1 file changed, 33 insertions(+), 55 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a5dce8a8af..54348c8c23 100644 --- a/src/conf/domain_conf.c +++ b/src/c

[PATCH 16/21] Refactoring virDomainChrDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0748c93567..8d53b30917 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c

[PATCH 08/21] Refactoring virDomainLeaseDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 34 ++ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6a03727f2c..808169883f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/doma

[PATCH 09/21] Refactoring virDomainDiskDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 241 - 1 file changed, 118 insertions(+), 123 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 808169883f..2af3ec6ec3 100644 --- a/src/conf/domain_conf.c +++ b/src

[PATCH 17/21] Refactoring virDomainSmartcardDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 59 ++ 1 file changed, 25 insertions(+), 34 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8d53b30917..ece34403a7 100644 --- a/src/conf/domain_conf.c +++ b/src/c

[PATCH 12/21] Refactoring virDomainNetDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 338 +++-- 1 file changed, 156 insertions(+), 182 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 22700c3064..5ea2061766 100644 --- a/src/conf/domain_conf.c +++ b/src

[PATCH 07/21] conf: Propagate xmlXPathContextPtr into virDomainLeaseDefParseXML()

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e808eade90..6a03727f2c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8121,7 +8121,8 @

[PATCH 00/21] Refactoring conf to use XPath

2021-04-15 Thread Kristina Hanicova
This series reworks the outdated way of parsing XML to parsing by XPath, which is more obvious and saves a few lines of code. Kristina Hanicova (21): conf: Propagate xmlXPathContextPtr into virDomainHostdevSubsysUSBDefParseXML() Refactoring virDomainHostdevSubsysUSBDefParseXML() to use XPa

[PATCH 06/21] Refactoring virDomainHostdevSubsysPCIDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 37 + 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index eee9c2e3e3..e808eade90 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/d

[PATCH 02/21] Refactoring virDomainHostdevSubsysUSBDefParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 130 +++-- 1 file changed, 60 insertions(+), 70 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d42167ae4c..aca30d37d4 100644 --- a/src/conf/domain_conf.c +++ b/src/c

[PATCH 01/21] conf: Propagate xmlXPathContextPtr into virDomainHostdevSubsysUSBDefParseXML()

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 029f2d8d9c..d42167ae4c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6735,6 +6735,7 @@ vir

[PATCH 03/21] conf: Propagate xmlXPathContextPtr into virDomainBlkioDeviceParseXML()

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index aca30d37d4..33cc204507 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1698,6 +1698,7 @@ vir

[PATCH 04/21] Refactoring virDomainBlkioDeviceParseXML() to use XPath

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 116 + 1 file changed, 48 insertions(+), 68 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 33cc204507..65d5bb2c2a 100644 --- a/src/conf/domain_conf.c +++ b/src/c

[PATCH 05/21] conf: Propagate xmlXPathContextPtr into virDomainHostdevSubsysPCIDefParseXML()

2021-04-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 65d5bb2c2a..eee9c2e3e3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6867,6 +6867,7 @@ vir

Re: [PATCH] virsh: snapshot: Don't validate schema of XML generated by 'virsh snapshot-create-as'

2021-04-15 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Commit 95f8e3237e5486f487324c6 which introduced XML schema validation for snapshot XMLs always asserted the validation for the XML generated by 'virsh snapshot-create-as' on the basis that it's libvirt-generated, thus valid. This unfortunately isn't tru

Re: [libvirt PATCH v2 0/2] Fix some typos and spelling mistakes

2021-04-15 Thread Ján Tomko
On a Thursday in 2021, Tim Wiederhake wrote: Found by codespell [1]. It would be nice to automate this, but I could not get codespell to also check code comments, and ran into a known issue [2] with codespell that prevents putting some terms with mixed letter cases on the skip list. [1] https:/

Re: [libvirt PATCH] spec: Merge -bash-completion and -admin into -client

2021-04-15 Thread Daniel P . Berrangé
On Thu, Apr 15, 2021 at 02:44:09PM +0200, Andrea Bolognani wrote: > On Thu, 2021-04-15 at 11:10 +0100, Daniel P. Berrangé wrote: > > On Thu, Apr 15, 2021 at 11:36:19AM +0200, Michal Privoznik wrote: > > > The -client package needs then to obsolete those packages which you're > > > removing. Loo aro

[libvirt PATCH v2] spec: Merge -bash-completion and -admin into -client

2021-04-15 Thread Andrea Bolognani
The former is ridiculously tiny and doesn't have any use on its own, so it hardly warrants the overhead of an additional package; the latter is also very small and, just like virsh, is something that you likely want to have available on any virtualization host to help with management and debugging

Re: [libvirt PATCH] spec: Merge -bash-completion and -admin into -client

2021-04-15 Thread Andrea Bolognani
On Thu, 2021-04-15 at 11:10 +0100, Daniel P. Berrangé wrote: > On Thu, Apr 15, 2021 at 11:36:19AM +0200, Michal Privoznik wrote: > > The -client package needs then to obsolete those packages which you're > > removing. Loo around at "Obsoletes:" tag we have around. > > Also needs a Provides tag to

Re: [PATCH] vbox: Make host CPU cache init non-fatal

2021-04-15 Thread Daniel Henrique Barboza
On 4/8/21 3:15 PM, Charlie Sharpsteen wrote: This commit updates the vbox driver to log a warning if the virCapabilitiesInitCaches function fails instead of treating failure as a fatal error. CPU cache initialization requires the sysfs filesystem in order to complete successfully and thus fail

[PATCH] virsh: snapshot: Don't validate schema of XML generated by 'virsh snapshot-create-as'

2021-04-15 Thread Peter Krempa
Commit 95f8e3237e5486f487324c6 which introduced XML schema validation for snapshot XMLs always asserted the validation for the XML generated by 'virsh snapshot-create-as' on the basis that it's libvirt-generated, thus valid. This unfortunately isn't true as users can influence certain bits of the

Re: Broken link in documentation for networking

2021-04-15 Thread Michal Privoznik
On 4/15/21 12:41 PM, Thomas Kettenbach wrote: Hi, keeping it short: The anchor href for one example script seems to be outdated: In Section 1.4 Forwarding Incoming Connections >> Use the basic script below or see an "advanced" version, which can handle several different machines and port m

Broken link in documentation for networking

2021-04-15 Thread Thomas Kettenbach
Hi, keeping it short: The anchor href for one example script seems to be outdated: In Section 1.4 Forwarding Incoming Connections >> Use the basic script below or see an "advanced" version, which can handle several different machines and port mappings here 'here' points to: http://git.zaytsev.n

Re: [libvirt PATCH 0/2] Always validate XML for (hypervisor-)cpu-compare

2021-04-15 Thread Peter Krempa
On Thu, Apr 15, 2021 at 10:14:02 +0100, Daniel P. Berrangé wrote: > On Thu, Apr 15, 2021 at 10:40:52AM +0200, Tim Wiederhake wrote: > > XML schema validation for `virsh (hypervisor-)cpu-compare` has to be > > enabled explicitly by passing the `--validate` flag. Having invalid > > XML domain / cpu s

Re: [libvirt PATCH] spec: Merge -bash-completion and -admin into -client

2021-04-15 Thread Daniel P . Berrangé
On Thu, Apr 15, 2021 at 11:36:19AM +0200, Michal Privoznik wrote: > On 4/15/21 11:20 AM, Andrea Bolognani wrote: > > The former is ridiculously tiny and doesn't have any use on > > its own, so it hardly warrants the overhead of an additional > > package; the latter is also very small and, just like

Re: [libvirt PATCH] spec: Merge -bash-completion and -admin into -client

2021-04-15 Thread Michal Privoznik
On 4/15/21 11:20 AM, Andrea Bolognani wrote: The former is ridiculously tiny and doesn't have any use on its own, so it hardly warrants the overhead of an additional package; the latter is also very small and, just like virsh, is something that you likely want to have available on any virtualizat

[libvirt PATCH] spec: Merge -bash-completion and -admin into -client

2021-04-15 Thread Andrea Bolognani
The former is ridiculously tiny and doesn't have any use on its own, so it hardly warrants the overhead of an additional package; the latter is also very small and, just like virsh, is something that you likely want to have available on any virtualization host to help with management and debugging

Re: [libvirt PATCH 0/2] Always validate XML for (hypervisor-)cpu-compare

2021-04-15 Thread Daniel P . Berrangé
On Thu, Apr 15, 2021 at 10:40:52AM +0200, Tim Wiederhake wrote: > XML schema validation for `virsh (hypervisor-)cpu-compare` has to be > enabled explicitly by passing the `--validate` flag. Having invalid > XML domain / cpu specification that appear to work can lead to hard > to find problems down

Re: [PATCH v2 0/2] qemu: virtiofs: support

2021-04-15 Thread Michal Privoznik
On 3/26/21 6:15 PM, Cole Robinson wrote: Add support for virtiofsd -o sandbox=chroot|namespace v2: Add link to virtiofsd docs in libvirt docs validate the new field for qemu break up the patch Cole Robinson (2): conf: Introduce for qemu: virtiofs: support docs/formatdomain.

[libvirt PATCH 2/2] virCPUDefParseXML: Log schema validation errors

2021-04-15 Thread Tim Wiederhake
Schema validation was only performed if the "validateXML" flag was set. Make invalid XML visible in the logs by always validating, but only treat validation errors as errors if said flag is set. Signed-off-by: Tim Wiederhake --- src/conf/cpu_conf.c | 16 +++- 1 file changed, 7 insert

[libvirt PATCH 1/2] virxml: Fix schema validation of individual nodes

2021-04-15 Thread Tim Wiederhake
xmlDocSetRootElement removes the node from its previous document tree, effectively removing the "" node from "" in virCPUDefParseXML. Signed-off-by: Tim Wiederhake --- src/util/virxml.c | 13 ++--- src/util/virxml.h | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/s

[libvirt PATCH 0/2] Always validate XML for (hypervisor-)cpu-compare

2021-04-15 Thread Tim Wiederhake
XML schema validation for `virsh (hypervisor-)cpu-compare` has to be enabled explicitly by passing the `--validate` flag. Having invalid XML domain / cpu specification that appear to work can lead to hard to find problems down the line, when e.g. migration of VMs does not work as expected. This se

Re: [libvirt PATCH 00/14] Use virTristateXXX for more struct members

2021-04-15 Thread Tim Wiederhake
polite ping On Wed, 2021-04-07 at 13:48 +0200, Tim Wiederhake wrote: > This is a preparation step for some refactoring of the XML parser, > see > https://listman.redhat.com/archives/libvir-list/2021-March/msg01066.html > > Many libvirt structs have members that are of type `int` but actually > ar

Re: [libvirt PATCH v5 0/8] Refactor XML parsing boilerplate code

2021-04-15 Thread Tim Wiederhake
polite ping On Thu, 2021-04-08 at 13:19 +0200, Tim Wiederhake wrote: > This series lays the groundwork for replacing some recurring > boilerplate code > in src/conf/ regarding the extraction of XML attribute values. > > For an on / off attribute, the boilerplate code looks roughly like > this, >

[libvirt PATCH v2 2/2] virlog: Remove stray "todo" in comment

2021-04-15 Thread Tim Wiederhake
Fixes: 8fe30b2167b5b56461b11dbf02aca83030070caf Signed-off-by: Tim Wiederhake Reviewed-by: Ján Tomko --- src/util/virlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index 7778724d58..73a2d6734f 100644 --- a/src/util/virlog.c +++ b/s

[libvirt PATCH v2 1/2] Fix spelling

2021-04-15 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Ján Tomko --- NEWS.rst | 10 +- docs/formatdomain.rst | 6 +++--- docs/kbase/launch_security_sev.rst | 2 +- docs/manpages/virtproxyd.rst | 2 +- docs/pci-addresses.rst | 2 +- src/hyp

[libvirt PATCH v2 0/2] Fix some typos and spelling mistakes

2021-04-15 Thread Tim Wiederhake
Found by codespell [1]. It would be nice to automate this, but I could not get codespell to also check code comments, and ran into a known issue [2] with codespell that prevents putting some terms with mixed letter cases on the skip list. [1] https://github.com/codespell-project/codespell [2] htt