Re: [PATCH RESEND 16/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListFindIndex()

2021-02-21 Thread Laine Stump
-by: Daniel Henrique Barboza Reviewed-by: Laine Stump (also Declared-should-have-been-done-this-way-in-the-first-place-by: Laine Stump :-)) --- src/util/virpci.c | 15 --- src/util/virpci.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/util

Re: [PATCH RESEND 15/20] qemu_cgroup.c: skip absent PCI devices in qemuTeardownHostdevCgroup()

2021-02-21 Thread Laine Stump
nst virDomainHostdevSubsysPCI *pcisrc = >source.subsys.u.pci; + +if (!virPCIDeviceExists(>addr)) +return 0; I would have skipped creating the temprorary variable, since it's only used once, but.. eh. Potato, potahtoe. Reviewed-by: Laine Stump +} + if (qemuDomainGetHo

Re: [PATCH RESEND 14/20] virhostdev.c: add virHostdevIsPCIDevice() helper

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Add a helper to quickly determine if a hostdev is a PCI device, instead of doing a tedius 'if' check with hostdev mode and s/tedius/tedious/ subsys type. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Laine Stump

Re: [PATCH RESEND 13/20] virsh-domain.c: modernize cmdDetachDevice()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Use g_auto* pointers to avoid the need of a cleanup label. The type of the pointer 'virDomainPtr dom' was changed to its alias 'virshDomainPtr' to allow the use of g_autoptr(). Signed-off-by: Daniel Henrique Barboza Reviewed-by: Laine Stump

Re: [PATCH RESEND 11/20] qemu_driver.c: modernize qemuNodeDeviceReAttach()

