[PATCH 3/4] virSecretLoadAllConfigs: Use g_autofree for @path

2023-10-16 Thread Michal Privoznik
When loading virSecret configs, the @path variable holds path to individual config files. In each iteration it is freed explicitly using VIR_FREE(). Switch it to g_autofree and remove those explicit calls. Signed-off-by: Michal Privoznik --- src/conf/virsecretobj.c | 4 +--- 1 file changed, 1

[PATCH 4/4] virSecretLoad: Simplify cleanup path

2023-10-16 Thread Michal Privoznik
When loading a secret value fails, the control jumps over to the 'cleanup' label where explicit call to virSecretDefFree() happens. This is unnecessary as the corresponding variable can be declared with g_autoptr() after which all error paths can just return NULL instantly. Signed-off-

[PATCH 2/4] virfile: Drop virBuildPathInternal()

2023-10-16 Thread Michal Privoznik
After previous cleanup the virBuildPathInternal() function is no longer used. Drop it. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 - src/util/virfile.c | 22 -- src/util/virfile.h | 5 - 3 files changed, 28 deletions(-) diff --git a

[PATCH 1/4] lib: Replace virBuildPath() with g_build_filename()

2023-10-16 Thread Michal Privoznik
Our virBuildPath() constructs a path from given arguments. Exactly like g_build_filename(), except the latter is more generic as it uses backslashes on Windows. Therefore, replace the former with the latter. Signed-off-by: Michal Privoznik --- docs/kbase/internals/command.rst | 2 +- src/util

[PATCH 0/4] Misc cleanups

2023-10-16 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (4): lib: Replace virBuildPath() with g_build_filename() virfile: Drop virBuildPathInternal() virSecretLoadAllConfigs: Use g_autofree for @path virSecretLoad: Simplify cleanup path docs/kbase/internals/command.rst | 2 +- src/conf/virsecretobj.c

[PATCH] virDomainMemoryDefValidate: Skip the same device on validation on memory device update

2023-10-16 Thread Michal Privoznik
et. Thus my algorithm which skips over the same entry fails. Fortunately, we require full device XML on device update and thus we can use device address and aliases to detect duplicity. Fixes: 3fd64fb0e236fc80ffa2cc977c0d471f11fc39bf Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c |

[PATCH] NEWS: Document my contributions for upcoming release

2023-09-29 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 12 1 file changed, 12 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index c17a1d002d..6f46e86ba8 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -43,8 +43,20 @@ v9.8.0 (unreleased) stability of qemu. Therefore, when available, libvirt

[PATCH] NEWS: Fix placement of network metadata entry

2023-09-29 Thread Michal Privoznik
The network metadata support is a new feature in the upcoming release, not a removed one. Place it accordingly. Signed-off-by: Michal Privoznik --- NEWS.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 768e6fc326..c17a1d002d 100644 --- a

[PATCH 0/3] A couple of virtio-mem/virtio-pmem address improvements

2023-09-22 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): domain_validate: Validate VIRTIO_PMEM address alignment virDomainMemoryDefValidate: Fix VIRTIO_MEM alignment check virDomainMemoryDefValidate: Check for overlapping memory devices src/conf/domain_validate.c| 59 ++

[PATCH 1/3] domain_validate: Validate VIRTIO_PMEM address alignment

2023-09-22 Thread Michal Privoznik
would surely be still valid. Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index ac32fa1477..e423383e22 100644 --- a/src/conf/domain_validate.c +++ b/src/conf

[PATCH 3/3] virDomainMemoryDefValidate: Check for overlapping memory devices

2023-09-22 Thread Michal Privoznik
/RHEL-4452 Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c| 47 + ...rtio-mem-overlap-address.x86_64-latest.err | 1 + ...ory-hotplug-virtio-mem-overlap-address.xml | 50 +++ tests/qemuxml2argvtest.c | 1 + 4

[PATCH 2/3] virDomainMemoryDefValidate: Fix VIRTIO_MEM alignment check

2023-09-22 Thread Michal Privoznik
cking whether address is a multiple of the block size, the latter has to be multiplied by a factor of 1024. Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c

[PATCH] test_driver: Implement virConnectGetDomainCapabilities()

2023-09-20 Thread Michal Privoznik
Our test driver lacks implementation for virConnectGetDomainCapabilities(). Provide one, though a trivial one. Mostly so that something else than VIR_ERR_NO_SUPPORT error is returned. Signed-off-by: Michal Privoznik --- src/test/test_driver.c | 36 1 file

