[PATCH] virt-host-validate: Detect SMMU support on ARMs

2023-03-22 Thread Michal Privoznik
ping Table (IORT) which describes SMMU capabilities on given host and is exposed in sysfs (regardless of arm_smmu module). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2178885 Signed-off-by: Michal Privoznik --- tools/virt-host-validate-common.c | 9 + 1 file changed, 9 insertion

[PATCH] qemu_domain: Drop ATTRIBUTE_NONNULL() for non-existent arguments

2023-03-22 Thread Michal Privoznik
accept just one argument (@obj). Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index c716e64ccc..eaa75de3e5 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu

[PATCH] qemu_shim: Require absolute path for root directory

2023-03-22 Thread Michal Privoznik
ls: cannot access 'asd': No such file or directory $ virt-qemu-run -r asd whatever.xml virt-qemu-run: cannot open qemu:///embed?root=asd: unsupported configuration: root path must be absolute $ ls -d asd asd Signed-off-by: Michal Privoznik --- src/qemu/qemu_shim.c | 16

[PATCH] meson: Don't build tests when CLang lacks -fsemantic-interposition

2023-03-21 Thread Michal Privoznik
There are some CLang versions that do not support -fsemantic-interposition. If that's the case, the code is optimized so much that our mocking no longer works. Therefore, disable tests and produce a warning. Signed-off-by: Michal Privoznik --- Technically, this is a v2 of:

[PATCH] meson: Disable optimizations if CLang doesn't support -fsemantic-interposition

2023-03-21 Thread Michal Privoznik
1 and macOS 12 are dropped. Signed-off-by: Michal Privoznik --- This still doesn't work when somebody overrides CFLAGS as those are placed AFTER our supported_cc_flags: $ export CFLAGS="-O2 -ggdb" $ meson setup _build $ ninja -v -C _build/ [1/1202] clang ... -O2 -g ... -O0 -O2 -ggdb

[PATCH v2] meson: Stop detecting -Wl,--version-script=

2023-03-21 Thread Michal Privoznik
ng compile time rather than configure time. 1: https://reviews.llvm.org/D135402 2: https://github.com/mesonbuild/meson/issues/3047 Resolves: https://bugs.gentoo.org/902211 Signed-off-by: Michal Privoznik --- v2 of: https://listman.redhat.com/archives/libvir-list/2023-March/238923.html diff to v

[PATCH] meson: Work around too strict lld

2023-03-20 Thread Michal Privoznik
com/mesonbuild/meson/issues/3047 Resolves: https://bugs.gentoo.org/902211 Signed-off-by: Michal Privoznik --- Compile Libvirt? Absolutely Not Gonna. The choice of defaults for LLVM and related subprojects continues to surprise me. meson.build | 6 +- 1 file changed, 5 insertions(+), 1 delet

[PATCH 2/2] virnuma: Annotate some functions as VIR_OPTNONE

2023-03-15 Thread Michal Privoznik
tter what clang ignores optnone request). Signed-off-by: Michal Privoznik --- src/util/virnuma.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 4a15bf32c8..156b2e7bca 100644 --- a/src/util/virnuma.c

[PATCH 1/2] internal.h: Invent VIR_OPTNONE

2023-03-15 Thread Michal Privoznik
zation for non-static functions and thus VIR_OPTNONE can be empty for them. Signed-off-by: Michal Privoznik --- src/internal.h | 20 1 file changed, 20 insertions(+) diff --git a/src/internal.h b/src/internal.h index 9dc34a0bf5..cf6f314648 100644 --- a/src/internal.h +++ b/

[PATCH 0/2] Work around broken clang. Again.

2023-03-15 Thread Michal Privoznik
We ran into so many clang bugs recently, that I'm strongly in favor of making it optional and aim on gcc only. Debugging these issues burns our time needlessly. Just consider what's happening here. I've pushed patches recently that call some virNuma*() APIs during QEMU cmd line generation. And whi

[PATCH v2 04/15] qemuxml2argvtest: Use virnuma mock

2023-03-14 Thread Michal Privoznik
have to start building virnumamock unconditionally. But this is not a problem, since nothing inside of the mock relies on Linux specificity. The whole mock is merely just reading files and parsing them. Signed-off-by: Michal Privoznik --- tests/meson.build| 2 +- tests/qemuxml2argvtest.c

[PATCH v2 15/15] NEWS: Document recent thread-context bug fix

2023-03-14 Thread Michal Privoznik
Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index e5b304786b..5b5265996f 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -48,6 +48,13 @@ v9.2.0 (unreleased) Due to a logic bug introduced

