[libvirt PATCH 07/10] virNWFilterBindingDefForNet: Remove superfluous `goto`s

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/domain_nwfilter.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/conf/domain_nwfilter.c b/src/conf/domain_nwfilter.c index cb35221a59..0a67b6765e 100644 --- a/src/conf/domain_nwfilter.c +++ b/src/conf/domain_nwfilter.c

[libvirt PATCH v2 00/10] virHashNew refactorings - part II

2021-07-13 Thread Tim Wiederhake
"virHashNew" cannot return NULL, yet we check for NULL in various places. V1: https://listman.redhat.com/archives/libvir-list/2021-July/msg00188.html Changes since V1: * Moved the inversion of the `if` condition in patch #9 to patch #8 * Only patches #8 and #9 are missing review Tim

[libvirt PATCH v2 04/10] virNWFilterRuleDefToRuleInst: `virHashNew` cannot return NULL

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/nwfilterxml2firewalltest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c index bdfe858185..75a70e9972 100644 --- a/tests

[libvirt PATCH v2 03/10] virNWFilterCreateVarsFrom: Remove superfluous `goto`s

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/nwfilterxml2firewalltest.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c index 26d4a936ad..bdfe858185 100644 --- a/tests

[libvirt PATCH v2 08/10] qemuMonitorGetMemoryDeviceInfo: Assign hash table only on success

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/qemu/qemu_monitor.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index a2df1a6ec3..9b1a3ec3eb 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4214,6

[libvirt PATCH v2 10/10] qemuMonitorGetMemoryDeviceInfo: `virHashNew` cannot return NULL

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0b5da8b71f..f66a3457c1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu

[libvirt PATCH v2 05/10] iptablesPrivateChainCreate: `virHashNew` cannot return NULL

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/viriptables.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 4189578245..198ece3d71 100644 --- a/src/util/viriptables.c +++ b/src/util

[libvirt PATCH v2 02/10] virNWFilterCreateVarsFrom: Use automatic memory management

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/nwfilterxml2firewalltest.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c index 3b7190b5cd..26d4a936ad 100644 --- a/tests

[libvirt PATCH v2 06/10] iptablesPrivateChainCreate: Use automatic memory management

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/viriptables.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 198ece3d71..847af9b9d7 100644 --- a/src/util/viriptables.c +++ b/src/util

[libvirt PATCH v2 01/10] virNWFilterCreateVarsFrom: `virHashNew` cannot return NULL

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/nwfilterxml2firewalltest.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c index 6709cc15fd..3b7190b5cd 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b

[libvirt PATCH v2 09/10] qemuMonitorGetMemoryDeviceInfo: Use automatic memory management

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/qemu/qemu_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 9b1a3ec3eb..0b5da8b71f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4214,7 +4214,7

[libvirt PATCH v2 07/10] iptablesPrivateChainCreate: Remove superfluous `goto`s

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/viriptables.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 847af9b9d7..721e1eeae7 100644 --- a/src/util/viriptables.c +++ b/src/util

[libvirt PATCH 04/10] virNWFilterBindingDefCopy: Remove superfluous `goto`s

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/virnwfilterbindingdef.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/conf/virnwfilterbindingdef.c b/src/conf/virnwfilterbindingdef.c index 4ed3763efd..22ecf7b828 100644 --- a/src/conf/virnwfilterbindingdef.c +++ b/src/conf

[libvirt PATCH 01/10] conf: Add AUTOPTR_CLEANUP_FUNC for virNWFilterBindingDef

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/virnwfilterbindingdef.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/virnwfilterbindingdef.h b/src/conf/virnwfilterbindingdef.h index 0e52789332..68d531b75d 100644 --- a/src/conf/virnwfilterbindingdef.h +++ b/src/conf

[libvirt PATCH 02/10] virNWFilterBindingDefCopy: `virHashNew` cannot return NULL

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/virnwfilterbindingdef.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conf/virnwfilterbindingdef.c b/src/conf/virnwfilterbindingdef.c index 98df1f750a..9704e1bebb 100644 --- a/src/conf/virnwfilterbindingdef.c +++ b/src/conf

[libvirt PATCH 00/10] virHashNew refactorings - part IV