[PATCH 4/4] virerror: Make virReportEnumRangeError() check for type mismatch

2023-09-19 Thread Michal Privoznik
enum. Extend the hack to check whether proper enum was passed. Signed-off-by: Michal Privoznik --- src/util/virerror.h | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/util/virerror.h b/src/util/virerror.h index ee85247433..d4b2679a09 100644 --- a/src

[PATCH 1/4] virnetdevvportprofile: Turn virNetDevVPortProfileLinkOp enum into a proper typedef

2023-09-19 Thread Michal Privoznik
This allows us to declare variables without using 'enum virNetDev' and will become more useful in the near future (when virReportEnumRangeError() is fixed). Signed-off-by: Michal Privoznik --- src/util/virnetdevvportprofile.c | 8 1 file changed, 4 insertions(+), 4

[PATCH 2/4] virNetDevVPortProfileOp8021Qbh: Use proper type in virReportEnumRangeError()

2023-09-19 Thread Michal Privoznik
The @virtPortOp variable inside of virNetDevVPortProfileOp8021Qbh is of type virNetDevVPortProfileLinkOp. Pass the proper type to virReportEnumRangeError(). Signed-off-by: Michal Privoznik --- src/util/virnetdevvportprofile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH 3/4] virDomainVideoDefValidate: Use proper type in virReportEnumRangeError()

2023-09-19 Thread Michal Privoznik
The @backend member of _virDomainVideoDef struct is of type virDomainVideoBackendType. Pass the proper type to virReportEnumRangeError(). Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_validate.c

[PATCH 0/4] virerror: Make virReportEnumRangeError() check for type mismatch

2023-09-19 Thread Michal Privoznik
There are few cases where virReportEnumRangeError() is passed to a mismatching enum. With patch 4/4 we can check for this at compile time (assuming -Wenum-compare is available). For instance with clang I get: FAILED: src/conf/libvirt_conf.a.p/domain_validate.c.o clang ... ../src/conf/domain_vali

[PATCH] src: Avoid needless checks before calling g_strdup()

2023-09-18 Thread Michal Privoznik
There are few places where the following pattern occurs: if (var) other = g_strdup(var); where @other wasn't initialized before g_strdup(). Checking for var != NULL is useless in this case, as that's exactly what g_strdup() does (in which case it returns NULL). Signed-off-

[PATCH merged] bhyveBuildControllerArgStr: Fill in missing cases to switch() statement

2023-09-15 Thread Michal Privoznik
When making 'type' member of virDomainControllerDef to be of virDomainControllerType rather than an int I forgot to update bhyve_command.c. Fixes: 27a653b8931051991d44b8776a8cdc08c666b729 Signed-off-by: Michal Privoznik --- Pushed as build breaker fix. src/bhyve/bhyve_comm

[PATCH 08/20] virDomainHostdevSubsysSCSI: Convert 'protocol' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 18 ++ src/conf/domain_conf.h | 2 +- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 4 ++-- 4 files changed, 11 insertions(+), 17

[PATCH 13/20] virDomainControllerDef: Convert 'type' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 26 ++ src/conf/domain_conf.h | 9 ++--- src/qemu/qemu_command.c| 2 +- src/qemu/qemu_domain.c | 2

[PATCH 10/20] virDomainHostdevDef: Convert 'mode' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field, adjust the XML parser to use virXMLPropEnumDefault() and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/domain_audit.c | 2 +- src/conf/domain_conf.c | 23 +-- src/conf/domain_conf.h

[PATCH 12/20] virDomainHostdevSubsys: Convert 'type' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field, and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/domain_audit.c | 2 +- src/conf/domain_conf.c | 57 +++- src/conf/domain_conf.h | 2 +- src/conf/domain_validate.c

[PATCH 20/20] virDomainDiskSourceNVMeParse: Use virXMLPropULongLong()

2023-09-14 Thread Michal Privoznik
Inside of virDomainDiskSourceNVMeParse() we have virXMLPropString() + virStrToLong_ull() combo. Switch to virXMLPropULongLong() which does the same thing. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git

[PATCH 01/20] lxc_controller: Access correct union member in virLXCControllerSetupHostdevCaps()