[PATCH v2 00/15] qemuBuildThreadContextProps: Prune .node-afinity wrt

2023-03-14 Thread Michal Privoznik
v2 of: https://listman.redhat.com/archives/libvir-list/2023-March/238536.html diff to v1: - Swapped arguments in virNumaCPUSetToNodeset() - Other small nits - typos Michal Prívozník (15): virnuma: Move virNumaNodesetToCPUset() our of WITH_NUMACTL virnuma: Introduce virNumaCPUSetToNodeset()

[PATCH v2 07/15] qemuxml2argvmock: Drop virNuma* mocks

2023-03-14 Thread Michal Privoznik
igned-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova Reviewed-by: Andrea Bolognani --- src/util/virnuma.h| 2 +- ...-unavailable-restrictive.x86_64-latest.err | 2 +- ...mnode-unavailable-strict.x86_64-latest.err | 2 +- ...umatune-static-nodeset-e

[PATCH v2 09/15] qemu: Fix qemuDomainGetEmulatorPinInfo()

2023-03-14 Thread Michal Privoznik
call that and avoid this type of error. Fixes: 776924e37649f2d47acd805746d5fd9325212ea5 Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_driver.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu

[PATCH v2 13/15] qemuBuildThreadContextProps: Prune .node-affinity wrt

2023-03-14 Thread Michal Privoznik
g the allocation. Therefore, we should honor the pinning and prune the list of node so that inaccessible ones are dropped. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2154750 Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_command.c

[PATCH v2 11/15] qemu: Add @nodemaskRet argument to qemuBuildMemoryBackendProps()

2023-03-14 Thread Michal Privoznik
the JSON array. Instead, introduce an argument to qemuBuildMemoryBackendProps() which is set to corresponding value used when formatting the attribute. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/qemu/qemu_command.c | 14 ++ src/qemu/qemu_command.h | 4

[PATCH v2 12/15] qemu: Add @nodemask argument to qemuBuildThreadContextProps()

2023-03-14 Thread Michal Privoznik
. That's the point where having the value in virBitmap comes handy. Utilize the previous commit, which made qemuBuildMemoryBackendProps() set the argument and pass it into qemuBuildThreadContextProps(). Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_command.c

[PATCH v2 05/15] qemuxml2argvdata: Adjust maximum NUMA node used

2023-03-14 Thread Michal Privoznik
. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvdata/migrate-numa-unaligned.args | 4 ++-- tests/qemuxml2argvdata/migrate-numa-unaligned.xml| 4 ++-- tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml | 4 ++-- tests

[PATCH v2 14/15] docs: Document memory allocation and emulator pinning limitation

2023-03-14 Thread Michal Privoznik
Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- docs/formatdomain.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 4f4874eba2..27f83e254d 100644 --- a/docs/formatdomain.rst +++ b/docs

[PATCH v2 10/15] qemuBuildMemoryBackendProps: Join two conditions

2023-03-14 Thread Michal Privoznik
There are two compound conditions in qemuBuildMemoryBackendProps() and each one checks for nodemask for NULL first. Join them into one bigger block. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/qemu/qemu_command.c | 26 ++ 1 file changed, 14

[PATCH v2 06/15] qemuxml2argvdata: Extend vCPUs placement in memory-hotplug-dimm-addr.xml

2023-03-14 Thread Michal Privoznik
configuration, as-is currently, would make QEMU error out anyway. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvdata/memory-hotplug-dimm-addr.xml | 2 +- .../memory-hotplug-dimm-addr.x86_64-latest.xml | 2 +- 2 files changed, 2

[PATCH v2 08/15] qemu: Move cpuset preference evaluation into a separate function

2023-03-14 Thread Michal Privoznik
set for VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 18 ++ src/qemu/qemu_domain.h | 5 + src/qemu/qemu_process.c | 9 ++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --gi

[PATCH v2 01/15] virnuma: Move virNumaNodesetToCPUset() our of WITH_NUMACTL

2023-03-14 Thread Michal Privoznik
urned from virNumaGetNodeCPUs() (including the one that !WITH_NUMACTL stub returns) is propagated properly. Move the function out of the block into a generic one and drop the !WITH_NUMACTL stub. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/util/virnu

[PATCH v2 03/15] virnumamock: Introduce virNumaGetNodeOfCPU() mock

2023-03-14 Thread Michal Privoznik
Introduce a mock of virNumaGetNodeOfCPU() because soon we will need virNumaCPUSetToNodeset() to return predictable results. Also, fill in missing symlinks in vircaps2xmldata/. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova Reviewed-by: Andrea Bolognani --- src/util/virnuma.h

