[libvirt PATCH 20/24] tests: libxl: remove pointless labels

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/xlconfigtest.c | 48 ++-- tests/xmconfigtest.c | 37 +- 2 files changed, 34 insertions(+), 51 deletions(-) diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c index

[libvirt PATCH 19/24] tests: vmx: remove pointless labels

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/vmx2xmltest.c | 19 +++ tests/xml2vmxtest.c | 15 +-- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index b7f232eb77..0974168cb4 100644 --- a/tests/vmx2xmltest.c +++

[libvirt PATCH 15/24] tests: use VIR_AUTOCLOSE

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/fdstreamtest.c| 6 ++ tests/scsihosttest.c| 3 +-- tests/virfiletest.c | 6 ++ tests/virnettlshelpers.c| 4 +--- tests/virpcimock.c | 4 +--- tests/virrotatingfiletest.c | 4 +--- 6 files changed, 8 insertions(+), 19

[libvirt PATCH 14/24] tests: use g_auto instead of VIR_FORCE_FCLOSE

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/securityselinuxlabeltest.c | 3 +-- tests/testutils.c| 5 + tests/virhostcputest.c | 7 ++- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c

[libvirt PATCH 13/24] tests: use g_auto for virCPUDataFree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/qemumonitorjsontest.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 542b35850e..b68351d9d8 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@

[libvirt PATCH 07/24] tests: libxl: use g_autofree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/libxlxml2domconfigtest.c | 15 +-- tests/xlconfigtest.c | 25 - tests/xmconfigtest.c | 16 +--- 3 files changed, 18 insertions(+), 38 deletions(-) diff --git a/tests/libxlxml2domconfigtest.c

[libvirt PATCH 03/24] conf: add cleanup func for virMacMap

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/util/virmacmap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virmacmap.h b/src/util/virmacmap.h index 582c4a8bdf..c0efa2b20f 100644 --- a/src/util/virmacmap.h +++ b/src/util/virmacmap.h @@ -21,8 +21,10 @@ #pragma once #include "internal.h"

[libvirt PATCH 22/24] tests: vshtabletest: remove pointless labels

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/vshtabletest.c | 71 +--- 1 file changed, 28 insertions(+), 43 deletions(-) diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c index 569d7a852f..716b11dbc0 100644 --- a/tests/vshtabletest.c +++

[libvirt PATCH 18/24] tests: qemu: remove pointless labels

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/qemuagenttest.c| 28 ++-- tests/qemucapsprobemock.c| 3 +-- tests/qemucommandutiltest.c | 9 +++ tests/qemumonitorjsontest.c | 50 +++- tests/qemumonitortestutils.c | 45

[libvirt PATCH 08/24] tests: nwfilter: use g_autofree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/nwfilterebiptablestest.c | 21 +++-- tests/nwfilterxml2firewalltest.c | 12 tests/nwfilterxml2xmltest.c | 10 +++--- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/tests/nwfilterebiptablestest.c

[libvirt PATCH 24/24] tests: remove pointless labels

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/cputest.c | 42 tests/domaincapstest.c | 39 - tests/domainconftest.c | 12 +++-- tests/fchosttest.c | 40 +++---

[libvirt PATCH 21/24] tests: nwfilter: remove pointless labels

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/nwfilterebiptablestest.c | 63 -- 1 file changed, 21 insertions(+), 42 deletions(-) diff --git a/tests/nwfilterebiptablestest.c b/tests/nwfilterebiptablestest.c index 7b32e90d19..9307a10229 100644 ---

[libvirt PATCH 17/24] tests: use g_auto instead of virDomainFree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/domainconftest.c | 3 +-- tests/libxlxml2domconfigtest.c | 3 +-- tests/lxcconf2xmltest.c | 3 +-- tests/openvzutilstest.c | 3 +-- tests/qemuagenttest.c| 3 +-- tests/securityselinuxlabeltest.c | 3 +--

[libvirt PATCH 16/24] tests: use g_auto instead of vshTableFree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/vshtabletest.c | 30 ++ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c index 804aaf4d9c..569d7a852f 100644 --- a/tests/vshtabletest.c +++ b/tests/vshtabletest.c @@ -55,7

[libvirt PATCH 09/24] tests: vmx: use g_autofree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/vmx2xmltest.c | 13 - tests/xml2vmxtest.c | 14 -- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index 33bf243717..cd44a84a07 100644 --- a/tests/vmx2xmltest.c +++