2023-09-14 Thread Michal Privoznik
The point of virLXCControllerSetupHostdevCaps() is to access .caps union member of given source. And it does so in the switch, but then, when reporting an error the .subsys member is accessed. Signed-off-by: Michal Privoznik --- src/lxc/lxc_controller.c | 2 +- 1 file changed, 1 insertion

[PATCH 19/20] virStorageNetHostDef: Convert 'transport' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parsers to use virXMLPropEnumDefault(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 16 ++-- src/conf/storage_source_conf.h | 2 +- src/qemu/qemu_backup.c | 2

[PATCH 18/20] virDomainDeviceInfo: Convert 'type' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field, adjust the XML parsers to use virXMLPropEnum() and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/device_conf.c | 12 +++- src/conf/device_conf.h | 4 ++-- src/conf/domain_conf.c | 21 +++-- src

[PATCH 17/20] virDomainWatchdogDef: Convert 'action' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnumDefault(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 17 ++--- src/conf/domain_conf.h | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf

[PATCH 16/20] virDomainWatchdogDef: Convert 'model' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parsers to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 15 --- src/conf/domain_conf.h | 2 +- src/qemu/qemu_domain_address.c | 2 +- src/qemu/qemu_validate.c | 2 +- 4 files changed

[PATCH 02/20] src: Access hostdev->source.subsys iff VIR_DOMAIN_HOSTDEV_MODE_SUBSYS

2023-09-14 Thread Michal Privoznik
There are few places where a virDomainHostdevDef->source.subsys is accessed without ->mode being checked. Mind you, virDomainHostdevDef can be also in VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES mode. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c| 3 ++- src/conf/domain_vali

[PATCH 15/20] virDomainRNGDef: Convert 'backend' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_audit.c | 4 ++-- src/conf/domain_conf.c| 22 -- src/conf/domain_conf.h| 2 +- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_namespace.c

[PATCH 11/20] virDomainHostdevCaps: Convert 'type' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field, adjust the XML parsers to use virXMLPropEnum() and fill in missing cases to switch() statements. Signed-off-by: Michal Privoznik --- src/conf/domain_audit.c | 2 ++ src/conf/domain_conf.c | 29 ++--- src/conf/domain_conf.h

[PATCH 14/20] virDomainRNGDef: Convert 'model' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 13 - src/conf/domain_conf.h | 2 +- src/qemu/qemu_domain_address.c | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff

[PATCH 07/20] src: Drop needless typecast to virDomainDiskBus

2023-09-14 Thread Michal Privoznik
The 'bus' member of _virDomainDiskDef is already declared of virDomainDiskModel type. Hence, there is no need to typecast the variable when passing to switch() statements. Signed-off-by: Michal Privoznik --- src/qemu/qemu_alias.c | 2 +- src/qemu/qemu_command.c| 4

[PATCH 09/20] virDomainHostdevSubsysSCSIVHost: Convert 'protocol' field to proper enum type

2023-09-14 Thread Michal Privoznik
Convert the field and adjust the XML parser to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 17 + src/conf/domain_conf.h | 4 ++-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf

[PATCH 06/20] qemu_domain_address: Drop needless typecast to virDomainDiskModel

2023-09-14 Thread Michal Privoznik
The 'mode' member of _virDomainDiskDef is already declared of virDomainDiskModel type. Hence, there is no need to typecast the variable when passing to switch() statements. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain_address.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 05/20] src: Drop needless typecast to virDomainDeviceType

2023-09-14 Thread Michal Privoznik
The 'type' member of _virDomainDeviceDef is already declared of virDomainDeviceType type. Hence, there is no need to typecast the variable when passing to switch() statements. Signed-off-by: Michal Privoznik --- src/ch/ch_domain.c | 2 +- src/conf/domain_conf.c

[PATCH 03/20] qemu_domain_address: Drop needless typecast in qemuDomainDeviceCalculatePCIConnectFlags()

2023-09-14 Thread Michal Privoznik
Inside of qemuDomainDeviceCalculatePCIConnectFlags() there's a switch() which typecasts a variable of virDomainHostdevSubsysSCSIVHostModelType type to the very same type. This is useless. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain_address.c | 2 +- 1 file changed, 1 inse

[PATCH 00/20] Misc cleanups (pt. 1)

2023-09-14 Thread Michal Privoznik
I had these sitting on a local branch for a while. My initial plan was to use virXMLPropEnum() more and while working on that I found one bug (patch 01/20), one improvement (patch 02/20) and a couple of useless typecats. Michal Prívozník (20): lxc_controller: Access correct union member in v

[PATCH 04/20] qemu: Drop needless typecast to virDomainFSDriverType

2023-09-14 Thread Michal Privoznik
The 'fsdriver' member of _virDomainFSDef is already declared of virDomainFSDriverType type. Hence, there is no need to typecast the variable when passing to switch() statements. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c| 4 ++-- src/qemu/qemu_domain_add

[PATCH 2/2] virutil: Check retval of capng_apply()

2023-09-11 Thread Michal Privoznik
on is declared with 'warn unused result' [1]. 1: https://github.com/stevegrubb/libcap-ng/commit/a0743c335c9a16a2fda9b25120a5523742119e47 Signed-off-by: Michal Privoznik --- src/util/virutil.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/virutil.c b/src

[PATCH 1/2] lxc_container: Check retval of capng_get_caps_process()

2023-09-11 Thread Michal Privoznik
eding edge distros - like Fedora rawhide - already picked up) the function has been marked as 'warn unused result'. Well, check for its retval then. 1: https://github.com/stevegrubb/libcap-ng/commit/a0743c335c9a16a2fda9b25120a5523742119e47 Signed-off-by: Michal Privoznik --- src/lxc/lxc_