2021-07-13 Thread Tim Wiederhake
"virHashNew" cannot return NULL, yet we check for NULL in various places. See https://listman.redhat.com/archives/libvir-list/2021-July/msg00074.html. Tim Wiederhake (10): conf: Add AUTOPTR_CLEANUP_FUNC for virNWFilterBindingDef virNWFilterBindingDefCopy: `virHashNew` cannot r

[libvirt PATCH 06/10] virNWFilterBindingDefForNet: Use automatic memory management

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/domain_nwfilter.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_nwfilter.c b/src/conf/domain_nwfilter.c index 5024d5fa03..cb35221a59 100644 --- a/src/conf/domain_nwfilter.c +++ b/src/conf/domain_nwfilter.c

[libvirt PATCH 03/10] virNWFilterBindingDefCopy: Use automatic memory management

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/virnwfilterbindingdef.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/conf/virnwfilterbindingdef.c b/src/conf/virnwfilterbindingdef.c index 9704e1bebb..4ed3763efd 100644 --- a/src/conf/virnwfilterbindingdef.c +++ b/src

[libvirt PATCH 09/10] virNWFilterBuildAll: `virHashNew` cannot return NULL

2021-07-13 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/nwfilter/nwfilter_gentech_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index 8aa1db23d3..da4f71daf1 100644 --- a/src/nwfilter

[libvirt PATCH v2 1/1] virThreadPoolNewFull: Prevent expanding worker pool by zero

2021-07-13 Thread Tim Wiederhake
izing enabled: $ meson -Dbuildtype=debug -Db_lundef=false -Db_sanitize=address,undefined build && ninja -C build $ ./build/run build/src/libvirtd src/util/viralloc.c:82:5: runtime error: null pointer passed as argument 1, which is declared to never be null Signed-off-by: Tim

[libvirt PATCH v2 0/1] Prevent expanding worker pool by zero

2021-07-13 Thread Tim Wiederhake
V1: https://listman.redhat.com/archives/libvir-list/2021-July/msg00217.html Changes since V1: * Fix this not in virThreadPoolExpand, but in virThreadPoolNewFull. * Expanded the commit message. Tim Wiederhake (1): virThreadPoolNewFull: Prevent expanding worker pool by zero src/util

Re: [libvirt PATCH v2 10/11] qemuMonitorGetChardevInfo: Use automatic memory management

2021-07-13 Thread Tim Wiederhake
On Tue, 2021-07-13 at 09:36 +0200, Michal Prívozník wrote: > On 7/6/21 2:37 PM, Tim Wiederhake wrote: > > Signed-off-by: Tim Wiederhake > > --- > >  src/qemu/qemu_monitor.c | 16 ++-- > >  1 file changed, 6 insertions(+), 10 deletions(-) > > > >

Re: [libvirt PATCH 3/3] virNWFilterParseParamAttributes: Simplify loop

2021-08-03 Thread Tim Wiederhake
ping On Fri, 2021-07-23 at 11:56 +0200, Tim Wiederhake wrote: > Signed-off-by: Tim Wiederhake > --- >  src/conf/nwfilter_params.c | 7 ++- >  1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c

[libvirt PATCH 5/7] Meson: Define "DYNAMIC_ANALYSIS" if built with sanitizers enabled

2021-08-05 Thread Tim Wiederhake
in gcc (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60512) gcc, depending on the version, defines "__SANITIZE_ADDRESS__ 1" if compiled with the address sanitizer enabled. No similar macro is defined for the undefined behavior sanitizer. Instead, let meson set this symbol. Signed-of

[libvirt PATCH 7/7] virMutex*: Fail loudly

2021-08-05 Thread Tim Wiederhake
issues. Signed-off-by: Tim Wiederhake --- src/util/virthread.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/util/virthread.c b/src/util/virthread.c index f64dbee9e9..95213bd511 100644 --- a/src/util/virthread.c +++ b/src/util/virthread.c @@ -88,6 +88,9 @@ void virMute

[libvirt PATCH 4/7] qemuhotplugtest: Lock reused virDomainObj

2021-08-05 Thread Tim Wiederhake
If the previous test had `keep == 1` set, this function inherits its (unlocked) virDomainObj. Signed-off-by: Tim Wiederhake --- tests/qemuhotplugtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 57d76845c6..d8d6a3a226 100644

Re: [libvirt PATCH 6/7] virMutex*: Warn on error