[PATCH v2 02/15] virnuma: Introduce virNumaCPUSetToNodeset()

2023-03-14 Thread Michal Privoznik
So far, we have a function that expands given list of NUMA nodes into list of CPUs. But soon, we are going to need the inverse - expand list of CPUs into list of NUMA nodes. Introduce virNumaCPUSetToNodeset() for that. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src

[PATCH] qemu_alias: Fix backcompat console alias generation

2023-03-14 Thread Michal Privoznik
rsed, then everything works suddenly. This is because in the status XML both devices have the same alias. Let's generate correct alias from the beginning. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2156300 Signed-off-by: Michal Privoznik --- src/qemu/qemu_alias.c | 12

[PATCH] Use G_N_ELEMENTS() more

2023-03-13 Thread Michal Privoznik
In a few places we still use the good old: sizeof(var) / sizeof(var[0]) sizeof(var) / sizeof(int) The G_N_ELEMENTS() macro is preferred though. In a few places we don't link with glib, so provide the macro definition. Signed-off-by: Michal Privoznik --- examples/c/misc/openauth.

[PATCH 09/14] qemu: Fix qemuDomainGetEmulatorPinInfo()

2023-03-08 Thread Michal Privoznik
call that and avoid this type of error. Fixes: 776924e37649f2d47acd805746d5fd9325212ea5 Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c546e35953

[PATCH 07/14] qemuxml2argvmock: Drop virNuma* mocks

2023-03-08 Thread Michal Privoznik
lprit. Signed-off-by: Michal Privoznik --- src/util/virnuma.h| 2 +- ...-unavailable-restrictive.x86_64-latest.err | 2 +- ...mnode-unavailable-strict.x86_64-latest.err | 2 +- ...umatune-static-nodeset-exceed-hostnode.err | 2 +- tests/qemuxml2argvm

[PATCH 11/14] qemu: Add @nodemask argument to qemuBuildThreadContextProps()

2023-03-08 Thread Michal Privoznik
. That's the point where having the value in virBitmap comes handy. Utilize the previous commit, which made qemuBuildMemoryBackendProps() set the argument and pass it into qemuBuildThreadContextProps(). Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c

[PATCH 10/14] qemu: Add @nodemaskRet argument to qemuBuildMemoryBackendProps()

2023-03-08 Thread Michal Privoznik
the JSON array. Instead, introduce an argument to qemuBuildMemoryBackendProps() which is set to corresponding value used when formatting the attribute. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 40 src/qemu/qemu_command.h | 4

[PATCH 00/14] qemuBuildThreadContextProps: Prune .node-afinity wrt

2023-03-08 Thread Michal Privoznik
See 12/14 for explanation and seeing the fix in action. Michal Prívozník (14): virnuma: Move virNumaNodesetToCPUset() our of WITH_NUMACTL virnuma: Introduce virNumaCPUSetToNodeset() virnumamock: Introduce virNumaGetNodeOfCPU() mock qemuxml2argvtest: Use virnuma mock qemuxml2argvdata: Adj

[PATCH 03/14] virnumamock: Introduce virNumaGetNodeOfCPU() mock

2023-03-08 Thread Michal Privoznik
Introduce a mock of virNumaGetNodeOfCPU() because soon we will need virNumaCPUSetToNodeset() to return predictable results. Also, fill in missing symlinks in vircaps2xmldata/. Signed-off-by: Michal Privoznik --- src/util/virnuma.h| 2 +- .../linux-basic/system/cpu

[PATCH 05/14] qemuxml2argvdata: Adjust maximum NUMA node used

2023-03-08 Thread Michal Privoznik
. Signed-off-by: Michal Privoznik --- tests/qemuxml2argvdata/migrate-numa-unaligned.args | 4 ++-- tests/qemuxml2argvdata/migrate-numa-unaligned.xml| 4 ++-- tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml | 4 ++-- tests/qemuxml2argvdata/numatune-memnode.args

[PATCH 12/14] qemuBuildThreadContextProps: Prune .node-afinity wrt

2023-03-08 Thread Michal Privoznik
g the allocation. Therefore, we should honor the pinning and prune the list of node so that inaccessible ones are dropped. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2154750 Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 26 --- src

[PATCH 01/14] virnuma: Move virNumaNodesetToCPUset() our of WITH_NUMACTL