[PATCH 0/2] Check for capng_*() retvals

2023-09-11 Thread Michal Privoznik
There's a commit inside of (yet-unreleased) libcap-ng which marks some functions as 'warned unused result'. Fedora rawhide already picked up the commit, but since we are not checking for all retvals we got a build failure on rawhide. https://src.fedoraproject.org/rpms/libcap-ng/c/fed9b23c8d0020e07

[PATCH] virnetdevopenvswitch: Propagate OVS error messages

2023-09-08 Thread Michal Privoznik
t read ovs-vsctl's stderr and include it in the error message. For other cases (like VIR_DEBUG/VIR_WARN) - well they are meant to end up in (debug) logs anyway. 1: https://mail.openvswitch.org/pipermail/ovs-discuss/2023-September/052640.html Signed-off-by: Michal Privoznik --- src/ut

[PATCH] virsh-snapshot: Avoid passing NULL to qsort() in virshSnapshotListCollect()

2023-09-07 Thread Michal Privoznik
__nmemb, size_t __size, __compar_fn_t __compar) __nonnull ((1, 4)); Resolves: https://gitlab.com/libvirt/libvirt/-/issues/533 Signed-off-by: Michal Privoznik --- tools/virsh-snapshot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/virsh-snapshot.

[PATCH] storage_util: Drop getDeviceType()

2023-09-05 Thread Michal Privoznik
The sole purpose of getDeviceType() is to parse a file that contains one integer (and a newline character). Well, we already have a function for that: virFileReadValueInt(). Use the latter and drop the former. Signed-off-by: Michal Privoznik --- src/storage/storage_util.c | 75

[PATCH 3/3] ch: Use proper format directive for @i in virCHProcessSetupIOThreads()

2023-09-05 Thread Michal Privoznik
The @i variable inside of virCHProcessSetupIOThreads() is a typical loop counter - it's declared as size_t. But when passed to VIR_DEBUG an invalid format directive is used (%ld). Fix that. Signed-off-by: Michal Privoznik --- src/ch/ch_process.c | 2 +- 1 file changed, 1 insertion(

[PATCH 1/3] ch: Use uint for @maxvcpus in virCHDomainRefreshThreadInfo()

2023-09-05 Thread Michal Privoznik
: Michal Privoznik --- src/ch/ch_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c index 35e3471cba..d6b64b6c59 100644 --- a/src/ch/ch_domain.c +++ b/src/ch/ch_domain.c @@ -225,7 +225,7 @@ chValidateDomainDeviceDef(const

[PATCH 2/3] ch: Use int for @niothreads in virCHMonitorGetIOThreads()

2023-09-05 Thread Michal Privoznik
. Signed-off-by: Michal Privoznik --- src/ch/ch_monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c index 4f32b1ee4c..200ad6c77b 100644 --- a/src/ch/ch_monitor.c +++ b/src/ch/ch_monitor.c @@ -937,7 +937,7

[PATCH 0/3] ch: Couple of format directive fixes

2023-09-05 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): ch: Use uint for @maxvcpus in virCHDomainRefreshThreadInfo() ch: Use int for @niothreads in virCHMonitorGetIOThreads() ch: Use proper format directive for @i in virCHProcessSetupIOThreads() src/ch/ch_domain.c | 4 ++-- src/ch/ch_monitor.c | 4 ++--

