[libvirt PATCH] util: Fix memory leak when clearing Open vSwitch QoS

2021-08-12 Thread Jiri Denemark
No need to overwrite vmid_ex_id with a pointer to another copy of the same string when the original is still alive. Signed-off-by: Jiri Denemark --- src/util/virnetdevopenvswitch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/util/virnetdevopenvswitch.c

Re: [libvirt PATCH 00/12] tools: virsh: use g_auto more (glib chronicles)

2021-08-12 Thread Martin Kletzander
On Thu, Aug 12, 2021 at 10:32:38AM +0200, Ján Tomko wrote: Incomprehensive series removing many cleanup sections. Patch 1/12 is common with my other series: [libvirt PATCH 0/3] xml: use g_auto for xmlXPathObject Ján Tomko (12): util: define cleanup func for xmlXPathObject tools: virsh: split

Re: [libvirt PATCH 12/12] tools: virsh: remove redundant labels

2021-08-12 Thread Martin Kletzander
On Thu, Aug 12, 2021 at 10:32:50AM +0200, Ján Tomko wrote: Signed-off-by: Ján Tomko --- tools/virsh-completer-domain.c | 30 +- tools/virsh-domain-monitor.c | 128 +++ tools/virsh-domain.c | 634 - tools/virsh-host.c | 87 ++---

[PATCH 18/22] qemuxml2argvtest: Remove 'minimal-sandbox' case

2021-08-12 Thread Peter Krempa
All modern qemus support sandboxing so this is covered by other tests. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/minimal-sandbox.args | 30 -- tests/qemuxml2argvdata/minimal-sandbox.xml | 34 - tests/qemuxml2argvtest.c| 2 --

[PATCH 14/22] qemuMonitorSetBlockIoThrottle: Remove booleans controlling used fields

2021-08-12 Thread Peter Krempa
All supported QEMU versions have all the fields so we can remove the booleans controlling which fields are used on the monitor. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 4 +- src/qemu/qemu_hotplug.c | 6 +-- src/qemu/qemu_monitor.c | 10 +

[PATCH 13/22] qemuMonitorJSONSetBlockIoThrottle: Switch to standard error reporting

2021-08-12 Thread Peter Krempa
Use qemuMonitorJSONCheckError instead of handcrafted error reporting. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index

[PATCH 12/22] qemuMonitorJSONSetBlockIoThrottle: Refactor cleanup

2021-08-12 Thread Peter Krempa
Switch to automatic memory freeing and remove the cleanup section. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index

[PATCH 11/22] qemu: capabilties: Retire QEMU_CAPS_DRIVE_IOTUNE_* caps

2021-08-12 Thread Peter Krempa
They are no longer used as we now assume that all tuning caps are present and in case some will be removed we'll need to use different probing methods. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 9 +++-- src/qemu/qemu_capabilities.h

[PATCH 10/22] qemu: Always assume that qemu supports drive throttling

2021-08-12 Thread Peter Krempa
All currently supported qemu versions support all throttling capabilities. It is unlikely that any of the fields will be removed in the future and if it will we will need to do specific probing which is possible via the 'throttle' object which is the replacement for the legacy way to configure

[PATCH 08/22] qemu: capabilities: Probe 'discard' and 'detect-zeroes' from 'blockdev-add'

2021-08-12 Thread Peter Krempa
Probing QEMU_CAPS_DRIVE_DISCARD and QEMU_CAPS_DRIVE_DETECT_ZEROES can be replaced by looking into the QMP schema rather than looking at -drive which isn't in use any more. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 07/22] qemu: capabilities: Rename QEMU_CAPS_CHARDEV_FD_PASS to QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE

2021-08-12 Thread Peter Krempa
Make it more obvious that we care about passing FDs on the commandline before startup of qemu, which is used to avoid startup monitor polling. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 4 ++-- src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_command.c | 2 +-

[PATCH 06/22] qemu: capabilities: Probe 'reconnect', 'logfile' and 'append' from 'chardev-add'

2021-08-12 Thread Peter Krempa
QEMU_CAPS_CHARDEV_RECONNECT, QEMU_CAPS_CHARDEV_LOGFILE and QEMU_CAPS_CHARDEV_FILE_APPEND can be probed from the appropriate fields in 'chardev-add' probed via the QMP schema instead of the command line parameters. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 6 +++--- 1 file

[PATCH 05/22] qemu: capabilities: Note that basing probing on 'query-command-line-options' should be avoided

2021-08-12 Thread Peter Krempa
Add a comment that will attempt to discourage adding new capabilities based on 'query-command-line-options'. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 4 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index

