[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/securit

[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 @@ -135,

[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 @@ virDomainDi

[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 @@ stati

[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 | 2

[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/moment_

[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/interface_backend_n

[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/libxl_con

[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/viraccessmanager.

[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(+), 7

[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 @@ virBhyveDriverC

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

2021-02-03 Thread Laine Stump
This function is only called from one place, and has, well... not a *misleading* name, but it doesn't fit the standard frame of functions that end in "Free" (it doesn't actually free the object pointed to by its argument, but frees *some parts* of the content of the object). Rather than try to thi

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

2021-02-03 Thread Laine Stump
virDomainCapsDispose() was the only caller of virDomainCapsStringValuesFree(), which 1) didn't actually free the object it was called with, but only cleared it, making it less mechanical to convert from VIR_FREE to g_free (since it's not immediately obvious from looking at virDomainCapsStringValues

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

2021-02-03 Thread Laine Stump
A *Dispose() function is similar to a *Free() function, except that 1) the object is always sent as a void* so it has to be typecast into some other object-specific pointer at the top of the function, and 2) it frees all the resources inside the object, but never frees the object itself (this is do

[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 virNe

[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/s

[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/sec

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

2021-02-03 Thread Laine Stump
Several functions had the names virFirmware[something]Free(), but they aren't taking a pointer to some object and freeing it. Instead, they are making a copy of the content of an entire object, then Freeing the objects pointed to by that content. As a first step in a too-complicated cleanup just t

[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/virnetserver

[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
This is another *Free() function that doesn't free the object it is passed. Instead it frees and clears some parts of the object. In this case, the function is actually called from two places, and one of them (virNetSSHSessionAuthReset) appears to be assuming that the pointers actually *will* be c

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

2021-02-03 Thread Laine Stump
These functions all cooperate to free memory pointed to by a single object that contains (doesn't *point to*, but acutally contains) several sub-objects. They were written to send copies of these sub-objects to subordinate functions, rather than just sending pointers to the sub-objects. Let's chan

[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 | 8

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

2021-02-03 Thread Laine Stump
dhcpHostFree() and addnHostFree() don't follow the normal pattern of *Free functions in the rest of libvirt code - they are actually more similar to the *Dispose() functions, in that they free all subordinate objects, but not the object pointed to by the argument itself. However, the arguments aren

[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-nwfilter.c

[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/stora

[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 +2729

[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) st

[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/lo

[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/bhyv

[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/vbox_snapshot_con

[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/a

[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 @@ testDom

[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/qemu_firmw

[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/uti

[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
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 referenced after they had been freed), there were two responses that stuck in my min

[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 d

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

2021-02-03 Thread Laine Stump
Sigh. Self-NACK to this entire series. I accidentally took the starting commit ID for the starting patch in the git send-email command from a stale instance of gitk that was sitting on my desktop, so these are *not* the final versions or ordering of the patches :-( I'm now sending the correc

[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) st

[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/stora

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

2021-02-03 Thread Laine Stump
dhcpHostFree() and addnHostFree() don't follow the normal pattern of *Free functions in the rest of libvirt code - they are actually more similar to the *Dispose() functions, in that they free all subordinate objects, but not the object pointed to by the argument itself. However, the arguments aren

[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/s

[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/qemu_firmw

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

2021-02-03 Thread Laine Stump
This is another *Free() function that doesn't free the object it is passed. Instead it frees and clears some parts of the object. In this case, the function is actually called from two places, and one of them (virNetSSHSessionAuthReset) appears to be assuming that the pointers actually *will* be c

[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/lo

[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 @@ testDom

[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 +2729

[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/virnetserver

[libvirt PATCH 16/21] 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-nwfilter.c

[libvirt PATCH 14/21] 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 virNe

[libvirt PATCH 07/21] 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/vbox_snapshot_con

[libvirt PATCH 19/21] 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 02/21] 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/uti

[libvirt PATCH 15/21] 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/sec

[libvirt PATCH 10/21] 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/a

[libvirt PATCH 03/21] 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/bhyv

[libvirt PATCH 01/21] 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 d

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

2021-02-03 Thread Laine Stump
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 referenced after they had been freed), there were two responses that stuck in my min

Re: [PATCH 00/10] Introduce virtio-mem model

2021-02-03 Thread Jing Qi
Michal, I checked the virtio_mem module and it's loaded - lsmod |grep virtio_mem virtio_mem 32768 0 And I can't make the actual value change to non-zerio. -> virsh update-memory pc --requested-size 256M or ->virsh setmem pc 1000M 524288 0 2048

Re: [PATCH] vircgroup: Don't leak @parent in virCgroupEnableMissingControllers()

2021-02-03 Thread Pavel Hrdina
On Wed, Feb 03, 2021 at 09:06:52PM +0100, Michal Privoznik wrote: > A memory leak was identified in > virCgroupEnableMissingControllers(): > > ==11680==at 0x483EAE5: calloc (vg_replace_malloc.c:760) > ==11680==by 0x4E51780: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6701.0) > ==11680==b

[PATCH] vircgroup: Don't leak @parent in virCgroupEnableMissingControllers()

2021-02-03 Thread Michal Privoznik
A memory leak was identified in virCgroupEnableMissingControllers(): ==11680==at 0x483EAE5: calloc (vg_replace_malloc.c:760) ==11680==by 0x4E51780: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6701.0) ==11680==by 0x4908618: virCgroupNew (vircgroup.c:701) ==11680==by 0x49096F4: virCgro

Re: [PATCH 3/4] hw/virtio/virtio-balloon: Remove the "class" property

2021-02-03 Thread David Hildenbrand
On 03.02.21 18:18, Thomas Huth wrote: This property was only required for compatibility reasons in the pc-1.0 machine type and earlier. Now that these machine types have been removed, the property is not useful anymore. Signed-off-by: Thomas Huth --- hw/virtio/virtio-balloon-pci.c | 11 +-

[libvirt PATCH] qemu_driver: increase recorded counter for disk block stats

2021-02-03 Thread Pavel Hrdina
Commit <318d807a0bd3372b634d1952b559c5c627ccfa5b> added a fix to skip most of the block stat code to not log error message for missing storage sources but forgot to increase the recordnr counter. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_driver.c | 10 -- 1 file changed, 8 insertions

[libvirt PATCH] qemu_monitor_json: fix JSON generator for VC chardev

2021-02-03 Thread Pavel Hrdina
The correct backend type is 'vc', same as in qemuBuildChrChardevStr() where we generate qemu command line. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_monitor_json.c | 5 - tests/qemumonitorjsontest.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_mon

Re: [libvirt PATCH v2 6/6] qemu: implement vhost-user-blk support

2021-02-03 Thread Pavel Hrdina
On Wed, Feb 03, 2021 at 05:42:14PM +0100, Peter Krempa wrote: > On Wed, Feb 03, 2021 at 16:25:59 +0100, Pavel Hrdina wrote: > > Implements QEMU support for vhost-user-blk together with live > > hotplug/unplug. > > > > Signed-off-by: Pavel Hrdina > > Reviewed-by: Ján Tomko > > --- > > > > Change

[libvirt PATCH v4 25/25] nodedev: fix hang when destroying an mdev in use

2021-02-03 Thread Jonathon Jongsma
Calling `mdevctl stop` for a mediated device that is in use by an active domain will block until that vm exits (or the vm closes the device). Since the nodedev driver cannot query the hypervisor driver to see whether any active domains are using the device, we resort to a workaround that relies on

[libvirt PATCH v4 21/25] api: add virNodeDeviceCreate()

2021-02-03 Thread Jonathon Jongsma
This new API function provides a way to start a persistently-defined mediate device that was defined by virNodeDeviceDefineXML() (or one that was defined externally via mdevctl) Signed-off-by: Jonathon Jongsma --- include/libvirt/libvirt-nodedev.h| 2 + src/driver-nodedev.h

[libvirt PATCH v4 11/25] nodedev: handle mdevs that disappear from mdevctl

2021-02-03 Thread Jonathon Jongsma
mdevctl does not currently provide any events when the list of defined devices changes, so we will need to poll mdevctl for the list of defined devices periodically. When a mediated device no longer exists from one iteration to the next, we need to treat it as an "undefine" event. When we get such

[libvirt PATCH v4 17/25] nodedev: refactor tests to support mdev undefine

2021-02-03 Thread Jonathon Jongsma
mdevctl 'stop' and 'undefine' commands take the same uuid parameter, so refactor the test infrastructure to share common implementation for both of these commands. The 'undefine' command will be introduced in a following patch. Signed-off-by: Jonathon Jongsma --- tests/nodedevmdevctltest.c | 48

[libvirt PATCH v4 24/25] nodedev: add ability to specify UUID for new mdevs

2021-02-03 Thread Jonathon Jongsma
Use the new element in the mdev caps to define and start devices with a specific UUID. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 18 +++--- ...019_36ea_4111_8f0a_8c9a70e21366-define.argv | 3 ++- ...d019_36ea_4111_8f0a_8c9a70e21366-start.a

[libvirt PATCH v4 22/25] virsh: add "nodedev-start" command

2021-02-03 Thread Jonathon Jongsma
This virsh command maps to virNodeDeviceCreate(), which starts a node device that has been previously defined by virNodeDeviceDefineXML(). This is only supported for mediated devices. Signed-off-by: Jonathon Jongsma --- tools/virsh-nodedev.c | 57 +++ 1 fi

[libvirt PATCH v4 23/25] nodedev: add element to mdev caps

2021-02-03 Thread Jonathon Jongsma
It will be useful to be able to specify a particular UUID for a mediated device when defining the node device. To accomodate that, allow this to be specified in the xml schema. This patch also parses and formats that value to the xml, but does not yet use it. Signed-off-by: Jonathon Jongsma ---

[libvirt PATCH v4 08/25] nodedev: add DEFINED/UNDEFINED lifecycle events

2021-02-03 Thread Jonathon Jongsma
Since a mediated device can be persistently defined by the mdevctl backend, we need additional lifecycle events beyond CREATED/DELETED to indicate that e.g. the device has been stopped but the device definition still exists. Signed-off-by: Jonathon Jongsma --- examples/c/misc/event-test.c |

[libvirt PATCH v4 10/25] nodedev: add helper functions to remove node devices

2021-02-03 Thread Jonathon Jongsma
When a mediated device is stopped or undefined by an application outside of libvirt, we need to remove it from our list of node devices within libvirt. This patch introduces virNodeDeviceObjListRemoveLocked() and virNodeDeviceObjListForEach() (which are analogous to other types of object lists in l

[libvirt PATCH v4 16/25] virsh: add nodedev-define command

2021-02-03 Thread Jonathon Jongsma
Add a virsh command that maps to virNodeDeviceDefineXML(). Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- tools/virsh-nodedev.c | 58 +++ 1 file changed, 58 insertions(+) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index a2

[libvirt PATCH v4 15/25] virsh: Add --inactive, --all to nodedev-list

2021-02-03 Thread Jonathon Jongsma
Now that we can filter active and inactive node devices in virConnectListAllNodeDevices(), add these switches to the virsh command. Eventual output (once everything is hooked up): virsh # nodedev-list --cap mdev mdev_bd2ea955_3402_4252_8c17_7468083a0f26 virsh # nodedev-list --inactiv

[libvirt PATCH v4 18/25] api: add virNodeDeviceUndefine()

2021-02-03 Thread Jonathon Jongsma
This interface allows you to undefine a persistently defined (but inactive) mediated devices. It is implemented via 'mdevctl' Signed-off-by: Jonathon Jongsma --- include/libvirt/libvirt-nodedev.h | 2 + src/access/viraccessperm.c| 2 +- src/access/viraccessperm.

[libvirt PATCH v4 20/25] virsh: add nodedev-undefine command

2021-02-03 Thread Jonathon Jongsma
Add a virsh command that maps to virNodeDeviceUndefine(). Signed-off-by: Jonathon Jongsma --- tools/virsh-nodedev.c | 61 +++ 1 file changed, 61 insertions(+) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index 530fe30c0f..87e2998982 100644 -

[libvirt PATCH v4 14/25] api: add virNodeDeviceDefineXML()

2021-02-03 Thread Jonathon Jongsma
With mediated devices, we can now define persistent node devices that can be started and stopped. In order to take advantage of this, we need an API to define new node devices. Signed-off-by: Jonathon Jongsma --- include/libvirt/libvirt-nodedev.h| 4 ++ src/driver-nodedev.h

[libvirt PATCH v4 19/25] virsh: Factor out function to find node device

2021-02-03 Thread Jonathon Jongsma
Several functions accept providing a node device by name or by wwnn,wwpn pair. Extract the logic to do this into a function that can be used by both callers. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- tools/virsh-nodedev.c | 58 +-- 1

[libvirt PATCH v4 13/25] nodedev: add function to generate mdevctl define command

2021-02-03 Thread Jonathon Jongsma
Abstract out the function used to generate the commandline for 'mdevctl start' since they take the same arguments. Add tests to ensure that we're generating the command properly. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 28 ++-- src/node_device/node

[libvirt PATCH v4 12/25] nodedev: Refresh mdev devices when changes are detected

2021-02-03 Thread Jonathon Jongsma
We need to query mdevctl for changes to device definitions since an administrator can define new devices by executing mdevctl outside of libvirt. In the future, mdevctl may add a way to signal device add/remove via events, but for now we resort to a bit of a workaround: monitoring the mdevctl conf

[libvirt PATCH v4 04/25] nodedev: expose internal helper for naming devices

2021-02-03 Thread Jonathon Jongsma
Expose a helper function that can be used by udev and mdevctl to generate device names for node devices. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- src/node_device/node_device_driver.c | 25 + src/node_device/node_device_driver.h | 6 ++ src/node

[libvirt PATCH v4 09/25] nodedev: add mdevctl devices to node device list

2021-02-03 Thread Jonathon Jongsma
At startup, query devices that are defined by 'mdevctl' and add them to the node device list. This adds a complication: we now have two potential sources of information for a node device: - udev for all devices and for activated mediated devices - mdevctl for persistent mediated devices Unfortu

[libvirt PATCH v4 07/25] nodedev: add persistence to virNodeDeviceObj

2021-02-03 Thread Jonathon Jongsma
Consistent with other objects (e.g. virDomainObj), add a field to indicate whether the node device is persistent or transient. Signed-off-by: Jonathon Jongsma --- src/conf/virnodedeviceobj.c | 14 ++ src/conf/virnodedeviceobj.h | 6 ++ src/libvirt_private.syms| 2 ++ 3 file

[libvirt PATCH v4 06/25] nodedev: add ability to list defined mdevs

2021-02-03 Thread Jonathon Jongsma
This adds an internal API to query for persistent mediated devices that are defined by mdevctl. Upcoming commits will make use of this information. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 18 + src/node_device/node_device_driver.h | 3

[libvirt PATCH v4 02/25] nodedev: introduce concept of 'active' node devices

2021-02-03 Thread Jonathon Jongsma
we will be able to define mediated devices that can be started or stopped, so we need to be able to indicate whether the device is active or not, similar to other resources (storage pools, domains, etc.) Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- src/conf/virnodedeviceobj.c

[libvirt PATCH v4 05/25] nodedev: add ability to parse mdevs from mdevctl

2021-02-03 Thread Jonathon Jongsma
This function will parse the list of mediated devices that are returned by mdevctl and convert it into our internal node device representation. Signed-off-by: Jonathon Jongsma --- src/node_device/node_device_driver.c | 145 ++ src/node_device/node_device_driver.h

[libvirt PATCH v4 03/25] nodedev: Add ability to filter by active state

2021-02-03 Thread Jonathon Jongsma
Add two flag values for virConnectListAllNodeDevices() so that we can list only node devices that are active or inactive. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- include/libvirt/libvirt-nodedev.h| 9 +++-- src/conf/node_device_conf.h | 8 src/conf/virn

[libvirt PATCH v4 01/25] tests: remove extra trailing semicolon

2021-02-03 Thread Jonathon Jongsma
The macro should not have a trailing semicolon so that when the macro is used, the user can add a semicolon themselves. Signed-off-by: Jonathon Jongsma Reviewed-by: Erik Skultety --- tests/nodedevmdevctltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/nodedevmdev

[libvirt PATCH v4 00/25] Add support for persistent mediated devices

2021-02-03 Thread Jonathon Jongsma
This patch series follows the previously-merged series which added support for transient mediated devices. This series expands mdev support to include persistent device definitions. Again, it relies on mdevctl as the backend. It follows the common libvirt pattern of APIs by adding the following ne

Re: [PATCH 1/4] hw/i386: Remove the deprecated pc-1.x machine types

2021-02-03 Thread Daniel P . Berrangé
On Wed, Feb 03, 2021 at 06:18:29PM +0100, Thomas Huth wrote: > They have been deprecated since QEMU v5.0, time to remove them now. > > Signed-off-by: Thomas Huth > --- > docs/system/deprecated.rst | 6 -- > docs/system/removed-features.rst | 6 ++ > hw/i386/pc_piix.c| 94

[PATCH 4/4] hw/usb/bus: Remove the "full-path" property

2021-02-03 Thread Thomas Huth
This property was only required for the pc-1.0 and earlier machine types. Since these have been removed now, we can delete the property as well. Signed-off-by: Thomas Huth --- hw/usb/bus.c | 7 +-- include/hw/usb.h | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/hw

[PATCH 3/4] hw/virtio/virtio-balloon: Remove the "class" property

2021-02-03 Thread Thomas Huth
This property was only required for compatibility reasons in the pc-1.0 machine type and earlier. Now that these machine types have been removed, the property is not useful anymore. Signed-off-by: Thomas Huth --- hw/virtio/virtio-balloon-pci.c | 11 +-- 1 file changed, 1 insertion(+), 10

  1   2   >