[PATCH 2/2] syntax-check: Introduce a rule for one line error messages

2023-09-04 Thread Michal Privoznik
n check if _("...") is formatted on one line. With exception of _("...\n" ...) (e.g. various outputs from helper binaries like leaseshelper, sshhelper, or daemons like lockd, logd). I believe nobody would chose a substring that contains '\n' for git grep-ping the error m

[PATCH 1/2] tools: Reformat --help output of virsh and virt-admin

2023-09-04 Thread Michal Privoznik
o create a syntax-check rule for 'translation message on one line' (next commit). Reformat both strings a bit (no user visible change though). Signed-off-by: Michal Privoznik --- tools/virsh.c | 6 -- tools/virt-admin.c | 6 -- 2 files changed, 8 insertions(+), 4 deletions(-)

[PATCH 0/2] syntax-check: Introduce a rule for one line error messages

2023-09-04 Thread Michal Privoznik
This is a follow up of: https://listman.redhat.com/archives/libvir-list/2023-August/241416.html And while the regular expression in patch 2/2 is very trivial it mostly works. But I'm open for suggestions. Michal Prívozník (2): tools: Reformat --help output of virsh and virt-admin syntax-chec

[PATCH 2/4] vircommand: Isolate FD dir parsing into a separate function

2023-08-29 Thread Michal Privoznik
n argument. Unfortunately, this function might be unused on some systems (e.g. mingw), therefore mark it as such. Signed-off-by: Michal Privoznik --- src/util/vircommand.c | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/util/vircommand.c

[PATCH 1/4] vircommand: Drop unused arguments from virCommandMassCloseGetFDs*()

2023-08-29 Thread Michal Privoznik
Both virCommandMassCloseGetFDsLinux() and virCommandMassCloseGetFDsGeneric() take @cmd argument only to mark it as unused. Drop it from both. Signed-off-by: Michal Privoznik --- src/util/vircommand.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/util

[PATCH 0/4] vircommand: Various mass close improvements

2023-08-29 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (4): vircommand: Drop unused arguments from virCommandMassCloseGetFDs*() vircommand: Isolate FD dir parsing into a separate function vircommand: Make sysconf(_SC_OPEN_MAX) failure non-fatal vircommand: Parse /dev/fd on *BSD-like systems when looking for

[PATCH 3/4] vircommand: Make sysconf(_SC_OPEN_MAX) failure non-fatal

2023-08-29 Thread Michal Privoznik
igned-off-by: Michal Privoznik --- src/util/vircommand.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 822b9487f9..8c06e19723 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -500,7 +

[PATCH 4/4] vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs

2023-08-29 Thread Michal Privoznik
On BSD-like systems "/dev/fd" serves the same purpose as "/proc/self/fd". And since procfs is usually not mounted, on such systems we can use "/dev/fd" instead. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/518 Signed-off-by: Michal Privoznik --- src/ut

[PATCH 1/3] docs: Document that libxl hooks are also given full domain XML

2023-08-29 Thread Michal Privoznik
Our hooks.rst document existence of libxl hook scripts, but mentions only qemu and lxc as receivers of full domain XML. But since their introduction in v2.2.0-rc1~201 they are also given full domain XML. Fix our wording. Signed-off-by: Michal Privoznik --- docs/hooks.rst | 6 +++--- 1 file

[PATCH 3/3] bhyve: Feed hook scripts with domain XML

2023-08-29 Thread Michal Privoznik
Domain related hook scripts are all fed with domain XML on their stdin, except for bhyve. Fix this. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/528 Signed-off-by: Michal Privoznik --- docs/hooks.rst| 10 +- src/bhyve/bhyve_process.c | 35

[PATCH 2/3] docs: Document bhyve hook scripts

2023-08-29 Thread Michal Privoznik
We have bhyve hook scripts since v6.1.0-rc1~42 but never mention them in hooks.rst. Fill the blanks. Signed-off-by: Michal Privoznik --- docs/hooks.rst | 46 ++ 1 file changed, 46 insertions(+) diff --git a/docs/hooks.rst b/docs/hooks.rst index