2021-08-05 Thread Tim Wiederhake
On Thu, 2021-08-05 at 14:24 +0100, Daniel P. Berrangé wrote: > On Thu, Aug 05, 2021 at 03:08:50PM +0200, Tim Wiederhake wrote: > > `pthread_mutex_destroy`, `pthread_mutex_lock` and > > `pthread_mutex_unlock` > > return an error code that is currently ignored. > > >

[libvirt PATCH 0/3] Invalidate the cpu flags cache on changes of kernel command line

2021-08-05 Thread Tim Wiederhake
bug.cgi?id=1953389. Tim Wiederhake (3): virQEMUCaps: Add kernel command line virQEMUCapsCachePriv: Add kernel command line qemu: Invalidate capabilities cache on kernel command line mismatch src/qemu/qemu_capabilities.c | 34 -- src/qemu/qemu_capspriv.h | 3

[libvirt PATCH 2/3] virQEMUCapsCachePriv: Add kernel command line

2021-08-05 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 21b7e8050b..c2a885351f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4096,6

[libvirt PATCH 1/3] virQEMUCaps: Add kernel command line

2021-08-05 Thread Tim Wiederhake
The kernel command line can contain settings affecting the availability of cpu flags. Add the kernel command line to the capabilities cache. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/qemu

[libvirt PATCH 6/7] virMutex*: Warn on error

2021-08-05 Thread Tim Wiederhake
`pthread_mutex_destroy`, `pthread_mutex_lock` and `pthread_mutex_unlock` return an error code that is currently ignored. Add debug information if one of these operations failed, e.g. when there is an attempt to destroy a still locked mutex or unlock and already unlocked mutex. Signed-off-by: Tim

[libvirt PATCH 1/7] tests: qemuMonitorTestFree: Unlock virDomainObj before freeing

2021-08-05 Thread Tim Wiederhake
virDomainObj contains a mutex. Destroying a locked mutex results in undefined behavior. Signed-off-by: Tim Wiederhake --- tests/qemumonitortestutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 143dd954e6

[libvirt PATCH 2/7] qemusecuritytest: Unlock virDomainObj before disposal

2021-08-05 Thread Tim Wiederhake
virDomainObj contains a mutex. Destroying a locked mutex results in undefined behavior. Signed-off-by: Tim Wiederhake --- tests/qemusecuritytest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c index a7e87fdf8f

[libvirt PATCH 3/7] qemuxml2argvtest: Unlock virDomainObj before disposal

2021-08-05 Thread Tim Wiederhake
virDomainObj contains a mutex. Destroying a locked mutex results in undefined behavior. Signed-off-by: Tim Wiederhake --- tests/qemuxml2argvtest.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index

[libvirt PATCH 0/7] Fix some mutex related issues

2021-08-05 Thread Tim Wiederhake
es of this type are introduced. Patches 1, 2, 3, and 4 fix the issues, patches 5, 6, and 7 add the checks. See https://gitlab.com/twiederh/libvirt/-/pipelines/348505233 and https://gitlab.com/twiederh/libvirt/-/pipelines/348505233 (only patches 5, 6, and 7). Regards, Tim Tim Wiederhake (7): test

[libvirt PATCH 3/3] qemu: Invalidate capabilities cache on kernel command line mismatch

2021-08-05 Thread Tim Wiederhake
See https://bugzilla.redhat.com/show_bug.cgi?id=1953389. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 17 ++--- src/qemu/qemu_capspriv.h | 3 ++- tests/qemucapsprobe.c| 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/qemu

Re: [libvirt PATCH] meson: Increase stack size limit for sanitizer builds

2021-09-23 Thread Tim Wiederhake
On Thu, 2021-09-23 at 11:23 +0200, Tim Wiederhake wrote: > When building with "CC=clang", "-Db_sanitize=address,undefined", and > "-Dbuildtype=debug", the following error occurs: > >     ../src/conf/nwfilter_conf.c:2190:1: error: stack fra

[libvirt PATCH] meson: Increase stack size limit for sanitizer builds

2021-09-23 Thread Tim Wiederhake
=] virNWFilterRuleDefFixup(virNWFilterRuleDef *rule) ^ 1 error generated. Enforcing stack frame only makes sense on normal builds when stack usage is deterministic. Signed-off-by: Tim Wiederhake --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m