2023-03-08 Thread Michal Privoznik
urned from virNumaGetNodeCPUs() (including the one that !WITH_NUMACTL stub returns) is propagated properly. Move the function out of the block into a generic one and drop the !WITH_NUMACTL stub. Signed-off-by: Michal Privoznik --- src/util/virnuma.c | 115 + 1 fi

[PATCH 04/14] qemuxml2argvtest: Use virnuma mock

2023-03-08 Thread Michal Privoznik
have to start building virnumamock unconditionally. But this is not a problem, since nothing inside of the mock relies on Linux specificity. The whole mock is merely just reading files and parsing them. Signed-off-by: Michal Privoznik --- tests/meson.build| 2 +- tests/qemuxml2argvtest.c

[PATCH 13/14] docs: Document memory allocation and emulator pinning limitation

2023-03-08 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- docs/formatdomain.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index c4077c6868..206875d68e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1117,7 +1117,9

[PATCH 02/14] virnuma: Introduce virNumaCPUSetToNodeset()

2023-03-08 Thread Michal Privoznik
So far, we have a function that expands given list of NUMA nodes into list of CPUs. But soon, we are going to need the inverse - expand list of CPUs into list of NUMA nodes. Introduce virNumaCPUSetToNodeset() for that. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 2 ++ src

[PATCH 08/14] qemu: Move cpuset preference evaluation into a separate function

2023-03-08 Thread Michal Privoznik
set for VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 18 ++ src/qemu/qemu_domain.h | 5 + src/qemu/qemu_process.c | 9 ++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/

[PATCH 14/14] NEWS: Document recent thread-context bug fix

2023-03-08 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 089ad733f2..29239950c1 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -42,6 +42,13 @@ v9.2.0 (unreleased) Due to a logic bug introduced in libvirt 9.0.0, VM

[PATCH 06/14] qemuxml2argvdata: Extend vCPUs placement in memory-hotplug-dimm-addr.xml

2023-03-08 Thread Michal Privoznik
configuration, as-is currently, would make QEMU error out anyway. Signed-off-by: Michal Privoznik --- tests/qemuxml2argvdata/memory-hotplug-dimm-addr.xml | 2 +- .../memory-hotplug-dimm-addr.x86_64-latest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 3/4] virscsihost: Drop needless labels

2023-03-08 Thread Michal Privoznik
After previous cleanups, we're left with a couple of needless labels, that contain nothing but a return statement. Drop those. Signed-off-by: Michal Privoznik --- src/util/virscsihost.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/util/virscsih

[PATCH 2/4] virSCSIHostFindByPCI: Decrease scope of some variables

2023-03-08 Thread Michal Privoznik
Inside of virSCSIHostFindByPCI() there're some variables that are used from a while() loop exclusively. Bring their declaration into the loop. Signed-off-by: Michal Privoznik --- src/util/virscsihost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src

[PATCH 1/4] virscsihost: use g_autofree more

2023-03-08 Thread Michal Privoznik
Remove some obvious uses of VIR_FREE() in favor of automatic cleanup. This also means, that some variables affected are brought into the inner most block, so that automatic cleanup is effective. Signed-off-by: Michal Privoznik --- src/util/virscsihost.c | 24 ++-- 1 file

[PATCH 4/4] virSCSIHostFindByPCI: Fix link detection

2023-03-08 Thread Michal Privoznik
hful reply - because it's called over dent->d_name instead of full path. Fix this by moving the virFileIsLink() call and passing constructed path into it. Signed-off-by: Michal Privoznik --- src/util/virscsihost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/

[PATCH 0/4] virscsihost: Couple of cleanups and fixes

2023-03-08 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (4): virscsihost: use g_autofree more virSCSIHostFindByPCI: Decrease scope of some variables virscsihost: Drop needless labels virSCSIHostFindByPCI: Fix link detection src/util/virscsihost.c | 48 ++ 1 file chang

[PATCH 2/2] src: Document virDomainInterfaceStats() limitation

2023-03-06 Thread Michal Privoznik
ument this limitation. Signed-off-by: Michal Privoznik --- docs/manpages/virsh.rst | 3 ++- src/libvirt-domain.c| 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index d5b614dc03..26c328d390 100644 --- a/docs/manpages/virsh

[PATCH 1/2] conf: Make macvtap ethernet share host view

2023-03-06 Thread Michal Privoznik
determines whether given interface is a macvtap (which is notoriously known for falling into the first category). Let's use it to help virDomainNetTypeSharesHostView() determine the view more accurately. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2175449 Signed-off-by: Michal Pr

[PATCH 0/2] src: Document virDomainInterfaceStats() limitation