[PATCH 0/3] bhyve: Feed hook scripts with domain XML

2023-08-29 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): docs: Document that libxl hooks are also given full domain XML docs: Document bhyve hook scripts bhyve: Feed hook scripts with domain XML docs/hooks.rst| 56 +++ src/bhyve/bhyve_process.c | 35

[PATCH] virsh-network: Drop unused variables in cmdNetworkMetadata()

2023-08-25 Thread Michal Privoznik
In one of recent commits two variable were introduced (@ctxt and @doc) that are not used. This breaks a build with clang who's able to identify that. Signed-off-by: Michal Privoznik --- Pushed under trivial and build breaker rules. tools/virsh-network.c | 3 +-- 1 file changed, 1 inse

[PATCH 11/27] node_device: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/node_device/node_device_udev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c

[PATCH 18/27] storage: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/storage/storage_backend_disk.c | 3 +- src/storage/storage_backend_fs.c | 3 +- src/storage/storage_backend_zfs.c | 3 +- src/storage/storage_driver.c | 21

[PATCH 16/27] rpc: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/rpc/virnetclient.c| 9 +++ src/rpc/virnetlibsshsession.c | 28 +++--- src/rpc/virnetserver.c| 9 +++ src/rpc/virnetserverclient.c | 3

[PATCH 27/27] tools: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- tools/virsh-domain-event.c | 15 +- tools/virsh-domain.c| 36 +++-- tools/virsh-host.c | 9 +++-- tools

[PATCH 23/27] vmware: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/vmware/vmware_conf.c | 9 +++-- src/vmware/vmware_driver.c | 6 ++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/vmware/vmware_conf.c b/src/vmware

[PATCH 14/27] qemu: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/qemu/qemu_agent.c| 18 +-- src/qemu/qemu_capabilities.c | 45 +++ src/qemu/qemu_command.c | 42 ++- src/qemu/qemu_conf.c | 5

[PATCH 08/27] locking: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/locking/lock_driver_sanlock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c index

[PATCH 05/27] esx: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/esx/esx_driver.c | 21 +++-- src/esx/esx_network_driver.c | 3 +-- src/esx/esx_storage_backend_vmfs.c | 3 +-- src/esx/esx_util.c

[PATCH 22/27] vbox: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/vbox/vbox_snapshot_conf.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 6dbd18d657

[PATCH 21/27] util: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/util/vircgroupv2devices.c| 13 - src/util/vircommand.c| 3 +-- src/util/virfile.c | 3 +-- src/util/virhostcpu.c| 3

[PATCH 26/27] src: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/libvirt-domain.c | 54 +++- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c

[PATCH 15/27] remote: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/remote/remote_daemon.c | 3 +-- src/remote/remote_driver.c | 27 +-- src/remote/remote_sockets.c | 3 +-- 3 files changed, 11 insertions(+), 22

[PATCH 25/27] vz: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/vz/vz_driver.c | 15 ++--- src/vz/vz_sdk.c| 135 +++-- src/vz/vz_utils.c | 66 -- 3 files changed, 72

[PATCH 12/27] nwfilter: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/nwfilter/nwfilter_dhcpsnoop.c | 12 src/nwfilter/nwfilter_learnipaddr.c | 8 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/nwfilter

[PATCH 20/27] test: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/test/test_driver.c | 39 +-- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c

[PATCH 13/27] openvz: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/openvz/openvz_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 69e4c9899b..1bd96dfb56

[PATCH 24/27] vmx: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/vmx/vmx.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 5c6925be22..26b89776e1 100644 --- a/src

[PATCH 17/27] security: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/security/security_dac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 20e0998fbc

[PATCH 19/27] storage_file: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/storage_file/storage_source.c | 3 +- .../storage_source_backingstore.c | 36 +++ 2 files changed, 13 insertions(+), 26 deletions

[PATCH 10/27] network: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 14 -- src/network/bridge_driver_linux.c | 10 +- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/network

[PATCH 09/27] lxc: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/lxc/lxc_container.c | 3 +-- src/lxc/lxc_driver.c| 3 +-- src/lxc/lxc_native.c| 3 +-- src/lxc/lxc_process.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions

[PATCH 07/27] libxl: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/libxl/libxl_conf.c | 12 src/libxl/libxl_driver.c| 6 ++ src/libxl/libxl_migration.c | 11 --- 3 files changed, 10 insertions(+), 19 deletions