[libvirt PATCH 1/5] cpu_arm: No need to protect macro definitions

2021-10-11 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_arm.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index 09ade1d422..ac174891b7 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -39,12 +39,11 @@ #include "vir

[libvirt PATCH 0/5] Add virCPUDataIsIdentical

2021-10-11 Thread Tim Wiederhake
://bugzilla.redhat.com/show_bug.cgi?id=1953389 Tim Wiederhake (5): cpu_arm: No need to protect macro definitions cpu: Add virCPUDataIsIdentical cpu_x86: Implement virCPUDataIsIdentical for x86 cpu_arm: Implement virCPUDataIsIdentical for arm cpu_ppc64: Implement virCPUDataIsIdentical for ppc64 src/cpu

[libvirt PATCH 3/5] cpu_x86: Implement virCPUDataIsIdentical for x86

2021-10-11 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 69 +++ 1 file changed, 69 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 1b829e5658..55da407ec4 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -3369,6 +3369,74

[libvirt PATCH 2/5] cpu: Add virCPUDataIsIdentical

2021-10-11 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c| 29 + src/cpu/cpu.h| 9 + src/libvirt_private.syms | 1 + 3 files changed, 39 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index b4965f3ee0..a3531dd665 100644 --- a/src/cpu

[libvirt PATCH 5/5] cpu_ppc64: Implement virCPUDataIsIdentical for ppc64

2021-10-11 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_ppc64.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 4909f61ff1..fcd68c8a7c 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -578,6 +578,31

[libvirt PATCH 4/5] cpu_arm: Implement virCPUDataIsIdentical for arm

2021-10-11 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_arm.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index ac174891b7..c9114d53bf 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -124,6 +124,32 @@ virCPUarmDataClear

[libvirt PATCH v3 9/9] lxcDomainDetachDeviceHostdevUSBLive: Use VIR_WITH_OBJECT_LOCK_GUARD

2021-09-30 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/lxc/lxc_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index e2720a6f89..528af5d164 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -4079,9 +4079,9

[libvirt PATCH v3 3/9] virthread: Introduce VIR_WITH_MUTEX_LOCK_GUARD