2023-03-06 Thread Michal Privoznik
See individual patches. Michal Prívozník (2): conf: Make macvtap ethernet share host view src: Document virDomainInterfaceStats() limitation docs/manpages/virsh.rst | 3 ++- src/conf/domain_conf.c | 6 +- src/libvirt-domain.c| 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-)

[PATCH] NEWS: Document my contributions for upcoming release

2023-03-01 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 33 + 1 file changed, 33 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 683c147af0..ab43d40f16 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -93,6 +93,39 @@ v9.1.0 (unreleased) properly terminated. This could

[PATCH 4/4] qemu_monitor: Decouple switch()-es in qemuMonitorJSONGetMemoryDeviceInfo()

2023-02-27 Thread Michal Privoznik
There are two switch() statements over the same variable inside of qemuMonitorJSONGetMemoryDeviceInfo(). Join them together into one switch. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor_json.c | 97 1 file changed, 42 insertions(+), 55 deletions

[PATCH 3/4] qemu_monitor: Switch to virDomainMemoryModel enum in qemuMonitorJSONGetMemoryDeviceInfo()

2023-02-27 Thread Michal Privoznik
But QEMU reports back the parent model, instead of specific child instance. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor_json.c | 52 +--- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monito

[PATCH 0/4] qemu: Fix regression wrt virtio-pmem

2023-02-27 Thread Michal Privoznik
The first one fixes a regression in which we're unable to start a domain with a virtio-pmem device. It should go into the release. The rest is just a cleanup because the function in question started looking disarranged. Michal Prívozník (4): qemu: Don't error out on 'unknown' memory model in

[PATCH 1/4] qemu: Don't error out on 'unknown' memory model in qemuMonitorJSONGetMemoryDeviceInfo()

2023-02-27 Thread Michal Privoznik
information is updated. The rest is to be ignored. Except, when introducing SGX support, this was turned into an error leaving us unable to start any domain with virtio-pmem memory device (as virtio-pmem is to be ignored). Fixes: ddb1bc051959eef4ad7ed6ac47b57056632bdb5e Signed-off-by: Michal Privoznik

[PATCH 2/4] libvirt_private.syms: Export virDomainMemoryModelTypeFromString()

2023-02-27 Thread Michal Privoznik
The virDomainMemoryModelTypeFromString() is not exported, though the enum translation functions are declared in src/conf/domain_conf.h. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libvirt_private.syms b/src

[PATCH 3/4] qemu: Drop @cmdret argument from qemuSecurityCommandRun()

2023-02-20 Thread Michal Privoznik
a single caller (and probably will never be (TM)), that would need to distinguish the reason for the failure. Therefore, qemuSecurityCommandRun() can be made to pass the retval of virCommandRun() called under the hood. Signed-off-by: Michal Privoznik --- src/qemu/qemu_dbus.c | 12 ++

[PATCH 4/4] qemu: Let virCommand module translate exitstatus

2023-02-20 Thread Michal Privoznik
caller which might want to process exit code. So keep the argument for now and just pass NULL. Signed-off-by: Michal Privoznik --- src/qemu/qemu_dbus.c | 9 + src/qemu/qemu_passt.c | 11 +-- src/qemu/qemu_security.c | 2 +- src/qemu/qemu_slirp.c |

[PATCH 2/4] qemu: Don't overwrite error from qemuSecurityCommandRun()

2023-02-20 Thread Michal Privoznik
n() fails (i.e. cmdret < 0), then proper error was already reported. But in this pattern we overwrite it (usually with less specific) error. Signed-off-by: Michal Privoznik --- src/qemu/qemu_dbus.c | 6 -- src/qemu/qemu_passt.c | 6 -- src/qemu/qemu_security.c |

[PATCH 1/4] qemu_slirp: Don't set errfd when starting slirp helper

2023-02-20 Thread Michal Privoznik
t may contain reason for failed start), this is going to be handled in more general way in next commits. Signed-off-by: Michal Privoznik --- src/qemu/qemu_slirp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_slirp.c b/src/qemu/qemu_slirp.c index 3f83db03bf..faf58b0394 100644 ---

[PATCH 0/4] qemu: Let virCommand report errors

2023-02-20 Thread Michal Privoznik
In a lot of places we catch errors from qemuSecurityCommandRun() only to produce an error report. But we can let virCommand module do the same. Michal Prívozník (4): qemu_slirp: Don't set errfd when starting slirp helper qemu: Don't overwrite error from qemuSecurityCommandRun() qemu: Drop @c

[PATCH v2 1/2] selinux: Swap two blocks handling setfilecon_raw() failure