[libvirt PATCH 06/24] tests: network: use g_autofree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/networkxml2conftest.c | 16 +--- tests/networkxml2firewalltest.c | 9 +++-- tests/networkxml2xmltest.c | 10 +++--- tests/networkxml2xmlupdatetest.c | 16 +--- 4 files changed, 16 insertions(+), 35 deletions(-) diff

[libvirt PATCH 05/24] tests: qemu: use g_autofree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/qemucapsprobemock.c | 6 ++--- tests/qemucommandutiltest.c | 3 +-- tests/qemumonitorjsontest.c | 48 + tests/qemuxml2argvtest.c| 3 +-- 4 files changed, 20 insertions(+), 40 deletions(-) diff --git

[libvirt PATCH 04/24] tests: use g_autoptr instead of virObjectUnref

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/cputest.c | 9 +++-- tests/domaincapstest.c | 6 ++ tests/networkxml2conftest.c | 3 +-- tests/networkxml2xmltest.c | 3 +-- tests/vircapstest.c | 6 ++ tests/virmacmaptest.c | 6 ++ tests/virpcitest.c

[libvirt PATCH 23/24] tests: vir: remove pointless labels

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/vircapstest.c | 14 +++-- tests/virconftest.c | 38 ++-- tests/vircryptotest.c | 23 +-- tests/virfiletest.c | 49 --- tests/virhostcputest.c

[libvirt PATCH 12/24] tests: use g_autoptr instead of virJSONValueFree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/qemucapsprobemock.c | 3 +-- tests/qemucommandutiltest.c | 3 +-- tests/qemumonitorjsontest.c | 12 tests/virnetdaemontest.c| 3 +-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/qemucapsprobemock.c

[libvirt PATCH 11/24] tests: use g_autofree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/domaincapstest.c | 15 +-- tests/domainconftest.c | 3 +-- tests/eventtest.c| 3 +-- tests/fchosttest.c | 30 ++ tests/fdstreamtest.c | 18 ++

[libvirt PATCH 10/24] tests: vir: use g_autofree

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/vircgrouptest.c | 3 +-- tests/virconftest.c | 6 ++ tests/vircryptotest.c | 12 tests/virfilecachetest.c | 3 +-- tests/virfilemock.c | 3 +--

[libvirt PATCH 02/24] conf: add cleanup func for virNetworkXMLOption

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/conf/network_conf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index 34007e1969..30958eff64 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -44,6 +44,7 @@ struct _virNetworkXMLOption

[libvirt PATCH 01/24] tests: virnetdaemontest: split variable declarations

2021-09-04 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/virnetdaemontest.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index ce0384f026..f764268c50 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -270,8 +270,10

[libvirt PATCH 00/24] tests: use g_auto more (glib chronicles)

2021-09-04 Thread Ján Tomko
Ján Tomko (24): tests: virnetdaemontest: split variable declarations conf: add cleanup func for virNetworkXMLOption conf: add cleanup func for virMacMap tests: use g_autoptr instead of virObjectUnref tests: qemu: use g_autofree tests: network: use g_autofree tests: libxl: use

[libvirt PATCH] secretxml2xmltest: refactor testCompareXMLToXMLFiles (glib chronicles)

2021-09-04 Thread Ján Tomko
Use g_auto where possible and remove the pointless label. Signed-off-by: Ján Tomko --- tests/secretxml2xmltest.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/secretxml2xmltest.c b/tests/secretxml2xmltest.c index 48f48416b5..99aaa9db15 100644 ---

[libvirt PATCH 6/6] virnetsockettest: refactor checkProtocols

2021-09-04 Thread Ján Tomko
Reduce variable scope, use g_auto and remove pointless labels. Signed-off-by: Ján Tomko --- tests/virnetsockettest.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 8059c6cbb0..1de3771ad4

[libvirt PATCH 5/6] tests: refactor testSELinuxLoadDef

2021-09-04 Thread Ján Tomko
Since its introduction in commit 907a39e735d256b8428ed4c77009d1f713aea19b Add a test suite for validating SELinux labelling this function did not return NULL on OOM. Since we abort on OOM now, switch testSELinuxMungePath to void, return NULL explicitly on XML parsing failure and remove the

[libvirt PATCH 1/6] tests: esxutils: refactor testParseDatastorePath

2021-09-04 Thread Ján Tomko
Reduce variable scope to match their lifetime, use g_auto and remove now pointless labels in favor of direct returns. Signed-off-by: Ján Tomko --- tests/esxutilstest.c | 30 -- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/tests/esxutilstest.c

[libvirt PATCH 4/4] Revert "meson: avoid bogus warnings from clang and g_autoptr"