2021-09-30 Thread Tim Wiederhake
Modeled after "WITH_QEMU_LOCK_GUARD" (see qemu's include/qemu/lockable.h). Uses "__LINE__" instead of "__COUNTER__", as the latter is a GNU extension. See comment for typical usage. Signed-off-by: Tim Wiederhake --- src/util/virthread.h | 20

[libvirt PATCH v3 5/9] virobject: Introduce VIR_WITH_OBJECT_LOCK_GUARD

2021-09-30 Thread Tim Wiederhake
Modeled after "WITH_QEMU_LOCK_GUARD" (see qemu's include/qemu/lockable.h). Uses "__LINE__" instead of "__COUNTER__", as the latter is a GNU extension. See comment for typical usage. Signed-off-by: Tim Wiederhake --- src/util/virobject.h | 20

[libvirt PATCH v3 1/9] internal: Add CONCAT macro

2021-09-30 Thread Tim Wiederhake
Using the two-step idiom to force resolution of other macros, e.g.: #define bar BAR CONCAT_(foo, bar) // foobar CONCAT(foo, bar) // fooBAR Signed-off-by: Tim Wiederhake --- src/internal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/internal.h b/src/internal.h

[libvirt PATCH v3 8/9] bhyveAutostartDomain: Use virObjectLockGuard

2021-09-30 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/bhyve/bhyve_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 516490f6cd..c41de30be9 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -87,7 +87,8

[libvirt PATCH v3 0/9] Automatic mutex management

2021-09-30 Thread Tim Wiederhake
g_auto* / clang unused variable warnings (See https://bugs.llvm.org/show_bug.cgi?id=3888, https://bugs.llvm.org/show_bug.cgi?id=43482, and https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2272). Instead, introduce VIR_LOCK_GUARD macro that adds G_GNUC_UNUSED. Regards, Tim Tim

[libvirt PATCH v3 2/9] virthread: Introduce virLockGuard

2021-09-30 Thread Tim Wiederhake
d function(virMutex *m) { VIR_LOCK_GUARD lock = virLockGuardNew(m); /* `m` is locked, and released automatically on scope exit */ ... while (expression) { VIR_LOCK_GUARD lock2 = virLockGuardNew(...); /* similar */ } } Signed-o

[libvirt PATCH v3 4/9] virobject: Introduce virObjectLockGuard

2021-09-30 Thread Tim Wiederhake
Typical usage: void foobar(virObjectLockable *obj) { VIR_LOCK_GUARD lock = virObjectLockGuard(obj); /* `obj` is locked, and released automatically on scope exit */ ... } Signed-off-by: Tim Wiederhake --- src/libvirt_private.syms | 1 + src/util/virobject.c

[libvirt PATCH v3 7/9] virChrdevFree: Use VIR_WITH_MUTEX_LOCK

2021-09-30 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/virchrdev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 0184a1ae10..1cf727d46e 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -291,10 +291,10 @@ void

[libvirt PATCH v3 6/9] virChrdevFDStreamCloseCb: Use virLockGuardNew

2021-09-30 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/virchrdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 5d6de68427..0184a1ae10 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -237,12 +237,10 @@ static void

[libvirt PATCH] [RFC] scripts: Check spelling

2021-10-01 Thread Tim Wiederhake
: 4ad3c95f4bef5c7c9657de470fb74a4d14c8a331, 785a11cec8693de7df024aae68975dd1799b646a, 1452317b5c727eb17178942012f57f0c37631ae4. Signed-off-by: Tim Wiederhake --- scripts/check-spelling.py | 115 ++ 1 file changed, 115 insertions(+) create mode 100755 scripts/check-spelling.py diff --git

[libvirt PATCH 2/2] virNWFilterRuleDefFixup: Replace macro with function

2021-09-20 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/nwfilter_conf.c | 284 --- 1 file changed, 143 insertions(+), 141 deletions(-) diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index a3109962af..4c4e31d5cd 100644 --- a/src/conf/nwfilter_conf.c +++ b

[libvirt PATCH 0/2] Random improvements to work around a build system issue

2021-09-20 Thread Tim Wiederhake
or,-Wframe-larger-than=] virDomainDefParseXML(xmlXPathContextPtr ctxt, ^ 1 error generated. Note that this does not happen when "-Dbuildtype" is not specified, even though "debug" is the default build type. The patches in this series happen to make these erro

[libvirt PATCH 1/2] virDomainDefParseXML: Use automatic memory management

2021-09-20 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/domain_conf.c | 208 - 1 file changed, 102 insertions(+), 106 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6c32609431..cdbc66d9fc 100644 --- a/src/conf/domain_conf.c +++ b/src

[libvirt PATCH] vshCmddefCheckInternals: Fix typo

2021-09-27 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- tools/vsh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/vsh.c b/tools/vsh.c index 189c452f73..7b77acad34 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -279,7 +279,7 @@ vshCmddefCheckInternals(vshControl *ctl

[libvirt PATCH v2] qemu: Fix typo in comment

2021-12-20 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index a3d6eca569..8870b5f8ee 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c

Re: [PATCH 0/6] json helper cleanups

2021-12-22 Thread Tim Wiederhake
.c    |  10 +- >  src/util/virjson.c   |  57 +-- >  src/util/virjson.h   | 315 +++-- > -- >  src/util/virmacmap.c |   4 +- >  tests/virjsontest.c  |   4 +- >  7 files changed, 231 insertions(+), 166 deletions(-) > Reviewed-by: Tim Wiederhake

Re: [PATCH 0/7] Misc g_auto() rewrites

2021-11-11 Thread Tim Wiederhake
On Tue, 2021-11-09 at 16:24 +0100, Michal Prívozník wrote: > On 11/9/21 3:16 PM, Tim Wiederhake wrote: > > On Mon, 2021-11-01 at 15:16 +0100, Michal Privoznik wrote: > > > I've been looking at our tests lately and noticed an opportunity > > > to > > > rewr

[libvirt PATCH 00/10] Enable hyperv-passthrough

2021-11-26 Thread Tim Wiederhake
This series enables "hv-passthrough" in libvirt. See https://bugzilla.redhat.com/show_bug.cgi?id=1851249. Example usage in VM definition: Tim Wiederhake (10): schema: Wrap hyperv element in choice and group schema: Add optional "mode" attribute to hyperv

[libvirt PATCH 03/10] conf: domain: Define enum for HyperV mode

2021-11-26 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/domain_conf.c | 6 ++ src/conf/domain_conf.h | 7 +++ 2 files changed, 13 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f88405ab02..74d86a346a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c

[libvirt PATCH 01/10] schema: Wrap hyperv element in choice and group

2021-11-26 Thread Tim Wiederhake
This does not change the schema, but will make upcoming changes easier. Signed-off-by: Tim Wiederhake --- docs/schemas/domaincommon.rng | 164 +- 1 file changed, 84 insertions(+), 80 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas

[libvirt PATCH 06/10] docs: domain: Add documentation for "hyperv"'s new "mode" attribute

2021-11-26 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- docs/formatdomain.rst | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index eb8c973cf1..95ef2e0d05 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1820,7 +1820,7

[libvirt PATCH 07/10] conf: domain: Add hyperv passthrough mode

2021-11-26 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 16 3 files changed, 18 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7d1edf14c3..6c1d8e6353 100644 --- a/src/conf

[libvirt PATCH 09/10] tests: Add tests for hyperv-passthrough

2021-11-26 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- .../hyperv-passthrough.x86_64-6.1.0.args | 32 +++ .../hyperv-passthrough.x86_64-latest.args | 32 +++ tests/qemuxml2argvdata/hyperv-passthrough.xml | 27 tests/qemuxml2argvtest.c

[libvirt PATCH 08/10] schema: hyperv: Add mode "passthrough"

2021-11-26 Thread Tim Wiederhake
This mode will enable all enlightenments known to the hypervisor. See https://bugzilla.redhat.com/show_bug.cgi?id=1851249 Example: ... Signed-off-by: Tim Wiederhake --- docs/schemas/domaincommon.rng | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/schemas

[libvirt PATCH 04/10] virDomainFeaturesHyperVDefParse: Read attribute "mode" of element "hyperv"

2021-11-26 Thread Tim Wiederhake
Currently, this attribute may either have a value of "custom", or be absent (which defaults to "custom"), for backwards compatibility. Signed-off-by: Tim Wiederhake --- src/conf/domain_conf.c | 11 +-- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_validate.c | 2

[libvirt PATCH 02/10] schema: Add optional "mode" attribute to hyperv

2021-11-26 Thread Tim Wiederhake
Allow for an optional attribute "mode", set to the string "custom". Later patches will introduce different modes. Omitting this attribute will default to "custom" for backwards compatibility. Signed-off-by: Tim Wiederhake --- docs/schemas/domaincommon.rn

[libvirt PATCH 05/10] virDomainDefFormatFeatures: Write attribute "mode" of element "hyperv"

2021-11-26 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/conf/domain_conf.c| 5 +++-- tests/qemuxml2xmloutdata/hyperv-off.xml | 2 +- tests/qemuxml2xmloutdata/hyperv-stimer-direct.xml | 2 +- tests/qemuxml2xmloutdata/hyperv.xml | 2 +- 4 files changed, 6

[libvirt PATCH 10/10] docs: domain: Add documentation for hyperv passthrough mode

2021-11-26 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- docs/formatdomain.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 95ef2e0d05..ec944f89db 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1924,6 +1924,9 @@ are: ``custom

Re: [PATCH 04/12] virSecurityLabelDefParseXML: Don't reuse temporary string 'p'

2021-11-22 Thread Tim Wiederhake
On Mon, 2021-11-22 at 18:12 +0100, Peter Krempa wrote: > (...) > diff --git a/src/util/virseclabel.h b/src/util/virseclabel.h > index eca4d09d24..7e62f8a2e2 100644 > --- a/src/util/virseclabel.h > +++ b/src/util/virseclabel.h > @@ -43,6 +43,7 @@ struct _virSecurityLabelDef { >  }; > > > + >  /*

Re: [PATCH 08/12] virSecurityLabelDefParseXML: Don't use 'virXPathStringLimit'

2021-11-22 Thread Tim Wiederhake
On Mon, 2021-11-22 at 18:12 +0100, Peter Krempa wrote: > virXPathStringLimit doesn't give callers a way to differentiate > between > the queried XPath being empty and the length limit being exceeded. > > This means that callers are either overwriting the error message or > ignoring it altogether.

Re: [PATCH 09/12] virSecurityDeviceLabelDefParseXML: Use automatic memory clearing for temp strings

2021-11-22 Thread Tim Wiederhake
On Mon, 2021-11-22 at 18:12 +0100, Peter Krempa wrote: > Apart from code simplification the refactor of 'model' fixes an > unlikely > memory leak of the string if a duplicate model is found. > > While the coversion of 'label' variable may seem unnecessary it will > come in handy in the next

[virttools-planet PATCH] Fix format in config.ini

2021-11-02 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- virt-tools/config.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virt-tools/config.ini b/virt-tools/config.ini index f56495a..f2ae9a4 100644 --- a/virt-tools/config.ini +++ b/virt-tools/config.ini @@ -75,8 +75,8 @@ encoding = utf-8

Re: [PATCH] lib: Introduce and use g_autoptr() for virInterfaceDef

2021-11-02 Thread Tim Wiederhake
*dev; > -    virInterfaceDef *def = NULL; > +    g_autoptr(virInterfaceDef) def = NULL; > virInterfacePtr ret = NULL; >   > enumerate = udevGetDevices(udev, VIR_UDEV_IFACE_ALL); > @@ -499,7 +494,6 @@ udevInterfaceLookupByMACString(virConnectPtr > conn, const char

Re: [virttools-planet PATCH] Fix format in config.ini

2021-11-02 Thread Tim Wiederhake
On Tue, 2021-11-02 at 12:23 +0100, Tim Wiederhake wrote: > Signed-off-by: Tim Wiederhake > --- >  virt-tools/config.ini | 4 ++-- >  1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/virt-tools/config.ini b/virt-tools/config.ini > index f56495a..f2ae9a4 1006

[libvirt PATCH 0/1] Fix some typos

2021-10-26 Thread Tim Wiederhake
Found by "codespell", see proposed script at https://listman.redhat.com/archives/libvir-list/2021-October/msg00015.html Cheers, Tim Tim Wiederhake (1): Fix some typos NEWS.rst| 2 +- src/conf/domain_conf.c | 2 +- src/qemu/qemu_command.c | 4 ++-- 3 files

[libvirt PATCH 1/1] Fix some typos

2021-10-26 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- NEWS.rst| 2 +- src/conf/domain_conf.c | 2 +- src/qemu/qemu_command.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 5a7570d0db..5f1cf19940 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -64,7 +64,7

Re: [PATCH 00/13] qemu_monitor_json: Use g_auto* more

2021-10-25 Thread Tim Wiederhake
>   qemu_monitor_json: Drop pointless error labels > >  src/qemu/qemu_monitor.c  |    2 +- >  src/qemu/qemu_monitor.h  |    3 +- >  src/qemu/qemu_monitor_json.c | 1803 > -- >  3 files changed, 641 insertions(+), 1167 deletions(-) > > 1167 deletions Thanks! Reviewed-by: Tim Wiederhake Tim

Re: [PATCH] ci: regenerate container from manifest

2021-10-25 Thread Tim Wiederhake
   libnuma-dev \ libnetcf-dev has also been removed from Debian Testing (Bookworm / 11-to-be). Reviewed-by: Tim Wiederhake

Re: [PATCH 0/7] Misc g_auto() rewrites

2021-11-09 Thread Tim Wiederhake
On Mon, 2021-11-01 at 15:16 +0100, Michal Privoznik wrote: > I've been looking at our tests lately and noticed an opportunity to > rewrite pieces of code to g_auto() magic. > > Michal Prívozník (7): >   qemuagenttest: Don't leak virTypedParameter on failure >   Prefer g_auto(GStrv) over

Re: [libvirt PATCH v2 01/20] cpu_x86: Simplify x86ParseCPUID

2021-11-05 Thread Tim Wiederhake
On Fri, 2021-11-05 at 16:30 +0100, Michal Prívozník wrote: > On 11/4/21 5:27 PM, Tim Wiederhake wrote: > > ... by using virXMLProp*() helpers. These only require a xmlNodePtr > > and > > do not need a xmlXPathContextPtr. Reflect that in the function > > signature.

Re: [libvirt PATCH v2 07/20] cpu_x86: Implement virCPUDataIsIdentical for x86

2021-11-05 Thread Tim Wiederhake
On Fri, 2021-11-05 at 16:30 +0100, Michal Prívozník wrote: > On 11/4/21 5:27 PM, Tim Wiederhake wrote: > > Signed-off-by: Tim Wiederhake > > --- > >  src/cpu/cpu_x86.c | 69 > > +++ > >  1 file changed, 69 insertions

[libvirt PATCH v2 03/20] cpu_x86: Add x86ParseDataItemList

2021-11-04 Thread Tim Wiederhake
Factor out duplicated code from x86FeatureParse and virCPUx86DataParse. This also consolidates error messages. Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 106 ++ 1 file changed, 41 insertions(+), 65 deletions(-) diff --git a/src/cpu

[libvirt PATCH v2 10/20] cpu_ppc64: Implement virCPUDataIsIdentical for ppc64

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_ppc64.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 4909f61ff1..fcd68c8a7c 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -578,6 +578,31

[libvirt PATCH v2 18/20] virQEMUCaps: Add host cpuid information

2021-11-04 Thread Tim Wiederhake
Many things can affect the availability of cpu flags (e.g. software upgrades, kernel versions, kernel command line, etc.) and invalidate the cached capabilities without notice. Add CPUID information to the capabilities cache. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 16

[libvirt PATCH v2 20/20] qemu: Invalidate capabilities cache on host cpuid mismatch

2021-11-04 Thread Tim Wiederhake
See https://bugzilla.redhat.com/show_bug.cgi?id=1953389. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 15 --- src/qemu/qemu_capspriv.h | 3 ++- tests/qemucapsprobe.c| 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/qemu

[libvirt PATCH v2 16/20] cpu_x86: Add virCPUDataGetHost

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c| 19 +++ src/cpu/cpu.h| 7 +++ src/libvirt_private.syms | 1 + 3 files changed, 27 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index b5669246b4..285c7eee44 100644 --- a/src/cpu/cpu.c +++ b

[libvirt PATCH v2 14/20] cpu_ppc64: Implement virCPUDataNewCopy for ppc64

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_ppc64.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index fcd68c8a7c..c7caaa9608 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -603,6 +603,23

[libvirt PATCH v2 19/20] virQEMUCapsCachePriv: Add host cpuid information

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- 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 b2d5242264..5fa3111201 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4023,6

[libvirt PATCH v2 12/20] cpu_x86: Implement virCPUDataNewCopy for x86

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 5ce193e693..0dc9a7d9fb 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -481,6 +481,23 @@ virCPUx86DataClear

[libvirt PATCH v2 01/20] cpu_x86: Simplify x86ParseCPUID

2021-11-04 Thread Tim Wiederhake
... by using virXMLProp*() helpers. These only require a xmlNodePtr and do not need a xmlXPathContextPtr. Reflect that in the function signature. Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 43 +-- 1 file changed, 17 insertions(+), 26 deletions

[libvirt PATCH v2 13/20] cpu_arm: Implement virCPUDataNewCopy for arm

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_arm.c | 20 1 file changed, 20 insertions(+) diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index c9114d53bf..51a3c1f3ee 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -150,6 +150,25 @@ virCPUarmDataIsIdentical

[libvirt PATCH v2 17/20] cpu_x86: Implement virCPUDataGetHost for x86

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 40 1 file changed, 40 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 0dc9a7d9fb..a72eae07dd 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -20,6 +20,9

[libvirt PATCH v2 05/20] cpu: Split up virCPUDataParse

2021-11-04 Thread Tim Wiederhake
This makes it possible to call virCPUDataParse with a xmlNodePtr, which will be required by a later patch. Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c| 29 + src/cpu/cpu.h| 2 ++ src/libvirt_private.syms | 1 + 3 files changed, 24

[libvirt PATCH v2 06/20] cpu: Add virCPUDataIsIdentical

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu.c| 28 src/cpu/cpu.h| 9 + src/libvirt_private.syms | 1 + 3 files changed, 38 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index b97d06c7d8..0c1c7902f0 100644 --- a/src/cpu

[libvirt PATCH v2 07/20] cpu_x86: Implement virCPUDataIsIdentical for x86

2021-11-04 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/cpu/cpu_x86.c | 69 +++ 1 file changed, 69 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index a08ac225ef..5ce193e693 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -3332,6 +3332,74

<    5   6   7   8   9   10   11   12   13   14   >