2023-02-17 Thread Michal Privoznik
e two blocks is a bit confusing because the comment above them mentions the NFS case but EPERM block follows. Swap these two blocks to make it less confusing. Signed-off-by: Michal Privoznik --- src/security/security_selinux.c | 30 +++--- 1 file changed, 15 insertions(+

[PATCH v2 2/2] selinux: Don't ignore ENOENT in Permissive mode

2023-02-17 Thread Michal Privoznik
ff-by: Michal Privoznik --- src/security/security_selinux.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index e9c4051a98..2e9efa78f4 100644 --- a/src/security/security_selinux.c +++ b/src/sec

[PATCH v2 0/2] selinux: Don't ignore ENOENT in Permissive mode

2023-02-17 Thread Michal Privoznik
This is just a resend of the following series: https://listman.redhat.com/archives/libvir-list/2021-October/msg00738.html Michal Prívozník (2): selinux: Swap two blocks handling setfilecon_raw() failure selinux: Don't ignore ENOENT in Permissive mode src/security/security_selinux.c | 32 +++

[PATCH v2 3/5] qemu_passt: Make passt report errors to stderr whenever possible

2023-02-16 Thread Michal Privoznik
duce more user friendly error message on failed start. Signed-off-by: Michal Privoznik --- src/qemu/qemu_passt.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index c082c149cd..881205449b 100644 --- a/src/qemu/

[PATCH v2 4/5] qemu_passt: Deduplicate passt killing code

2023-02-16 Thread Michal Privoznik
move the internals of qemuPasstStop() into a separate function and call it from both places. Signed-off-by: Michal Privoznik --- src/qemu/qemu_passt.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c

[PATCH v2 2/5] qemu_passt: Report passt's error on failed start

2023-02-16 Thread Michal Privoznik
ch to virCommandSetErrorBuffer() instead of reading error from an FD. Signed-off-by: Michal Privoznik --- src/qemu/qemu_passt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index adc69fc052..c082c149cd 100644 --- a/src/qemu/qemu_passt.c

[PATCH v2 1/5] qemu_passt: Avoid double daemonizing passt

2023-02-16 Thread Michal Privoznik
When passt is started, it daemonizes itself by default. There's no point in having our virCommand module daemonize it too. Signed-off-by: Michal Privoznik --- src/qemu/qemu_passt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index 78830

[PATCH v2 5/5] qemu_passt: Let passt write the PID file

2023-02-16 Thread Michal Privoznik
tion is to let passt write the PID file, but since it does not lock the file and closes it as soon as it is written, we have to switch to those virPidFile APIs which don't expect PID file to be locked. Signed-off-by: Michal Privoznik --- src/qemu/qemu_passt.c | 11 +++ 1 file ch

[PATCH v2 0/5] qemu_passt: Fix issues with PID file

2023-02-16 Thread Michal Privoznik
This is a v2 of: https://listman.redhat.com/archives/libvir-list/2023-February/237731.html diff to v1: - Merged patches that were ACKed in v1, - Dropped 4/4 from the original series (the one that sets --foreground), and implemented a different approach Michal Prívozník (5): qemu_passt: Avoid

[PATCH] qemu_extdevice: Add a comment into qemuExtDevicesSetupCgroup()

2023-02-15 Thread Michal Privoznik
qemuExtDevicesSetupCgroup() it's easy to miss this hidden logic. Therefore, add a warning at the beginning of the function. Signed-off-by: Michal Privoznik --- src/qemu/qemu_extdevice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c

[PATCH 3/4] qemu_passt: Report error when getting passt PID failed

2023-02-14 Thread Michal Privoznik
If qemuPasstGetPid() fails, or the passt's PID is -1 then qemuPasstSetupCgroup() returns early without any error message set. Report an appropriate error. Signed-off-by: Michal Privoznik --- src/qemu/qemu_passt.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src

[PATCH 1/4] Revert "qemu: allow passt to self-daemonize"

2023-02-14 Thread Michal Privoznik
This reverts commit 0c4e716835eaf2a575bd063fde074c0fc7c4e4d4. This patch was pushed by my mistake. Even though it got ACKed on the list, I've raised couple of issues with it. They will be fixed in next commits. Signed-off-by: Michal Privoznik --- src/qemu/qemu_passt.c | 9 + 1

[PATCH 4/4] qemu_passt: Don't let passt fork off

2023-02-14 Thread Michal Privoznik
closed and the PID file itself contains the correct PID. Signed-off-by: Michal Privoznik --- src/qemu/qemu_passt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index 78830fdc26..441cfe87e8 100644 --- a/src/qemu/qemu_passt.c +++ b/src/qemu

[PATCH 2/4] qemu_extdevice: Make qemuExtDevicesHasDevice() check def->nets

2023-02-14 Thread Michal Privoznik
We can have external helper processes running for domain too (e.g. slirp or passt). But this is not reflected in qemuExtDevicesHasDevice() which simply ignores these. Signed-off-by: Michal Privoznik --- src/qemu/qemu_extdevice.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a

[PATCH 0/4] qemu_passt: Don't let passt fork off

2023-02-14 Thread Michal Privoznik
Here are some cleanup, as promised here: https://listman.redhat.com/archives/libvir-list/2023-February/237721.html Now, there are still some patches missing. Firstly, we still don't really capture error from passt. My suggestion was to wait for socket to show up with errfd open. But active wait

[PATCH] test: Introduce chxml2xmltest

2023-02-10 Thread Michal Privoznik
Whilst reviewing a patch upstream (that ended up as v9.0.0-200-g092176e5ec), I realized we don't have a single xml2xml test for CH driver. Well, introduce the test with one simple test case for now. Signed-off-by: Michal Privoznik --- We could also benefit from xml2arg test, but I'll

[PATCH] qemu_extdevice: Do cleanup host only for VIR_DOMAIN_TPM_TYPE_EMULATOR

2023-02-10 Thread Michal Privoznik
tps://bugzilla.redhat.com/show_bug.cgi?id=2168762 Signed-off-by: Michal Privoznik --- src/qemu/qemu_extdevice.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index f7b2e2e653..fdefe59215 100644 --- a/src/qemu/qemu_extdevice.c +++ b/

[PATCH] remote_driver: Work around broken clang

2023-02-09 Thread Michal Privoznik
makes clang happy again. Signed-off-by: Michal Privoznik --- src/remote/remote_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 58cd0abe8c..a4c60be3d7 100644 --- a/src/remote/remote_driver.c +++ b/src/r

[PATCH v2 8/8] remote: Pass 'mode' and 'socket' URI parameters to virt-ssh-helper

2023-02-08 Thread Michal Privoznik
bssh2, ssh) we need to pass ?mode and ?socket parameters, so that it can do the right thing, e.g. for 'mode=legacy' start the monolithic daemon, or for 'socket=' connect to the given socket. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/433 Signed-off-by: Michal Pr