[PATCH 06/27] hypervisor: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/hypervisor/domain_cgroup.c | 3 +-- src/hypervisor/virhostdev.c| 9 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hypervisor/domain_cgroup.c b

[PATCH 02/27] ch: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/ch/ch_driver.c | 3 +-- src/ch/ch_monitor.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c index 45cdbfd37c

[PATCH 01/27] bhyve: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/bhyve/bhyve_command.c | 31 ++- src/bhyve/bhyve_domain.c | 3 +-- src/bhyve/bhyve_driver.c | 3 +-- 3 files changed, 12 insertions(+), 25

[PATCH 04/27] cpu: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/cpu/cpu_x86.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index b9513e24d5..7a7f3b409d 100644 --- a/src/cpu

[PATCH 03/27] conf: Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/conf/cpu_conf.c | 9 +- src/conf/domain_addr.c | 3 +- src/conf/domain_conf.c | 138 +++ src/conf

[PATCH 00/27] Move error messages onto a single line

2023-08-25 Thread Michal Privoznik
This is inspired by the following discussion: https://listman.redhat.com/archives/libvir-list/2023-August/241361.html And ideally I'd present a green pipeline but for some reason, I can't: https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/981105262 But the problem is not with my code rathe

[PATCH 5/6] virMdevctlList: Don't check for !output

2023-08-24 Thread Michal Privoznik
cenario as 'no mdevs defined/active'. Signed-off-by: Michal Privoznik --- src/node_device/node_device_driver.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index ac50c96837..a59cd0875d 100644 --- a/s

[PATCH 6/6] virjsontest: Introduce a test case for an empty array

2023-08-24 Thread Michal Privoznik
Previous commits were all about empty strings and empty JSON arrays. Introduce a test case for "[]" to make sure we pare it correctly. Signed-off-by: Michal Privoznik --- tests/virjsontest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/virjsontest.c b/tests/virjsonte

[PATCH 4/6] node_device_driver: Deduplicate mediated devices listing

2023-08-24 Thread Michal Privoznik
then just passed to the cmd line builder function. Signed-off-by: Michal Privoznik --- src/node_device/node_device_driver.c | 30 ++-- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c

[PATCH 2/6] nodeDeviceParseMdevctlJSON: Accept empty string

2023-08-24 Thread Michal Privoznik
reat them the same, i.e. as no mediated devices. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/523 Signed-off-by: Michal Privoznik --- src/node_device/node_device_driver.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de

[PATCH 1/6] nodedevmdevctltest: Rename mdevctl-list-empty test case

2023-08-24 Thread Michal Privoznik
mpty-array" which is more descriptive and also frees up slot for actual empty output (handled in next commits). Signed-off-by: Michal Privoznik --- .../{mdevctl-list-empty.json => mdevctl-list-empty-array.json} | 0 ...vctl-list-empty.out.xml => mdevctl-list-empty-array.out.

[PATCH 3/6] nodedevmdevctltest: Introduce a test case for empty mdevctl output

2023-08-24 Thread Michal Privoznik
As explained earlier, 'mdevctl' can output nothing. Add a test case to nodedevmdevctltest which covers this situation. Signed-off-by: Michal Privoznik --- tests/nodedevmdevctldata/mdevctl-list-empty.json| 0 tests/nodedevmdevctldata/mdevctl-list-empty.out.xml | 0 tests/nodedevmde

[PATCH 0/6] Fix one corner case when parsing 'mdevctl' output

2023-08-24 Thread Michal Privoznik
See 2/6 for explanation. Michal Prívozník (6): nodedevmdevctltest: Rename mdevctl-list-empty test case nodeDeviceParseMdevctlJSON: Accept empty string nodedevmdevctltest: Introduce a test case for empty mdevctl output node_device_driver: Deduplicate mediated devices listing virMdevctlLis

[PATCH v2 0/5] Improve closing of FDs for child processes

2023-08-22 Thread Michal Privoznik
This is a v2 of: https://listman.redhat.com/archives/libvir-list/2023-June/240351.html Hopefully, I've implemented all Dan's suggestions. Michal Prívozník (5): virfile: Introduce virCloseRange() virfile: Introduce virCloseFrom() vircommand: Unify mass FD closing vircommand: Introduce vir

  1   2   3   4   5   6   7   8   9   10   >