2021-02-21 Thread Laine Stump
that doesn't want to take the rest of this patch's refactoring of qemuNodeDeviceReAttach(), they can do it. Reviewed-by: Laine Stump but split the above line into a separate patch (which you can also put my R-b on) + /** * _virSecret: * diff --git a/src/qemu/qemu_driver.c b/src/qemu

Re: [PATCH RESEND 10/20] libvirt-nodedev.c: remove return value from virNodeDeviceFree()

2021-02-21 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: The function returns -1 on error, but no caller is actually checking the return value. Making it 'void' makes more sense with its current use. Signed-off-by: Daniel Henrique Barboza NAK - you can't change a public function. ---

Re: [PATCH RESEND 09/20] dac, selinux: skip setting/restoring label for absent PCI devices

2021-02-21 Thread Laine Stump
thing for AppArmor. Reviewed-by: Laine Stump but add another patch that fixes the problem for AppArmor too. (Also, all the code repetition here makes me think that there must be a better way to do this and reduce all the boilerplate, but I think it would be better to just make these changes

Re: [PATCH RESEND 06/20] virhostdev.c: virHostdevGetPCIHostDevice() now reports missing device

2021-02-21 Thread Laine Stump
the conceptual desire to return an error of some type in this case though, and there are other places where something similar is done (-2 indicates some type of "odd" error), so I'll let it pass :-) Reviewed-by: Laine Stump if (!pci)

Re: [PATCH RESEND 12/20] libxl_driver.c: modernize libxlNodeDeviceReAttach()

2021-02-19 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Use g_auto* wherever we can and remove the 'cleanup' label. Signed-off-by: Daniel Henrique Barboza This patch is also obsoleted by 23cdab6a3de0f6336505adcb446f77a6e0628e6b --- src/libxl/libxl_driver.c | 37

Re: [PATCH RESEND 11/20] qemu_driver.c: modernize qemuNodeDeviceReAttach()

2021-02-19 Thread Laine Stump
On 1/18/21 2:53 PM, Daniel Henrique Barboza wrote: Add virObjectUnref an autoptr cleanup func for virNodeDevice, then remove all unref and free calls from qemuNodeDeviceReAttach(). Signed-off-by: Daniel Henrique Barboza This patch is obsoleted by your own commit

Re: [PATCH RESEND 00/20] handle missing SR-IOV VF hostdevs during running domains

2021-02-16 Thread Laine Stump
On 2/16/21 8:16 AM, Daniel Henrique Barboza wrote: Ping for reviews (patches 1-4 and 7-8 already pushed). Yeah, sorry. It's been on my list ever since I left it half-finished, but I keep getting distra... OOHH LOOK!!! SOMETHING SHINY!! Okay, back to the subject - I promise

[libvirt PATCH 6/9] esx: reorder code to avoid need to VIR_FREE mimeType

2021-02-12 Thread Laine Stump
it will already be empty/NULL). Signed-off-by: Laine Stump --- src/esx/esx_driver.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 47873c0d54..2d010096a5 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c

[libvirt PATCH 8/9] esx: eliminate unnecessary cleanup: labels and result variables

2021-02-12 Thread Laine Stump
switching to g_autofree left many cleanup: sections empty. Signed-off-by: Laine Stump --- src/esx/esx_driver.c | 22 ++- src/esx/esx_storage_backend_vmfs.c | 22 +-- src/esx/esx_util.c | 8 ++ src/esx/esx_vi.c | 45

[libvirt PATCH 9/9] esx: replace some VIR_FREE with g_clear_pointer(x, g_free)

2021-02-12 Thread Laine Stump
These are all cases when 1) the pointer is passed by reference from the caller (ie.e. **) and expects it to be NULL on return if there is an error, or 2) the variable holding the pointer is being checked or re-used in the same function, but not right away. Signed-off-by: Laine Stump --- src/esx

[libvirt PATCH 1/9] esx: use g_autofree for char* where it is trivially possible

2021-02-12 Thread Laine Stump
All of these strings are allocated once, freed once, and are never returned out of the function where they are created, used, and are freed. Signed-off-by: Laine Stump --- src/esx/esx_driver.c | 128 + src/esx/esx_storage_backend_vmfs.c | 102

[libvirt PATCH 4/9] esx: switch VIR_FREE->g_free in esx*Free*()

2021-02-12 Thread Laine Stump
alled from a couple places each, and in all cases the pointer that is passed is a local variable, and goes out of scope almost immediately after calling the Free function, so it is safe to change VIR_FREE() into g_free(). Signed-off-by: Laine Stump --- src/esx/esx_driver.c | 2 +- src/esx/esx_str

[libvirt PATCH 7/9] esx: switch VIR_FREE->g_free when the pointer will immediately go out of scope

2021-02-12 Thread Laine Stump
Or when it will be immediately have a new value assigned to it. Signed-off-by: Laine Stump --- src/esx/esx_driver.c| 4 ++-- src/esx/esx_network_driver.c| 2 +- src/esx/esx_storage_backend_iscsi.c | 4 ++-- src/esx/esx_storage_backend_vmfs.c | 4 ++-- src/esx/esx_util.c

[libvirt PATCH 5/9] esx: use g_steal_pointer+g_autofree on return value

2021-02-12 Thread Laine Stump
If we put the potential return string into the g_autofreed tmpResult, and the move it to the returned "result" only as a final step ater, we can avoid the need to explicitly VIR_FREE (or g_free) on failure. Signed-off-by: Laine Stump --- src/esx/esx_driver.c | 12 1 file

[libvirt PATCH 2/9] esx: use g_autofree when made possible by reducing scope

2021-02-12 Thread Laine Stump
-by: Laine Stump --- src/esx/esx_driver.c| 13 - src/esx/esx_storage_backend_iscsi.c | 12 src/esx/esx_storage_backend_vmfs.c | 18 -- src/esx/esx_vi.c| 5 + 4 files changed, 13 insertions(+), 35 deletions(-) diff --git

[libvirt PATCH 0/9] eliminate (almost) all VIR_FREE in esx directory

2021-02-12 Thread Laine Stump
I figured someone may come up with an elegant translation to use GArray or GPtrArray instead, so I'm leaving them for now. Laine Stump (9): esx: use g_autofree for char* where it is trivially possible esx: use g_autofree when made possible by reducing scope esx: fix memory leak by switching to g_a

[libvirt PATCH 3/9] esx: fix memory leak by switching to g_autofree

2021-02-12 Thread Laine Stump
, and making it g_autofree, we eliminate the leak. Signed-off-by: Laine Stump --- src/esx/esx_storage_backend_vmfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/esx/esx_storage_backend_vmfs.c b/src/esx/esx_storage_backend_vmfs.c index 63959ec237..225b2a4751 100644

Re: [libvirt RFC PATCH 0/5] eliminating VIR_FREE in the *Clear() functions

2021-02-12 Thread Laine Stump
On 2/12/21 5:25 AM, Daniel P. Berrangé wrote: On Fri, Feb 12, 2021 at 11:07:21AM +0100, Erik Skultety wrote: On Fri, Feb 12, 2021 at 10:43:56AM +0100, Martin Kletzander wrote: On Fri, Feb 12, 2021 at 12:54:02AM -0500, Laine Stump wrote: I've looked at a few of these, and one thing I've found

[libvirt RFC PATCH 5/5] conf: replace virDomainDeviceInfoClear with virDomainDeviceInfoFreeContents

2021-02-11 Thread Laine Stump
In every case where virDomainDeviceInfoClear() is still being called, the object containing the DeviceInfo is freed immediately thereafter (yes, I checked them all!). This means we don't need to clear any of the data in the DeviceInfo, just free memory that it points to. Signed-off-by: Laine

[libvirt RFC PATCH 4/5] conf: don't call virDomainDeviceInfoClear from virDomainDeviceInfoParseXML

2021-02-11 Thread Laine Stump
of virDomainDeviceInfoParseXML() was just overly paranoid "safety code", and is unnecessary. Likewise, the call to clear the device info on return when there is a parse failure is also unnecessary, since in every case the caller immediately frees the object after the failure. So let's remove these. Signed-off

[libvirt RFC PATCH 2/5] conf: rename virDomainHostdevSubsysSCSIClear

2021-02-11 Thread Laine Stump
This function is only called from one place, and the object being "cleared" is never again referenced before being freed, so it doesn't need to be "cleared", just change its name to *FreeContents() so that we can remove its VIR_FREEs with a "clear" conscience (pun in

[libvirt RFC PATCH 3/5] conf: replace pointless VIR_FREEs with g_free in virDomainVideoDefClear()

2021-02-11 Thread Laine Stump
This function does a memset(0) at the end anyway, so there's no point in VIR_FREE vs g_free. Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3505d29dbe

[libvirt RFC PATCH 0/5] eliminating VIR_FREE in the *Clear() functions

2021-02-11 Thread Laine Stump
with g_free in the name of "progress?") Laine Stump (5): conf: rename and narrow scope of virDomainHostdevDefClear() conf: rename virDomainHostdevSubsysSCSIClear conf: replace pointless VIR_FREEs with g_free in virDomainVideoDefClear() conf: don't call virDomainDeviceInfoCle

[libvirt RFC PATCH 1/5] conf: rename and narrow scope of virDomainHostdevDefClear()

2021-02-11 Thread Laine Stump
amed function static for efficiency's sake. Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 19 +++ src/conf/domain_conf.h | 1 - src/libvirt_private.syms | 1 - 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf

[libvirt PATCH 8/8] vmware: convert VIR_FREE to g_free in other functions that free their arg

2021-02-11 Thread Laine Stump
Signed-off-by: Laine Stump --- src/vmware/vmware_conf.c | 4 ++-- src/vmware/vmware_driver.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index 55cd1d6f2d..f905962b85 100644 --- a/src/vmware/vmware_conf.c +++ b/src

[libvirt PATCH 6/8] qemu: convert VIR_FREE to g_free in other functions that free their arg

2021-02-11 Thread Laine Stump
Signed-off-by: Laine Stump --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_driver.c | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 14d05cfe3b..13efdcbad1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu

[libvirt PATCH 2/8] conf: convert VIR_FREE to g_free in other functions that free their arg

2021-02-11 Thread Laine Stump
(). Signed-off-by: Laine Stump --- src/conf/capabilities.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index dd3321db9a..69d9bb0e38 100644 --- a/src/conf/capabilities.c +++ b/src/conf

[libvirt PATCH 5/8] remote: convert VIR_FREE to g_free in other functions that free their arg

2021-02-11 Thread Laine Stump
Signed-off-by: Laine Stump --- src/remote/remote_daemon_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote/remote_daemon_stream.c b/src/remote/remote_daemon_stream.c index b4a3cb6741..57816eb10e 100644 --- a/src/remote/remote_daemon_stream.c +++ b/src/remote

[libvirt PATCH 7/8] util: convert VIR_FREE to g_free in other functions that free their arg

2021-02-11 Thread Laine Stump
Signed-off-by: Laine Stump --- src/util/virconf.c | 4 ++-- src/util/virerror.c | 4 ++-- src/util/virobject.c | 2 +- src/util/virstring.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/util/virconf.c b/src/util/virconf.c index d85fc32b64..16107bce96 100644

[libvirt PATCH 1/8] esx: replace VIR_FREE with g_free in any ESX_VI__TEMPLATE__FREE

2021-02-11 Thread Laine Stump
Invocations of the macro ESX_VI__TEMPLATE__FREE() will free the main object (referenced as "item") that's pointing to all the things being VIR_FREEd in the body, so it is safe for all the pointers in item to just be g_freed rather that VIR_FREEd. Signed-off-by: Laine Stump --- src/es

[libvirt PATCH 0/8] More VIR_FREE removals

2021-02-11 Thread Laine Stump
Only 90 this time. These are all functions that behave similar to the *Free() functions, but their names don't end in "Free" so I missed them last time. Laine Stump (8): esx: replace VIR_FREE with g_free in any ESX_VI__TEMPLATE__FREE conf: convert VIR_FREE to g_free in other

[libvirt PATCH 3/8] locking: convert VIR_FREE to g_free in other functions that free their arg

2021-02-11 Thread Laine Stump
Signed-off-by: Laine Stump --- src/locking/lock_manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c index db724eb30f..90ec5cdfbe 100644 --- a/src/locking/lock_manager.c +++ b/src/locking/lock_manager.c

[libvirt PATCH 4/8] openvz: convert VIR_FREE to g_free in other functions that free their arg

2021-02-11 Thread Laine Stump
Signed-off-by: Laine Stump --- src/openvz/openvz_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 1783dce233..041a031a3a 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -478,7 +478,7

[PATCH 6/7] qemu: plug config from into qemu commandline

2021-02-11 Thread Laine Stump
Signed-off-by: Laine Stump --- src/qemu/qemu_command.c | 15 --- .../net-virtio-teaming-hostdev.args | 40 +++ tests/qemuxml2argvtest.c | 3 ++ 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 tests

[PATCH 3/7] conf: separate Parse/Format functions for virDomainNetTeamingInfo

2021-02-10 Thread Laine Stump
In preparation for using the same element in two places, split the parsing/formating for that subelement out of the virDomainNetDef functions into their own functions. Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 74 +- 1 file changed, 45

[PATCH 4/7] schema: separate teaming element definition from interface element

2021-02-10 Thread Laine Stump
Signed-off-by: Laine Stump --- docs/schemas/domaincommon.rng | 39 --- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 7a2706a4fb..31960fb7cf 100644 --- a/docs/schemas

[PATCH 7/7] news: document support for in

2021-02-10 Thread Laine Stump
Signed-off-by: Laine Stump --- NEWS.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index c6ae6a6c60..a9a1a61119 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -35,6 +35,12 @@ v7.1.0 (unreleased) ``virNetworkGetXMLDesc()``, and ``virDomainScreenshot()``, APIs have

[PATCH 1/7] conf: make teaming info an official type

2021-02-10 Thread Laine Stump
This struct was previously defined only within virDomainNetDef where it was used, but I need to also use it in virDomainHostdevDef, so move the internal struct out to its own "official" struct and give it the standard typedef duo and *Free() function. Signed-off-by: Laine Stump ---

[PATCH 0/7] support (aka "QEMU virtio failover") with plain

2021-02-10 Thread Laine Stump
. (Previously we required for this feature, but that type of device needs to send netlink messages to the PF of the SRIOV VF that's being assigned, and that simply isn't possible sometimes.) Laine Stump (7): conf: make teaming info an official type conf: use virDomainNetTeamingInfoPtr instead

[PATCH 5/7] conf: parse/format element in plain

2021-02-10 Thread Laine Stump
other device in the pair. So, what we need to do is add support for the element to plain , and that is what this patch does. (actually, this patch adds parsing/formatting of the element in . The next patch will actually wire that into the qemu driver.) Signed-off-by: Laine Stump --- docs/fo

[PATCH 2/7] conf: use virDomainNetTeamingInfoPtr instead of virDomainNetTeamingInfo

2021-02-10 Thread Laine Stump
To make it easier to split out the parsing/formatting of the element into separate functions (so we can more easily add the element to , change its virDomainNetDef so that it points to a virDomainNetTeamingInfo rather than containing one. Signed-off-by: Laine Stump --- src/conf/domain_conf.c

[PATCH] qemu: match alias when looking for proper to detach.

2021-02-10 Thread Laine Stump
Resolves: https://bugzilla.redhat.com/1926190 Signed-off-by: Laine Stump --- Arguably, it would be nice to overhaul the device matching used for virDomainDeviceDetach for *all* the device types, as they could all be matched by looking at alias (and PCI address, for that matter). On the other han

[libvirt PATCH 11/15] security: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/security/security_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security/security_manager.c b/src/security/security_manager.c index be81ee5e44..67ede11981 100644 --- a/src/security/security_manager.c +++ b/src/security

[libvirt PATCH 09/15] logging: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/logging/log_handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 45a4763525..a77c1e0250 100644 --- a/src/logging/log_handler.c +++ b/src/logging/log_handler.c @@ -352,7 +352,7

[libvirt PATCH 08/15] hypervisor: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/hypervisor/virhostdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c index 09995a52ed..743aaa84d6 100644 --- a/src/hypervisor/virhostdev.c +++ b/src/hypervisor/virhostdev.c

[libvirt PATCH 15/15] datatypes: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/datatypes.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/datatypes.c b/src/datatypes.c index 1db38c5aa6..e36f3a2d24 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -347,7 +347,7

[libvirt PATCH 10/15] rpc: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/rpc/virnetclient.c| 4 ++-- src/rpc/virnetdaemon.c| 6 +++--- src/rpc/virnetlibsshsession.c | 18 +- src/rpc/virnetsaslcontext.c | 2 +- src/rpc/virnetserver.c| 8 src/rpc/virnetserverservice.c | 2 +- src

[libvirt PATCH 14/15] tests: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- tests/virfilecachetest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virfilecachetest.c b/tests/virfilecachetest.c index 34e0d0ab2f..4d65c0c6ce 100644 --- a/tests/virfilecachetest.c +++ b/tests/virfilecachetest.c @@ -43,7 +43,7

[libvirt PATCH 12/15] util: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/util/virdnsmasq.c | 2 +- src/util/virfilecache.c | 4 ++-- src/util/virmdev.c | 2 +- src/util/virnvme.c | 2 +- src/util/virpci.c | 2 +- src/util/virresctrl.c | 40 src/util/virscsi.c

[libvirt PATCH 13/15] conf: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/conf/capabilities.c| 22 +++--- src/conf/checkpoint_conf.c | 2 +- src/conf/domain_capabilities.c | 12 src/conf/domain_conf.c | 2 +- src/conf/domain_event.c| 52 +- src/conf

[libvirt PATCH 06/15] interface: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/interface/interface_backend_netcf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index df04484c59..e40a4cb108 100644 --- a/src/interface

[libvirt PATCH 04/15] libxl: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/libxl/libxl_conf.c | 20 ++-- src/libxl/libxl_migration.c | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index de0fd66842..37a2c2e3cd 100644 --- a/src/libxl

[libvirt PATCH 07/15] access: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/access/viraccessmanager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c index 02e4464ef5..c81d0840b3 100644 --- a/src/access/viraccessmanager.c +++ b/src/access

[libvirt PATCH 05/15] qemu: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/qemu/qemu_agent.c| 2 +- src/qemu/qemu_capabilities.c | 10 +-- src/qemu/qemu_conf.c | 122 +-- src/qemu/qemu_domain.c | 10 +-- src/qemu/qemu_monitor.c | 4 +- 5 files changed, 74 insertions

[libvirt PATCH 03/15] bhyve: replace VIR_FREE with g_free in all *Dispose() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/bhyve/bhyve_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bhyve/bhyve_conf.c b/src/bhyve/bhyve_conf.c index 9012eb8b5f..0f60aac9a0 100644 --- a/src/bhyve/bhyve_conf.c +++ b/src/bhyve/bhyve_conf.c @@ -97,7 +97,7

[libvirt PATCH 02/15] rpc: eliminate static function virNetLibsshSessionAuthMethodsFree()

2021-02-03 Thread Laine Stump
r than try to think up an appropriate name, let's just move the meat of this function into its one and only caller, virNetLibsshSessionDispose(), which will allow us to convert its VIR_FREEs into g_free in a future patch. Signed-off-by: Laine Stump --- src/rpc/virnetlibsshsess

[libvirt PATCH 01/15] conf: simplify virDomainCapsDispose()

2021-02-03 Thread Laine Stump
the contents of virDomainCapsStringValuesFree() into virDomainCapsDispose() (and *that* function will be trivially converted in an upcoming "mechanical" patch). Signed-off-by: Laine Stump --- src/conf/domain_capabilities.c | 21 ++--- 1 file changed, 6 insertions(+), 15

[libvirt PATCH 00/15] eliminate VIR_FREE in all *Dispose() functions

2021-02-03 Thread Laine Stump
heir VIR_FREEs to be g_free-ified (in later patches, along with the other *Dispose() functions in the same directories). 220 VIR_FREE uses eliminated in this series, so a total of 762 for the two series combined (nearly 20% of all remaining VIR_FREEs). Laine Stump (15): conf: simplify virDom

[libvirt PATCH v2 14/24] rpc: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/rpc/virnetmessage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c index b728e73f4f..9f7334ae4c 100644 --- a/src/rpc/virnetmessage.c +++ b/src/rpc/virnetmessage.c @@ -88,7 +88,7 @@ void

[libvirt PATCH v2 13/24] remote: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/remote/remote_daemon_config.c | 48 ++--- src/remote/remote_daemon_dispatch.c | 4 +-- src/remote/remote_driver.c | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/remote/remote_daemon_config.c b

[libvirt PATCH v2 15/24] security: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/security/security_dac.c | 8 src/security/security_selinux.c | 10 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 389d1dac51..00eeae0d27 100644 --- a/src

[libvirt PATCH v2 21/24] qemu: rename virFirmware*Free() functions to have more accurate names

2021-02-03 Thread Laine Stump
to eliminate a few occurrences of VIR_FREE(), this patch renames those functions to more accurately reflect what they do - they Free the *Content* of their arguments. Signed-off-by: Laine Stump --- src/qemu/qemu_firmware.c | 22 +++--- 1 file changed, 11 insertions(+), 11

[libvirt PATCH v2 17/24] tests: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- tests/nodedevmdevctltest.c | 4 ++-- tests/nwfilterxml2firewalltest.c | 2 +- tests/qemuhotplugtest.c | 12 ++-- tests/qemumonitortestutils.c | 28 ++-- tests/virnetdaemontest.c | 2 +- tests

[libvirt PATCH v2 11/24] locking: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/locking/lock_daemon.c | 6 +++--- src/locking/lock_daemon_config.c | 6 +++--- src/locking/lock_driver_lockd.c | 10 +- src/locking/lock_driver_sanlock.c | 6 +++--- src/locking/lock_manager.c| 2 +- 5 files changed, 15 insertions

[libvirt PATCH v2 24/24] rpc: rename virNetSessionAuthMethodsFree to virNetSessionAuthMethodsClear

2021-02-03 Thread Laine Stump
"written-but-never-used" functions that can be deleted? (if the latter is the case, then I would rather move the contents of virNetSessionAuthMethodsFree() into its only other caller, virNetSSHSessionDispose(), so that the VIR_FREEs could be replaced with g_free.) Signed-off-by: L

[libvirt PATCH v2 22/24] qemu: pass pointers instead of copying objects for qemuFirmware*FreeContent()

2021-02-03 Thread Laine Stump
change these functions to just send pointers to the objects they're cleaning out rather than all the wasteful and pointless copying. Signed-off-by: Laine Stump --- src/qemu/qemu_firmware.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/qemu

[libvirt PATCH v2 20/24] util: rename two *Free() functions while changing VIR_FREE to g_free

2021-02-03 Thread Laine Stump
that *Clear() also wouldn't be correct, lets name the functions *FreeContent(), which is an accurate description of what the functions do, and what we *want* them to do. And since it's such a small patch, we can go ahead and change that behavior - replacing the VIR_FREEs with g_free. Signed-off-by: Laine

[libvirt PATCH v2 23/24] qemu: replace VIR_FREE with g_free in qemuFirmware*FreeContent()

2021-02-03 Thread Laine Stump
These functions are all only called as a part of qemuFirmwareFree(), which frees the qemuFirmware object before return, so we can be sure none of the pointers is referenced after freeing (and thus there is no need to clear any of them). Signed-off-by: Laine Stump --- src/qemu/qemu_firmware.c

[libvirt PATCH v2 19/24] libvirtd: replace straggler VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/libvirt-domain.c | 18 +- src/libvirt-network.c | 14 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index c9f8ffdb56..dba89a7d3a 100644 --- a/src/libvirt-domain.c

[libvirt PATCH v2 16/24] tools: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- tools/virsh-checkpoint.c | 6 +++--- tools/virsh-domain-monitor.c | 4 ++-- tools/virsh-domain.c | 2 +- tools/virsh-interface.c | 4 ++-- tools/virsh-network.c| 8 tools/virsh-nodedev.c| 4 ++-- tools/virsh

[libvirt PATCH v2 18/24] storage: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/storage/storage_backend_fs.c | 6 +++--- src/storage/storage_backend_rbd.c | 10 +- src/storage/storage_backend_scsi.c | 4 ++-- src/storage/storage_driver.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src

[libvirt PATCH v2 09/24] vz: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/vz/vz_driver.c | 8 src/vz/vz_utils.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index b60e99d4f5..0ebcb06234 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -2729,10

[libvirt PATCH v2 08/24] vmx: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/vmx/vmx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 56318fc8b2..db535ba260 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -650,10 +650,10 @@ virVMXDomainDefNamespaceFree(void *nsdata

[libvirt PATCH v2 12/24] logging: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/logging/log_daemon.c| 4 ++-- src/logging/log_daemon_config.c | 6 +++--- src/logging/log_handler.c | 6 +++--- src/logging/log_manager.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/logging/log_daemon.c b/src

[libvirt PATCH v2 03/24] bhyve: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/bhyve/bhyve_conf.c | 6 +++--- src/bhyve/bhyve_domain.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bhyve/bhyve_conf.c b/src/bhyve/bhyve_conf.c index f3e2ebf7c7..9012eb8b5f 100644 --- a/src/bhyve/bhyve_conf.c +++ b/src/bhyve

[libvirt PATCH v2 07/24] vbox: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/vbox/vbox_snapshot_conf.c | 54 +-- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index cb201e777e..f1cae3039a 100644 --- a/src/vbox

[libvirt PATCH v2 10/24] admin: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/admin/admin_server_dispatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/admin/admin_server_dispatch.c b/src/admin/admin_server_dispatch.c index 0efb4485d4..57e8904f4c 100644 --- a/src/admin/admin_server_dispatch.c +++ b/src/admin

[libvirt PATCH v2 06/24] test_driver: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/test/test_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 29c4c86b1d..bca1297d1d 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -198,8 +198,8

[libvirt PATCH v2 05/24] qemu: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/qemu/qemu_block.c| 36 src/qemu/qemu_capabilities.c | 8 +++--- src/qemu/qemu_cgroup.c | 4 +-- src/qemu/qemu_conf.c | 6 ++-- src/qemu/qemu_domain.c | 14 +- src/qemu

[libvirt PATCH v2 02/24] util: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/util/virarptable.c | 8 +-- src/util/virauthconfig.c| 4 +- src/util/virbitmap.c| 4 +- src/util/vircgroup.c| 12 ++--- src/util/vircommand.c | 24 - src/util/virconf.c | 10 ++-- src

[libvirt PATCH v2 04/24] libxl: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/libxl/libxl_domain.c| 2 +- src/libxl/libxl_driver.c| 2 +- src/libxl/libxl_migration.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 380f7e0b56..3bcd369d12 100644

[libvirt PATCH v2 00/24] eliminate VIR_FREE in all *Free() functions

2021-02-03 Thread Laine Stump
function, and that that object is freed before return) Laine Stump (24): conf: replace remaining straggler VIR_FREE with g_free in vir*Free() util: replace VIR_FREE with g_free in all vir*Free() functions bhyve: replace VIR_FREE with g_free in all vir*Free() functions libxl: replace VIR_FREE wi

[libvirt PATCH v2 01/24] conf: replace remaining straggler VIR_FREE with g_free in vir*Free()

2021-02-03 Thread Laine Stump
I missed a few in commit f9f81f1c Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 6 +++--- src/conf/numa_conf.c | 10 +- src/conf/storage_encryption_conf.c | 2 +- src/conf/virchrdev.c | 6 +++--- 4 files changed, 12 insertions(+), 12

SELF NACK (Re: [libvirt PATCH 00/21] eliminate VIR_FREE in all *Free() functions)

2021-02-03 Thread Laine Stump
the correct versions as "PATCH v2". On 2/3/21 10:28 PM, Laine Stump wrote: When I sent a patch to convert (what I thought was) all of the VIR_FREEs in any *Free() function in the conf directory to g_free (with the justification that it was trivial to verify that the pointers weren't being refere

[libvirt PATCH 11/21] locking: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/locking/lock_daemon.c | 6 +++--- src/locking/lock_daemon_config.c | 6 +++--- src/locking/lock_driver_lockd.c | 10 +- src/locking/lock_driver_sanlock.c | 6 +++--- src/locking/lock_manager.c| 2 +- 5 files changed, 15 insertions

[libvirt PATCH 08/21] vmx: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/vmx/vmx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 56318fc8b2..db535ba260 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -650,10 +650,10 @@ virVMXDomainDefNamespaceFree(void *nsdata

[libvirt PATCH 18/21] storage: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/storage/storage_backend_fs.c | 6 +++--- src/storage/storage_backend_rbd.c | 10 +- src/storage/storage_backend_scsi.c | 4 ++-- src/storage/storage_driver.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src

[libvirt PATCH 20/21] util: rename two *Free() functions while changing VIR_FREE to g_free

2021-02-03 Thread Laine Stump
that *Clear() also wouldn't be correct, lets name the functions *FreeContent(), which is an accurate description of what the functions do, and what we *want* them to do. And since it's such a small patch, we can go ahead and change that behavior - replacing the VIR_FREEs with g_free. Signed-off-by: Laine

[libvirt PATCH 13/21] remote: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/remote/remote_daemon_config.c | 48 ++--- src/remote/remote_daemon_dispatch.c | 4 +-- src/remote/remote_driver.c | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/remote/remote_daemon_config.c b

[libvirt PATCH 05/21] qemu: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/qemu/qemu_block.c| 36 src/qemu/qemu_capabilities.c | 8 +++--- src/qemu/qemu_cgroup.c | 4 +-- src/qemu/qemu_conf.c | 6 ++-- src/qemu/qemu_domain.c | 14 +- src/qemu

[libvirt PATCH 21/21] rpc: rename virNetSessionAuthMethodsFree to virNetSessionAuthMethodsClear

2021-02-03 Thread Laine Stump
"written-but-never-used" functions that can be deleted? (if the latter is the case, then I would rather move the contents of virNetSessionAuthMethodsFree() into its only other caller, virNetSSHSessionDispose(), so that the VIR_FREEs could be replaced with g_free.) Signed-off-by: L

[libvirt PATCH 12/21] logging: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/logging/log_daemon.c| 4 ++-- src/logging/log_daemon_config.c | 6 +++--- src/logging/log_handler.c | 6 +++--- src/logging/log_manager.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/logging/log_daemon.c b/src

[libvirt PATCH 06/21] test_driver: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/test/test_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 29c4c86b1d..bca1297d1d 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -198,8 +198,8

[libvirt PATCH 04/21] libxl: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/libxl/libxl_domain.c| 2 +- src/libxl/libxl_driver.c| 2 +- src/libxl/libxl_migration.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 380f7e0b56..3bcd369d12 100644

[libvirt PATCH 09/21] vz: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- src/vz/vz_driver.c | 8 src/vz/vz_utils.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index b60e99d4f5..0ebcb06234 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -2729,10

[libvirt PATCH 17/21] tests: replace VIR_FREE with g_free in all vir*Free() functions

2021-02-03 Thread Laine Stump
Signed-off-by: Laine Stump --- tests/nodedevmdevctltest.c | 4 ++-- tests/nwfilterxml2firewalltest.c | 2 +- tests/qemuhotplugtest.c | 12 ++-- tests/qemumonitortestutils.c | 28 ++-- tests/virnetdaemontest.c | 2 +- tests

<    1   2   3   4   5   6   7   8   9   10   >