[PATCH v2 6/8] remote_driver: Move URI re-generation into a function

2023-02-08 Thread Michal Privoznik
There's a piece of code in doRemoteOpen() that is going to be called twice. Instead of duplicating the code, move it into a function that will be called twice, later on. Signee-off-by: Michal Privoznik Reviewed-by: Peter Krempa Signed-off-by: Michal Privoznik --- src/remote/remote_dri

[PATCH v2 7/8] viruri: Introduce virURIParamsSetIgnore()

2023-02-08 Thread Michal Privoznik
The aim of this helper is to manipulate the .ignore value for given list of parameters. For instance: virURIParamsSetIgnore(uri, false, {"mode", "socket", NULL}); Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/

[PATCH v2 3/8] doRemoteOpen(): Rename 'failed' label to 'error'

2023-02-08 Thread Michal Privoznik
atter category. Rename it then. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/remote/remote_driver.c | 62 +++--- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 2e08f

[PATCH v2 4/8] virt-ssh-helper: Accept ?mode= in connection URI

2023-02-08 Thread Michal Privoznik
virt-ssh-helper. True, our remote driver code still does not pass the 'mode' parameter, but that will be addressed in next commits. Signed-off-by: Michal Privoznik --- src/remote/remote_ssh_helper.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff -

[PATCH v2 5/8] virt-ssh-helper: Accept ?socket= in connection URI

2023-02-08 Thread Michal Privoznik
to virt-ssh-helper, yet. Signed-off-by: Michal Privoznik --- src/remote/remote_ssh_helper.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/remote/remote_ssh_helper.c b/src/remote/remote_ssh_helper.c index 8adc62acf2..29f5889533 100644 --- a/src/rem

[PATCH v2 1/8] viruri: Search params case insensitively

2023-02-08 Thread Michal Privoznik
stead of STREQ() at two places: virURIGetParam() and virURICheckUnixSocket(). Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/viruri.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/util/viruri.c b/src/util/viruri.c index 88bb0

[PATCH v2 2/8] Drop checks for virURIFormat() retval