2021-09-04 Thread Ján Tomko
Commit 345996c6208b281233074362a8d81295e2e711d4 disabled the -Wunused-but-set-variable warning on CLang, beacuse it warned on variables that were unread, but we relied on the side effects of their destructors. Reinstate the warning now that all the occurrences have been fixed. Signed-off-by: Ján

[libvirt PATCH 3/4] rpc: mark source returned by virEventGLibAddSocketWatch as unused

2021-09-04 Thread Ján Tomko
Two users of virEventGLibAddSocketWatch care about the GSource it returns. The other three free it by assigning it to an autofreed variable. Mark them with G_GNUC_UNUSED to make this obvious to the reader and the compiler. Signed-off-by: Ján Tomko --- src/rpc/virnetclient.c | 6 +++--- 1 file

[libvirt PATCH 1/2] tests: bhyve: remove magic constants

2021-09-04 Thread Ján Tomko
Refer to flags by their identifier, not value. Signed-off-by: Ján Tomko --- tests/bhyveargv2xmltest.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c index 2c1ffc75f3..e86c9e3b10 100644 ---

[libvirt PATCH 0/2] tests: bhyve: minor style tweaks for constants

2021-09-04 Thread Ján Tomko
I found these lying around in a forgotten branch. Ján Tomko (2): tests: bhyve: remove magic constants tests: bhyve: use bitwise shift when defining flags tests/bhyveargv2xmltest.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.31.1

[libvirt PATCH 0/4] Reinstate -Wunused-but-set-variable

2021-09-04 Thread Ján Tomko
Personally, I feel like all the cases caught by new Clang's -Wunused-but-set-variable behavior were also unnecessarily difficult to read for humans, we should be more obvious when relying purely on side effects of g_auto and the warning is worth keeping. Even if not, the first two patches

[libvirt PATCH 4/6] tests: reduce variable scope in testSELinuxCheckLabels

2021-09-04 Thread Ján Tomko
And use g_auto. Signed-off-by: Ján Tomko --- tests/securityselinuxlabeltest.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c index f7dd3c866a..3d886fd827 100644 --- a/tests/securityselinuxlabeltest.c

[libvirt PATCH 3/6] tests: esxutils: reduce variable scope in testConvertWindows1252ToUTF8

2021-09-04 Thread Ján Tomko
Also use g_auto. Signed-off-by: Ján Tomko --- tests/esxutilstest.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c index d537da3011..db49dcd6e0 100644 --- a/tests/esxutilstest.c +++ b/tests/esxutilstest.c @@ -197,10 +197,9

[libvirt PATCH 2/6] tests: esxutils: reduce variable scope in testEscapeDatastoreItem

2021-09-04 Thread Ján Tomko
Also use g_auto. Signed-off-by: Ján Tomko --- tests/esxutilstest.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c index bfb35fa356..d537da3011 100644 --- a/tests/esxutilstest.c +++ b/tests/esxutilstest.c @@ -161,23 +161,19

[libvirt PATCH 0/6] tests: refactor some functions (glib chronicles)

2021-09-04 Thread Ján Tomko
Ján Tomko (6): tests: esxutils: refactor testParseDatastorePath tests: esxutils: reduce variable scope in testEscapeDatastoreItem tests: esxutils: reduce variable scope in testConvertWindows1252ToUTF8 tests: reduce variable scope in testSELinuxCheckLabels tests: refactor

[libvirt PATCH 2/4] util: virIdentitySetCurrent: only unref the old identity on success

2021-09-04 Thread Ján Tomko
In the unlikely case that we were unable to set the new identity, we would unref the old one even though it still could be in the thread-local storage. Fixes: c6825d88137cb8e4debdf4310e45ee23cb5698c0 Signed-off-by: Ján Tomko --- src/util/viridentity.c | 4 +++- 1 file changed, 3 insertions(+),

[libvirt PATCH 2/2] tests: bhyve: use bitwise shift when defining flags

2021-09-04 Thread Ján Tomko
Although I'm sure we all know the powers of two by heart now, this is the prevalent style for flag defition. Signed-off-by: Ján Tomko --- tests/bhyveargv2xmltest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c

[libvirt PATCH 1/4] qemu: remove unused 'cfg' variables

2021-09-04 Thread Ján Tomko
Unused as of: commit effeee5c2fcec19fcaad627690a6a0ba0025e35f qemu: driver: Use 'qemuDomainSaveStatus' for saving status XML This function extracts the config from the vm object, so the caller no longer needs to do it. Signed-off-by: Ján Tomko --- src/qemu/qemu_driver.c | 9 -