[PATCH] tests: qemu: Don't crash when capability file can't be parsed

2021-08-12 Thread Peter Krempa
In case the test directory contains invalid XML (this doesn't happen upstream, but can when developing, e.g. by forgetting git conflict markers) the tests would crash as in case when 'testQemuInfoSetArgs' fails we'd still invoke the test in qemuxml2argv and qemuxml2xml tests. Add a 'break'

[PATCH 20/22] qemu: capabilities: Retire QEMU_CAPS_NAME*

2021-08-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 6 ++ src/qemu/qemu_capabilities.h | 4 ++-- tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 2 -- tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 2 --

[PATCH 16/22] qemuxml2argvtest: Remove 'debug-threads' case

2021-08-12 Thread Peter Krempa
The test is now pointless since we always assume that this option is present. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/debug-threads.args | 29 --- tests/qemuxml2argvdata/debug-threads.xml | 34 --- tests/qemuxml2argvtest.c |

[PATCH 09/22] qemu: capabilities: Probe QEMU_CAPS_SMP_DIES from the QMP schema

2021-08-12 Thread Peter Krempa
The configurability of the number of dies in a CPU can be infered from the presence of the 'die-id' field in 'query-hotpluggable-cpus'. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c

[PATCH 22/22] qemu: capabilities: Retire QEMU_CAPS_MSG_TIMESTAMP

2021-08-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 3 +-- src/qemu/qemu_capabilities.h | 2 +- tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 - tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 1 -

[PATCH 15/22] qemu: capabilities: Add alternative detection of QEMU_CAPS_NUMA

2021-08-12 Thread Peter Krempa
'set-numa-node' is the command which can set the equivalent parameters to '-numa' in preconfig mode, so we can use it as witness to see that -numa is supported. To ensure that the old detection method is removed once we'll be bumping qemu support add a comment with the appropriate version check.

[PATCH 17/22] qemuxml2argvtest: Remove 'minimal-msg-timestamp'

2021-08-12 Thread Peter Krempa
The feature is supported by all supported qemu versions thus covered thoroughly by other test cases. Signed-off-by: Peter Krempa --- .../minimal-msg-timestamp.args| 30 - .../minimal-msg-timestamp.xml | 32 ---

[PATCH 04/22] scripts: group-qemu-caps: Add capability name as comment to capability string

2021-08-12 Thread Peter Krempa
Add a cross reference of the enum value name with the string representation. This allows a quick cross-reference of the values without having to open the header and implementation files separately. To achieve this the python checker code at first obtains a list of the flags and cross-references

[PATCH 03/22] virQEMUCapsQMPSchemaQueries: Group by queried object name

2021-08-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0d8c9667f1..3892d3e8e8 100644 --- a/src/qemu/qemu_capabilities.c +++

[PATCH 02/22] virQEMUCapsCommandLine: Group by commandline argument name alphabetically

2021-08-12 Thread Peter Krempa
Further commits will be refactoring and minimizing capabilities being parsed from 'query-command-line-options'. Group the struct driving the detection by argument name so it's easier to spot options belonging together. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 42

[PATCH 01/22] qemuxml2argvtest: Remove negative tests for (aes|dea)keywrap (s390) property

2021-08-12 Thread Peter Krempa
Upcoming commit will always add the property so the negative tests would stop working. Signed-off-by: Peter Krempa --- .../machine-aeskeywrap-off-cap.err| 1 - .../machine-aeskeywrap-off-caps.err | 1 - .../machine-aeskeywrap-on-cap.err | 1 -

[PATCH 00/22] qemu: Capability probing from 'query-command-line-options' (part 1?)

2021-08-12 Thread Peter Krempa
Hi, this series started as an exploration in how we use 'query-command-line-options' and the way to possibly step away from using it. The main problem is that query-command-line-options is using old-style command line parsing infra in qemu and thus doesn't scale. In an effor to help qemu

Re: [PATCH 0/6] virsh: Some fixes noted when reviewing Jan's series

2021-08-12 Thread Jano Tomko
On a %A in %Y, Peter Krempa wrote: > Peter Krempa (6): > virsh: Un-document 'virsh echo' > virshtest: Don't use both '--xml' and '--shell' for 'virsh echo' > virsh: cmdEcho: Make '--xml' and '--shell' mutually exclusive > virsh: cmdEcho: Rewrite with new buffer helpers > virsh: Add

Re: [PATCH 0/6] virsh: Some fixes noted when reviewing Jan's series

2021-08-12 Thread Martin Kletzander
On Thu, Aug 12, 2021 at 03:01:30PM +0200, Peter Krempa wrote: Peter Krempa (6): virsh: Un-document 'virsh echo' virshtest: Don't use both '--xml' and '--shell' for 'virsh echo' virsh: cmdEcho: Make '--xml' and '--shell' mutually exclusive virsh: cmdEcho: Rewrite with new buffer helpers

Re: [PATCH 4/6] virsh: cmdEcho: Rewrite with new buffer helpers

2021-08-12 Thread Martin Kletzander
On Thu, Aug 12, 2021 at 03:01:34PM +0200, Peter Krempa wrote: Remove the need for temporary strings by fillin the output buffer s/fillin/filling/ signature.asc Description: PGP signature

[PATCH 5/6] virsh: Add testing for vshStringToArray

2021-08-12 Thread Peter Krempa
Add a '--split' switch for the 'virsh echo' command and add few test cases to the virshtest. Signed-off-by: Peter Krempa --- tests/virshtest.c | 11 +++ tools/vsh.c | 15 +++ 2 files changed, 26 insertions(+) diff --git a/tests/virshtest.c b/tests/virshtest.c index

[PATCH 2/6] virshtest: Don't use both '--xml' and '--shell' for 'virsh echo'

2021-08-12 Thread Peter Krempa
Escaping for both shell and XML makes no sense. Use one at time so that we can forbid use of both. Signed-off-by: Peter Krempa --- tests/virshtest.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/virshtest.c b/tests/virshtest.c index 53db2aa19a..07c27428ae

[PATCH 6/6] vshStringToArray: Rewrite using 'g_strsplit'

2021-08-12 Thread Peter Krempa
Use 'g_strsplit' to split the strings and then concatenate back when the escape sequence (',,') is used. Signed-off-by: Peter Krempa --- tools/vsh.c | 62 ++--- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/tools/vsh.c

[PATCH 3/6] virsh: cmdEcho: Make '--xml' and '--shell' mutually exclusive

2021-08-12 Thread Peter Krempa
Initialize the flags earlier and use VSH_EXCLUSIVE_OPTIONS_VAR to declare the conflicting options as exclusive. Signed-off-by: Peter Krempa --- tools/vsh.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index f44db5d56d..009c93254c

[PATCH 0/6] virsh: Some fixes noted when reviewing Jan's series

2021-08-12 Thread Peter Krempa
Peter Krempa (6): virsh: Un-document 'virsh echo' virshtest: Don't use both '--xml' and '--shell' for 'virsh echo' virsh: cmdEcho: Make '--xml' and '--shell' mutually exclusive virsh: cmdEcho: Rewrite with new buffer helpers virsh: Add testing for vshStringToArray vshStringToArray:

[PATCH 4/6] virsh: cmdEcho: Rewrite with new buffer helpers

2021-08-12 Thread Peter Krempa
Remove the need for temporary strings by fillin the output buffer directly. Signed-off-by: Peter Krempa --- tools/vsh.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 009c93254c..2456267426 100644 --- a/tools/vsh.c +++

[PATCH 1/6] virsh: Un-document 'virsh echo'

2021-08-12 Thread Peter Krempa
Note that it's for internal testing use and remove the manpage entry. Signed-off-by: Peter Krempa --- docs/manpages/virsh.rst | 17 - tools/vsh.c | 4 ++-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/docs/manpages/virsh.rst

Plans for the next release

2021-08-12 Thread Jiri Denemark
I'm sending this early as I'll be out until Aug 25, but don't worry I'll be back in time to handle the whole release process. To aim for the release on Sep 01 I suggest entering the freeze on Thursday Aug 26 and tagging RC2 on Monday Aug 30. I hope this works for everyone. Jirka

[libvirt PATCH 13/12] fixup

2021-08-12 Thread Ján Tomko
fixup /ˈfɪksʌp/ n. the next best thing after getting it right the first time Signed-off-by: Ján Tomko --- tools/virsh-domain.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index d06c24cc74..e985090992 100644 ---

[libvirt PATCH] vsh: steal pointer in vshEditWriteToTempFile

2021-08-12 Thread Ján Tomko
Fixes: 13896b5ad1d7f157273b6e49106df1f33958a9ed Signed-off-by: Ján Tomko --- Pushed as trivial. Ears of shame were applied. tools/vsh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/vsh.c b/tools/vsh.c index f9600bafba..96b3ced0ca 100644 --- a/tools/vsh.c +++

Re: [PATCH v3 09/11] test_driver: Implement virConnectGetAllDomainStats

2021-08-12 Thread Luke Yue
On Thu, 2021-08-12 at 18:50 +0800, Luke Yue wrote: > Implement virConnectGetAllDomainStats in a modular way just like QEMU > driver, though remove some params in GetStatsWorker that we don't need > in test driver currently. > > Only add the worker to get state so far, more worker will be added >

[PATCH v3 11/11] tests: Test IOThread related functions for test driver

2021-08-12 Thread Luke Yue
Signed-off-by: Luke Yue --- tests/virshtest.c | 90 +++ 1 file changed, 90 insertions(+) diff --git a/tests/virshtest.c b/tests/virshtest.c index 53db2aa19a..e2d6ddd72b 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -30,6 +30,7 @@

[PATCH v3 10/11] test_driver: Introduce testDomainGetStatsIOThread

2021-08-12 Thread Luke Yue
Introduce testDomainGetStatsIOThread to add support for testConnectGetAllDomainStats to get IOThread infos. Signed-off-by: Luke Yue --- src/test/test_driver.c | 44 +- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/test/test_driver.c

[PATCH v3 08/11] test_driver: Implement testDomainSetIOThreadParams

2021-08-12 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 90 ++ 1 file changed, 90 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 385c8b3ad3..1d439a89b6 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@

[PATCH v3 03/11] test_driver: Implement virDomainAddIOThread

2021-08-12 Thread Luke Yue
Introduce testDomainChgIOThread at the same time Signed-off-by: Luke Yue --- src/test/meson.build | 1 + src/test/test_driver.c | 77 ++ 2 files changed, 78 insertions(+) diff --git a/src/test/meson.build b/src/test/meson.build index

[PATCH v3 01/11] domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck()

2021-08-12 Thread Luke Yue
The test driver can share the same code with qemu driver when implement testDomainAddIOThreadCheck and testDomainDelIOThreadCheck, so extract them for test driver to use. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 64 ++

[PATCH v3 02/11] test_driver: Introduce testIOThreadInfo and generate IOThread infos

2021-08-12 Thread Luke Yue
Introduce testIOThreadInfo to store IOThread infos: iothread_id, poll_max_ns, poll_grow and poll_shrink for future usage. Add an example of IOThread configuration to testdomfc4.xml, we also want to generate default testIOThreadInfo for the IOThread configured in the xml, so introduce

[PATCH v3 09/11] test_driver: Implement virConnectGetAllDomainStats

2021-08-12 Thread Luke Yue
Implement virConnectGetAllDomainStats in a modular way just like QEMU driver, though remove some params in GetStatsWorker that we don't need in test driver currently. Only add the worker to get state so far, more worker will be added in the future. Signed-off-by: Luke Yue ---

[PATCH v3 07/11] test_driver: Implement virDomainPinIOThread

2021-08-12 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 67337879ef..385c8b3ad3 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@

[PATCH v3 06/11] test_driver: Implement virDomainGetIOThreadInfo

2021-08-12 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 2813320939..67337879ef 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9490,6 +9490,34

[PATCH v3 05/11] domain_driver.c: Introduce and use virDomainDriverGetIOThreadsConfig()

2021-08-12 Thread Luke Yue
The test driver can share the same code with qemu driver when implement testDomainGetIOThreadsConfig, so extract it for test driver to use. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 68 ++ src/hypervisor/domain_driver.h | 4 ++

[PATCH v3 04/11] test_driver: Implement virDomainDelIOThread

2021-08-12 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index f3e3745442..2813320939 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@

[PATCH v3 00/11] Implement IOThreads related APIs for test driver

2021-08-12 Thread Luke Yue
v3: - Rebase to current master branch - Fix compilation - Fix tests Luke Yue (11): domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck() test_driver: Introduce testIOThreadInfo and generate IOThread infos test_driver: Implement virDomainAddIOThread test_driver: Implement

Re: [libvirt PATCH 0/3] xml: use g_auto for xmlXPathObject (glib chronicles)

2021-08-12 Thread Pavel Hrdina
On Wed, Aug 11, 2021 at 02:07:24PM +0200, Ján Tomko wrote: > Ján Tomko (3): > util: define cleanup func for xmlXPathObject > util: xml: use g_auto for xmlXPathObject > util: xml: clean up unnecessary ret variables Reviewed-by: Pavel Hrdina signature.asc Description: PGP signature

Re: [PATCH 5/5] conf: replace validation with variables passed to virXMLParse()

2021-08-12 Thread Jano Tomko
On a %A in %Y, Kristina Hanicova wrote: > virXMLParse() now allows to validate xml against schema directly, s/allows to validate/allows validating/ > eliminating the need to do it individually in each function. > > Signed-off-by: Kristina Hanicova > --- > src/conf/backup_conf.c | 13

Re: [libvirt PATCH] virsh: refactor cmdDomblkinfo

2021-08-12 Thread Martin Kletzander
On Wed, Aug 11, 2021 at 05:02:50PM +0200, Ján Tomko wrote: Use automatic memory cleanup to get rid of the cleanup section, and of the memory leak that happens inside the loop, because cap, alloc and phy are only freed once per function. Signed-off-by: Ján Tomko Reviewed-by: Martin Kletzander

[libvirt PATCH 05/12] tools: virsh: use automatic cleanup for xmlXPathContext

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-completer-domain.c | 6 ++ tools/virsh-domain-monitor.c | 12 tools/virsh-domain.c | 27 +-- tools/virsh-host.c | 15 +-- tools/virsh-interface.c| 6 ++

[libvirt PATCH 12/12] tools: virsh: remove redundant labels

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-completer-domain.c | 30 +- tools/virsh-domain-monitor.c | 128 +++ tools/virsh-domain.c | 634 - tools/virsh-host.c | 87 ++--- tools/virsh-nodedev.c | 7 +- tools/virsh-volume.c

[libvirt PATCH 09/12] tools: virsh: reduce variable scope to use automatic cleanup

2021-08-12 Thread Ján Tomko
Some variables are used in a loop and only freed in the cleanup section because we need to be able to jump out of the loop. Reduce their scope and free them automatically. Signed-off-by: Ján Tomko --- tools/virsh-domain-monitor.c | 39 +--- tools/virsh-domain.c

[libvirt PATCH 08/12] tools: virsh: use automatic cleanup for vshTable

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-domain-monitor.c | 9 +++-- tools/virsh-domain.c | 9 +++-- tools/virsh-interface.c | 3 +-- tools/virsh-network.c| 9 +++-- tools/virsh-nwfilter.c | 6 ++ tools/virsh-pool.c | 3 +--

[libvirt PATCH 07/12] tools: virsh: use automatic cleanup for xmlDoc

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-completer-domain.c | 6 ++ tools/virsh-domain-monitor.c | 12 tools/virsh-domain.c | 27 +-- tools/virsh-host.c | 15 +-- tools/virsh-interface.c| 6 ++

[libvirt PATCH 04/12] tools: virsh: use automatic cleanup for virDomainObj

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-completer-checkpoint.c | 4 +- tools/virsh-completer-domain.c | 15 +- tools/virsh-completer-snapshot.c | 3 +- tools/virsh-domain-monitor.c | 29 +-- tools/virsh-domain.c | 303 ++--- 5 files

[libvirt PATCH 03/12] tools: virsh: cmdDominfo: rename 'ostype' variable

2021-08-12 Thread Ján Tomko
Use 'ostype' instead of generic 'str', to discourage reuse. Also mark it as autofree. Signed-off-by: Ján Tomko --- tools/virsh-domain-monitor.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index

[libvirt PATCH 00/12] tools: virsh: use g_auto more (glib chronicles)

2021-08-12 Thread Ján Tomko
Incomprehensive series removing many cleanup sections. Patch 1/12 is common with my other series: [libvirt PATCH 0/3] xml: use g_auto for xmlXPathObject Ján Tomko (12): util: define cleanup func for xmlXPathObject tools: virsh: split variable declarations tools: virsh: cmdDominfo: rename

[libvirt PATCH 11/12] tools: virsh: use g_autofree

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-domain-monitor.c | 18 ++-- tools/virsh-domain.c | 168 --- tools/virsh-host.c | 92 ++- tools/virsh-interface.c | 6 +- tools/virsh-network.c| 15 ++--

[libvirt PATCH 06/12] tools: virsh: use automatic cleanup for xmlXPathObject

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-domain.c | 9 +++-- tools/virsh-volume.c | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 398190bb5b..0c60a4de99 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@

[libvirt PATCH 02/12] tools: virsh: split variable declarations

2021-08-12 Thread Ján Tomko
One variable per line. Signed-off-by: Ján Tomko --- tools/virsh-domain.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 81f3c82094..ae979ddd49 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -5912,7

[libvirt PATCH 01/12] util: define cleanup func for xmlXPathObject

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/util/virxml.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virxml.h b/src/util/virxml.h index 0bb0d1c118..c8eb51a65a 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -363,6 +363,7 @@

[libvirt PATCH 10/12] tools: virsh: use automatic cleanup for char **

2021-08-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-domain.c | 11 +++ tools/virsh-host.c| 3 +-- tools/virsh-nodedev.c | 6 ++ tools/virsh-pool.c| 4 +--- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index