2023-02-08 Thread Michal Privoznik
The virURIFormat() function either returns a string, or aborts (on OOM). There's no way this function can return NULL (as of v7.2.0-rc1~277). Therefore, it doesn't make sense to check its retval against NULL. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/adm

[PATCH v2 0/8] remote: Pass 'mode' and 'socket' URI parameters to virt-ssh-helper

2023-02-08 Thread Michal Privoznik
v2 of: https://listman.redhat.com/archives/libvir-list/2023-February/237540.html diff to v1: - Dropped "remote_driver: Expose EXTRACT_URI_ARG_* macros" patch - Dropped "src: Unify URI params parsing" patch - Reworked couple of patches as a result of that - Reworded couple of commit messages Mich

[PATCH] qemu_namespace: Deal with nested mounts when umount()-ing /dev

2023-02-07 Thread Michal Privoznik
ed" mount points. Or, since it is the top most file system that is accessible anyways (and this one is preserved), we can umount("/dev") in a recursive fashion. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2167302 Fixes: 379c0ce4bfed8733dfbde557c359eecc5474ce38 Signed-off-by:

[PATCH] qemu_process: Produce better debug message wrt domain namespaces

2023-02-07 Thread Michal Privoznik
about actual state of namespace - whether it was enabled or not. Therefore, move the debug printing into qemuProcessEnableDomainNamespaces() and tweak it so that the actual value is reflected. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 8 ++-- 1 file changed, 6 insertions(

[PATCH 2/2] virhostdevtest: Decrease possibility of uninitialized @subsys

2023-02-06 Thread Michal Privoznik
bsys point to the corresponding member in hostdev[i] from the start. This way only the important bits are overwritten and the rest stays initialized to zero. Signed-off-by: Michal Privoznik --- tests/virhostdevtest.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) di

[PATCH 1/2] virhostdevtest: Initialize hostdev @subsys

2023-02-06 Thread Michal Privoznik
ted crashes at runtime. Signed-off-by: Michal Privoznik --- tests/virhostdevtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index b9e16dd4e8..92bafcbb49 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -12

[PATCH 0/2] virhostdevtest: Initialize hostdev @subsys

2023-02-06 Thread Michal Privoznik
While the first one qualifies to be pushed as trivial, the second less so. I'll wait a while and if there's no reply I'll just push these, as the build is currently broken. Michal Prívozník (2): virhostdevtest: Initialize hostdev @subsys virhostdevtest: Decrease possibility of uninitialized @s

[PATCH 06/10] virt-ssh-helper: Accept ?mode= in connection URI

2023-02-06 Thread Michal Privoznik
virt-ssh-helper. True, our remote driver code still does not pass the 'mode' parameter, but that will be addressed in next commits. Signed-off-by: Michal Privoznik --- src/remote/remote_ssh_helper.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/

[PATCH 10/10] remote: Pass 'mode' and 'socket' URI parameters to virt-ssh-helper

2023-02-06 Thread Michal Privoznik
ssh-helper (and neither is the 'socket=...' parameter). But now that virt-ssh-helper parses those URI parameters, we can pass them onto the remote host. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/433 Signed-off-by: Michal Privoznik --- src/remote/remote_driver.c | 29

[PATCH 07/10] virt-ssh-helper: Accept ?socket= in connection URI

2023-02-06 Thread Michal Privoznik
to virt-ssh-helper, yet. Signed-off-by: Michal Privoznik --- src/remote/remote_ssh_helper.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/remote/remote_ssh_helper.c b/src/remote/remote_ssh_helper.c index 3b4de7f214..0eafc70d16 100644 --- a/src/rem

[PATCH 03/10] doRemoteOpen(): Rename 'failed' label to 'error'

2023-02-06 Thread Michal Privoznik
atter category. Rename it then. Signed-off-by: Michal Privoznik --- src/remote/remote_driver.c | 62 +++--- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 2e08ff246f..6a226999df 100644 --

[PATCH 09/10] viruri: Introduce virURIParamsSetIgnore()

2023-02-06 Thread Michal Privoznik
The aim of this helper is to manipulate the .ignore value for given list of parameters. For instance: virURIParamsSetIgnore(uri, false, {"mode", "socket", NULL}); Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/viruri.c| 18

[PATCH 04/10] remote_driver: Expose EXTRACT_URI_ARG_* macros

2023-02-06 Thread Michal Privoznik
Almost in all places where an URI is parsed we look for additional argument(s). The remote driver's parsing uses two macros EXTRACT_URI_ARG_STR() and EXTRACT_URI_ARG_BOOL() for that purpose. Expose these so that other places can be rewritten using those macros. Signed-off-by: Michal Priv

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