[PATCH] virhostmem: Get total memory on macOS properly

2023-11-06 Thread Michal Privoznik
oslav Suchanek Signed-off-by: Michal Privoznik --- src/util/virhostmem.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c index 1da2759ac3..a7027af835 100644 --- a/src/util/virhostmem.c +++ b/src/util/virhostmem.c @@ -617,7 +6

[PATCH 0/5] conf: Check for dimm/nvimm address conflicts too

2023-11-06 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (5): domain_validate: Move memdevice address conflict check into a separate function qemuxml2argvdata: Extend memory-hotplug-virtio-mem-overlap-address.xml virDomainMemoryDefCheckConflict: Check dimm & nvdimm models too virDomainMemoryDefCheckConflic

[PATCH] virhostmem: Get total memory on macOS properly

2023-11-06 Thread Michal Privoznik
oslav Suchanek Signed-off-by: Michal Privoznik --- src/util/virhostmem.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c index 1da2759ac3..a7027af835 100644 --- a/src/util/virhostmem.c +++ b/src/util/virhostmem.c @@ -617,7 +6

[PATCH 2/5] qemuxml2argvdata: Extend memory-hotplug-virtio-mem-overlap-address.xml

2023-11-06 Thread Michal Privoznik
. Signed-off-by: Michal Privoznik --- ...ory-hotplug-virtio-mem-overlap-address.xml | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem-overlap-address.xml b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem-overlap

[PATCH 1/5] domain_validate: Move memdevice address conflict check into a separate function

2023-11-06 Thread Michal Privoznik
At the end of virDomainMemoryDefValidate() there's a code that checks whether two virtio-mem/virtio-pmem devices don't overlap. Separate this code into its own function (virDomainMemoryDefCheckConflict()). Signed-off-by: Michal Privoznik --- src/conf/domain_valida

[PATCH 3/5] virDomainMemoryDefCheckConflict: Check dimm & nvdimm models too

2023-11-06 Thread Michal Privoznik
x27;s expected since it can't have any address (see virDomainMemoryDefValidate()). Resolves: https://issues.redhat.com/browse/RHEL-4452 Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 12 ++-- ...plug-virtio-mem-overlap-address.x86_64-latest.err

[PATCH 4/5] virDomainMemoryDefCheckConflict: Validate dimm slot too

2023-11-06 Thread Michal Privoznik
Since we're iterating over def->mems array, might as well check for dimm slot duplicates. Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 36 +++- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/conf/domain_validate

[PATCH 5/5] qemu_domain: Drop qemuCheckMemoryDimmConflict()

2023-11-06 Thread Michal Privoznik
The virDomainMemoryDefCheckConflict() already does the same set of checks. There's no need to duplicate them. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 37 - 1 file changed, 37 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src

[PATCH 3/3] NEWS: Document pipewire audio backend

2023-11-07 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 08e5a3d04a..f73dd867d5 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,16 @@ v9.10.0 (unreleased) * **New features** + * Introduce pipewire audio backend

[PATCH 2/3] qemu: Generate cmd line for pipewire audio backend

2023-11-07 Thread Michal Privoznik
tween various locations and is derived from various environment variables (just like the actual socket name) and thus we must pass the variables to QEMU. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/560 Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c

[PATCH 0/3] Introduce pipewire audio backend

2023-11-07 Thread Michal Privoznik
This is a resend of patches from earlier: https://listman.redhat.com/archives/libvir-list/2023-May/239860.html Apparently, users want this now. Michal Prívozník (3): conf: Introduce pipewire audio backend qemu: Generate cmd line for pipewire audio backend NEWS: Document pipewire audio back

[PATCH 1/3] conf: Introduce pipewire audio backend

2023-11-07 Thread Michal Privoznik
o/pipewire/. Signed-off-by: Michal Privoznik --- docs/formatdomain.rst | 35 +- src/conf/domain_conf.c| 70 +++ src/conf/domain_conf.h| 12 src/conf/schemas/domaincommon.rng | 37 +

[PATCH 1/6] vbox_snapshot_conf: Parse XMLs without net access

2023-11-21 Thread Michal Privoznik
mask: xmlParseInNodeContext(..., options = 0, ...); This is potentially dangerous. Signed-off-by: Michal Privoznik --- src/vbox/vbox_snapshot_conf.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 84f7a

[PATCH 3/6] virxml: include for xmlIndentTreeOutput declaration

2023-11-21 Thread Michal Privoznik
After libxml2's commit of v2.12.0~101 we no longer get xmlIndentTreeOutput declaration by us including just libxml/xpathInternals.h and libxml2's header files leakage. Resolves: https://bugs.gentoo.org/917516 Signed-off-by: Michal Privoznik --- src/util/virxml.c | 1 + 1 file

[PATCH 0/6] Adapt to libxml2-2.12.0

2023-11-21 Thread Michal Privoznik
There is a new release of libxml2 and we have a technical debt we need to address before we can compile with it cleanly. Michal Prívozník (6): vbox_snapshot_conf: Parse XMLs without net access vbox_snapshot_conf: Keep indent in snapshot XML virxml: include for xmlIndentTreeOutput declaratio

[PATCH 2/6] vbox_snapshot_conf: Keep indent in snapshot XML

2023-11-21 Thread Michal Privoznik
). Signed-off-by: Michal Privoznik --- src/vbox/vbox_snapshot_conf.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 467255f77f..9a10b08c3c 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src

[PATCH 4/6] virXMLParseHelper: Store XML parsing flags in a variable

2023-11-21 Thread Michal Privoznik
The virXMLParseHelper() can work in two modes: either it parses a file or a string. Either way, the same set of flags is specified in call of corresponding function. Save flags in a local variable instead. Signed-off-by: Michal Privoznik --- src/util/virxml.c | 10 -- 1 file changed, 4

[PATCH 6/6] lib: Replace xmlKeepBlanksDefault() with virXMLParseWithIndent()

2023-11-21 Thread Michal Privoznik
Now that we have virXMLParseWithIndent() and virXMLParseStringCtxtWithIndent(), we can use them directly and drop calls to xmlKeepBlanksDefault(). Signed-off-by: Michal Privoznik --- src/conf/backup_conf.c | 8 +++- src/conf/checkpoint_conf.c | 8 +++- src/conf/domain_conf.c

[PATCH 5/6] virxml: Introduce parsing APIs that keep indentation

2023-11-21 Thread Michal Privoznik
. Therefore, introduce virXMLParse...WithIndent() variants which would do exactly xmlKeepBlanksDefault() did but with non-deprecated APIs. Signed-off-by: Michal Privoznik --- src/util/virxml.c | 15 +-- src/util/virxml.h | 29 + 2 files changed, 38 insertions

[PATCH 2/2] nwfilterxml2firewalltest: Use virqsortmock for stable sorting

2023-11-22 Thread Michal Privoznik
ebiptablesApplyNewRules() does, it calls qsort() to sort the rules. But with new glibc, qsort() is not stable anymore and thus the order in which two rules with equal priorities are applied is not guaranteed. Use qsort() from virqsortmock which produces stable results. Signed-off-by: Michal Privoznik

[PATCH 0/2] Adapt to glibc qsort() turned unstable

2023-11-22 Thread Michal Privoznik
glibc reworked qsort() which now uses an unstable sorting algorithm. This is causing issues to our tests (see broken pipeline for rawhide). Green pipeline: https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/1081297468 Michal Prívozník (2): tests: Introduce virqsortmock nwfilterxml2firewa

[PATCH 1/2] tests: Introduce virqsortmock

2023-11-22 Thread Michal Privoznik
;a=commitdiff;h=03bf8357e8291857a435afcc3048e0b697b6cc04 Signed-off-by: Michal Privoznik --- tests/meson.build| 1 + tests/virqsortmock.c | 58 2 files changed, 59 insertions(+) create mode 100644 tests/virqsortmock.c diff --git a/tests/meson.build b/tests/meson.build index e1cd576

[PATCH 0/3] lib: Replace qsort() with g_qsort_with_data()

2023-11-23 Thread Michal Privoznik
Technically, this is a v2 of: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/GBTHE3V6AYHCMBI5BI2BVTCAYOA4HFFX/ but it implements a different approach, so I'm sending it anew. Michal Prívozník (3): build-aux: Refresh list of nonreentrant functions lib: Replace qsort()

[PATCH 1/3] build-aux: Refresh list of nonreentrant functions

2023-11-23 Thread Michal Privoznik
There's a new twalk() function that has a reentrant variant. Add the former onto list of nonreentrant functions. Also, refresh the comment on how to get the list, because it's outdated a bit. Signed-off-by: Michal Privoznik --- build-aux/Makefile.nonreentrant | 19 ++---

[PATCH 3/3] syntax-check: Forbid use of qsort()

2023-11-23 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- build-aux/syntax-check.mk | 7 +++ tools/nss/libvirt_nss.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 309ca0c29a..462bff72f8 100644 --- a/build-aux/syntax-check.mk

[PATCH 2/3] lib: Replace qsort() with g_qsort_with_data()

2023-11-23 Thread Michal Privoznik
7a435afcc3048e0b697b6cc04 Signed-off-by: Michal Privoznik --- build-aux/Makefile.nonreentrant | 3 +-- build-aux/syntax-check.mk | 2 +- src/conf/capabilities.c | 8 --- src/conf/domain_conf.c| 6 +++-- src/cpu/cpu.c

[PATCH] virnuma: Avoid integer overflow in virNumaGetPages()

2023-11-24 Thread Michal Privoznik
t.com/browse/RHEL-16749 Signed-off-by: Michal Privoznik --- src/util/virnuma.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 5053a70c61..9393c20875 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -787,9 +

[PATCH v2 1/3] conf: Introduce pipewire audio backend

2023-11-24 Thread Michal Privoznik
o/pipewire/. There's one ley difference to PA though: pipewire daemon is usually on per user basis (just like our qemu:///session). Therefore, introduce this 'runtimeDir' attribute, which allows specifying path to pipewire daemon socket (useful for qemu:///system for instance). Signed

[PATCH v2 3/3] NEWS: Document pipewire audio backend

2023-11-24 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 08e5a3d04a..f12734c2a1 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,11 @@ v9.10.0 (unreleased) * **New features** + * Introduce pipewire audio backend

[PATCH v2 0/3] Introduce pipewire audio backend

2023-11-24 Thread Michal Privoznik
v2 of: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/4M7OBHJEYCXPJ7DJK2ZEQFNDCT25CK77/ diff to v1: - Introduced 'runtimeDir' attribute to so that users do not have use hack to set PIPEWIRE_RUNTIME_DIR. - Worked in the rest of Peter's review suggestions. Michal Prívoz

[PATCH v2 2/3] qemu: Generate cmd line for pipewire audio backend

2023-11-24 Thread Michal Privoznik
tween various locations and is derived from various environment variables (just like the actual socket name) and thus we must pass the variables to QEMU. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/560 Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c

[PATCH 0/4] A bunch of trivial fixes

2023-11-28 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (4): virpci: Decrease scope of VIR_PF_PHYS_PORT_NAME_REGEX macro qemu_command: Don't open code virPCIDeviceAddressAsString() vircpi: Decrease scope of VIR_PCI_DEVICE_ADDRESS_FMT macro ch: Don't leak ch_driver->chCaps src/ch/ch_driver.c | 5 +++--

[PATCH 1/4] virpci: Decrease scope of VIR_PF_PHYS_PORT_NAME_REGEX macro

2023-11-28 Thread Michal Privoznik
The VIR_PF_PHYS_PORT_NAME_REGEX macro is used only in virPCIGetNetName() and nowhere else. It's not necessary to expose it in the header file. Signed-off-by: Michal Privoznik --- src/util/virpci.c | 8 src/util/virpci.h | 5 - 2 files changed, 8 insertions(+), 5 deletions(-)

[PATCH 3/4] vircpi: Decrease scope of VIR_PCI_DEVICE_ADDRESS_FMT macro

2023-11-28 Thread Michal Privoznik
The VIR_PCI_DEVICE_ADDRESS_FMT macro is used only in virpci.c and nowhere else. It's not necessary to expose it in the header file. Signed-off-by: Michal Privoznik --- src/util/virpci.c | 1 + src/util/virpci.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src

[PATCH 4/4] ch: Don't leak ch_driver->chCaps

2023-11-28 Thread Michal Privoznik
er of that in chStateInitialize() so that it's easier to spot missing free/unref call. Signed-off-by: Michal Privoznik --- src/ch/ch_driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c index bd271fc0ee..96de5044ac 100644 --

[PATCH 2/4] qemu_command: Don't open code virPCIDeviceAddressAsString()

2023-11-28 Thread Michal Privoznik
When building a hostdev props, its PCI address is formatted via g_strdup_printf(VIR_PCI_DEVICE_ADDRESS_FMT, ...); Well, we have a function that does exactly that: virPCIDeviceAddressAsString(). Us the latter. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 6 +- 1 file changed

[PATCH 0/2] rpcgen: tests: Improve on funky platforms

2023-11-29 Thread Michal Privoznik
At least the second patch should be merged before the release so that Jirka can do the release cleanly. Michal Prívozník (2): rpcgen: tests: Allow running test_demo from anywhere rpcgen: tests: Run cleanly on platforms where char is unsigned scripts/rpcgen/tests/meson.build |

[PATCH 1/2] rpcgen: tests: Allow running test_demo from anywhere

2023-11-29 Thread Michal Privoznik
rcdir' macro and prefix the path with it. Signed-off-by: Michal Privoznik --- scripts/rpcgen/tests/meson.build | 4 +++- scripts/rpcgen/tests/test_demo.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/rpcgen/tests/meson.build b/scripts/rpcgen/tests/meson.b

[PATCH 2/2] rpcgen: tests: Run cleanly on platforms where char is unsigned

2023-11-29 Thread Michal Privoznik
435d1e0;hb=HEAD#l487 Reported-by: Boris Fiuczynski Signed-off-by: Michal Privoznik --- scripts/rpcgen/tests/test_demo.c | 2 +- .../tests/test_demo_struct_fixed_array.bin| Bin 136 -> 136 bytes .../tests/test_demo_struct_pointer_set.bin| Bin 12 -> 12 by

[PATCH 0/2] qemu: Relax check for memory device coldplug

2023-12-05 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): qemu: Move memory device coldplug into a separate function qemu: Relax check for memory device coldplug src/qemu/qemu_driver.c | 45 -- 1 file changed, 35 insertions(+), 10 deletions(-) -- 2.41.0 _

[PATCH 2/2] qemu: Relax check for memory device coldplug

2023-12-05 Thread Michal Privoznik
X_EPC are attached into PCI bus, or no bus at all. Resolves: https://issues.redhat.com/browse/RHEL-15480 Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_dri

[PATCH 1/2] qemu: Move memory device coldplug into a separate function

2023-12-05 Thread Michal Privoznik
function accept a double pointer to the memory device definition to make the ownership transfer obvious (the device is part of the domain on successful run). Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions

[PATCH 2/2] qemuDomainChangeNet: Reflect trustGuestRxFilters change

2023-12-05 Thread Michal Privoznik
On device-update, when user requests change of trustGuestRxFilters we currently do nothing. Nor error out, nor act on the request. While we can just throw an error, implementing this is pretty trivial. Resolves: https://issues.redhat.com/browse/RHEL-735 Signed-off-by: Michal Privoznik --- src

[PATCH 1/2] qemuMonitorJSONQueryRxFilter: Allow @filter to be NULL

2023-12-05 Thread Michal Privoznik
Sometimes it may be handy to just issue the query-rx-filter monitor command without actually parsing the output. Adapt qemuMonitorJSONQueryRxFilter() to this behavior. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 12 src/qemu/qemu_monitor_json.c | 3 ++- 2

[PATCH 0/2] qemuDomainChangeNet: Reflect trustGuestRxFilters change

2023-12-05 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): qemuMonitorJSONQueryRxFilter: Allow @filter to be NULL qemuDomainChangeNet: Reflect trustGuestRxFilters change src/qemu/qemu_hotplug.c | 51 src/qemu/qemu_monitor.c | 12 + src/qemu/qemu_monitor_j

[PATCH 0/3] Allow reserving more memory for PCI controllers

2023-12-08 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): conf: Introduce @memReserve to qemu_validate: Restrict setting @memReserve only to some controllers qemu_command: Generate mem-reserve for controllers docs/formatdomain.rst | 6 + src/conf/domain_conf.c

[PATCH 1/3] conf: Introduce @memReserve to

2023-12-08 Thread Michal Privoznik
value computed by FW and thus allow hot plug of such PCI devices. Signed-off-by: Michal Privoznik --- docs/formatdomain.rst | 6 ++ src/conf/domain_conf.c | 9 + src/conf/domain_conf.h | 3 +++ src/conf/sc

[PATCH 2/3] qemu_validate: Restrict setting @memReserve only to some controllers

2023-12-08 Thread Michal Privoznik
Only two controller models allow setting mem-reserve: pcie-root-port and pci-bridge. Reflect this fact during validation. Signed-off-by: Michal Privoznik --- src/qemu/qemu_validate.c | 25 + 1 file changed, 25 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src

[PATCH 3/3] qemu_command: Generate mem-reserve for controllers

2023-12-08 Thread Michal Privoznik
Pretty straightforward. Just put mem-reserve attribute whenever it's set. Previous commit ensures it's set only for valid controller models. Resolves: https://issues.redhat.com/browse/RHEL-7461 Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c| 3

[PATCH 0/2] qemu: Drop support for virtiofsd written in C and modernize cmd line

2023-12-12 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): qemu: Drop support for C implementation of virtiofsd qemu_virtiofs: Don't use deprecated cmd line src/qemu/qemu_validate.c | 6 src/qemu/qemu_virtiofs.c | 33 +++ .../vhost-user-fs-fd-mem

[PATCH 1/2] qemu: Drop support for C implementation of virtiofsd

2023-12-12 Thread Michal Privoznik
locking) and there's no way to make them work for both implementations. Remove support for the C implementation. Signed-off-by: Michal Privoznik --- src/qemu/qemu_validate.c | 6 ++ src/qemu/qemu_virtiofs.c | 14 --

[PATCH 2/2] qemu_virtiofs: Don't use deprecated cmd line

2023-12-12 Thread Michal Privoznik
Rust implementation has deprecated use if "-o option1,option2" in favor of "--option1" "--option2". Actually, they did so quite while ago and continued using the old way only for backwards compatibility. Use "modern" way. Resolves: https://issues.redhat.co

[PATCH 1/2] ci: integration: Switch upstream integration tests to Fedora 39

2023-12-14 Thread Michal Privoznik
Currently, Fedora 37 and 38 is used. The former is now EOL since there's new release. Switch 37 to 39 then. Signed-off-by: Michal Privoznik --- ci/integration.yml | 80 +++--- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git

[PATCH 0/2] ci: Update to Fedora 39

2023-12-14 Thread Michal Privoznik
Green pipeline: https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/1106643445 Michal Prívozník (2): ci: integration: Switch upstream integration tests to Fedora 39 ci: Update Alpine and Fedora and regenerate ci/buildenv/{alpine-317.sh => alpine-319.sh} | 0 ci/buildenv/{fedora-37.sh =

[PATCH 2/2] ci: Update Alpine and Fedora and regenerate

2023-12-14 Thread Michal Privoznik
New Alpine and Fedora releases were added to libvirt-ci (3.19 and 39, respectively) and old ones were removed. Update the manifest file and regenerate the rest. Signed-off-by: Michal Privoznik --- ci/buildenv/{alpine-317.sh => alpine-319.sh} | 0 ci/buildenv/{fedora-37.sh => fedora

[PATCH 0/4] vmx: A couple of disk related fixes

2023-12-15 Thread Michal Privoznik
The first patch fixes an issue. The last one - I am not sure if it's not going to break something and thus it's optional. Michal Prívozník (4): vmx: Accept empty fileName for cdrom-image vmx2xmltest: Add another test case vmx: Separate disk target name generation into a function vmx: Ensur

[PATCH 1/4] vmx: Accept empty fileName for cdrom-image

2023-12-15 Thread Michal Privoznik
me. Resolves: https://issues.redhat.com/browse/RHEL-19380 Signed-off-by: Michal Privoznik --- src/vmx/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 26b89776e1..af1c1640ae 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2483,7 +2483,

[PATCH 3/4] vmx: Separate disk target name generation into a function

2023-12-15 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/vmx/vmx.c | 175 +++--- 1 file changed, 110 insertions(+), 65 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index af1c1640ae..399f03b419 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2136,6

[PATCH 2/4] vmx2xmltest: Add another test case

2023-12-15 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- tests/vmx2xmldata/esx-in-the-wild-12.vmx | 86 tests/vmx2xmldata/esx-in-the-wild-12.xml | 39 +++ tests/vmx2xmltest.c | 1 + 3 files changed, 126 insertions(+) create mode 100644 tests/vmx2xmldata/esx-in

[PATCH 4/4] vmx: Ensure unique disk targets when parsing

2023-12-15 Thread Michal Privoznik
.0 both end up with the same "sda" target name. And because of the way their drive address is derived, they end up with the same address too. Try harder to generate an unique disk target. Signed-off-by: Michal Privoznik --- src/vmx/vmx.c

[PATCH] ci: Switch from FreeBSD 12.0 to FreeBSD 14.0

2024-01-03 Thread Michal Privoznik
FreeBSD 12.0 is no longer supported since 14.0 is out. Change the CI manifest and refresh the rest. Signed-off-by: Michal Privoznik --- .../{freebsd-12.vars => freebsd-14.vars} | 0 ci/gitlab/builds.yml | 28 +-- ci/manifest.

[PATCH] conf: Restore setting default bus for input devices

2024-01-03 Thread Michal Privoznik
: c4bc4d3b82fbe22e03c986ca896090f481df5c10 Signed-off-by: Michal Privoznik --- src/conf/domain_postparse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c index e79913b73f..ed9411f5e6 100644 --- a/src/conf/domain_postparse.c +++ b/src

[PATCH 0/4] Introduce dynamicMemslots attribute for virtio-mem

2024-01-04 Thread Michal Privoznik
I couldn't decide whether the new attribute should be in or element. I went with the former, but if anybody feels I should have went with the latter then I can change it. Michal Prívozník (4): conf: Introduce dynamicMemslots attribute for virtio-mem qemu_capabilities: Add QEMU_CAPS_DEVIC

[PATCH 1/4] conf: Introduce dynamicMemslots attribute for virtio-mem

2024-01-04 Thread Michal Privoznik
, introduce new attribute which will control that QEMU knob. Signed-off-by: Michal Privoznik --- docs/formatdomain.rst | 6 ++ src/conf/domain_conf.c | 18 +- src/conf/domain_conf.h | 1 + src/conf/schemas

[PATCH 2/4] qemu_capabilities: Add QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS capability

2024-01-04 Thread Michal Privoznik
Starting from v8.2.0-rc0~74^2~2 QEMU has .dynamic-memslots attribute for virtio-mem-pci device. Introduce a capability which reflects that. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests

[PATCH 3/4] qemu_validate: Check capability for virtio-mem dynamicMemslots

2024-01-04 Thread Michal Privoznik
The QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS reflects whether QEMU is capable of .dynamic-memslots for virtio-mem. Use it when validating domain configuration. Signed-off-by: Michal Privoznik --- src/qemu/qemu_validate.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src

[PATCH 4/4] qemu_command: Generate cmd line for virtio-mem dynamicMemslots

2024-01-04 Thread Michal Privoznik
owse/RHEL-15316 Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 12 .../memory-hotplug-virtio-mem.x86_64-latest.args | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c i

[PATCH v2 0/4] Introduce dynamicMemslots attribute for virtio-mem

2024-01-05 Thread Michal Privoznik
v2 of: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/MWYGWDC7D7DOQCZ6CLSIRYRNAFNS3OGQ/ diff to v1: - Don't set .unplugged-inaccessible because it's not compatible with !x84_64 and even on x86_64 it's likely to get deprecated soon. Thanks David for pointing this out!

[PATCH v2 1/4] conf: Introduce dynamicMemslots attribute for virtio-mem

2024-01-05 Thread Michal Privoznik
, introduce new attribute which will control that QEMU knob. Signed-off-by: Michal Privoznik --- docs/formatdomain.rst | 6 ++ src/conf/domain_conf.c | 18 +- src/conf/domain_conf.h | 1 + src/conf/schemas

[PATCH v2 2/4] qemu_capabilities: Add QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS capability

2024-01-05 Thread Michal Privoznik
Starting from v8.2.0-rc0~74^2~2 QEMU has .dynamic-memslots attribute for virtio-mem-pci device. Introduce a capability which reflects that. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests

[PATCH v2 3/4] qemu_validate: Check capability for virtio-mem dynamicMemslots

2024-01-05 Thread Michal Privoznik
The QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS reflects whether QEMU is capable of .dynamic-memslots for virtio-mem. Use it when validating domain configuration. Signed-off-by: Michal Privoznik --- src/qemu/qemu_validate.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src

[PATCH v2 4/4] qemu_command: Generate cmd line for virtio-mem dynamicMemslots

2024-01-05 Thread Michal Privoznik
This is pretty straightforward. Resolves: https://issues.redhat.com/browse/RHEL-15316 Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c| 3 +++ .../memory-hotplug-virtio-mem.x86_64-latest.args | 2 +- 2 files changed, 4 insertions

[PATCH] qemu: Be less aggressive when dropping channel source paths

2024-01-09 Thread Michal Privoznik
5569 Resolves: https://issues.redhat.com/browse/RHEL-20807 Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c| 2 +- ...hannel-unix-source-path.x86_64-latest.args | 8 .../channel-unix-source-path.xml | 16 +++ ...-unix-source-path-active.x8

[PATCH] NEWS: Document my contributions for upcoming release

2024-01-12 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 27 +++ 1 file changed, 27 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index af3c4906df..e8cc89a2ee 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -55,6 +55,10 @@ v10.0.0 (unreleased) Libvirt aleviates this by automatically

[PATCH] domain_validate: Check for domain address conflicts fully

2024-01-19 Thread Michal Privoznik
shly parsed memory device does not fall into range of already existing memory device. Resolves: https://issues.redhat.com/browse/RHEL-4452 Signed-off-by: Michal Privoznik --- src/conf/domain_validate.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf/dom

[PATCH] qemu_process: Skip over non-virtio NIC models when refreshing rx-filter

2024-01-25 Thread Michal Privoznik
: 060d4c83ef436cf56abfad51a4d64c39448e199d Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3563ad215c..a736846588 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c

[PATCH v2 0/2] qemu_process: Skip over non-virtio non-TAP NIC models when refreshing rx-filter

2024-01-25 Thread Michal Privoznik
This was reported here: https://lists.libvirt.org/archives/list/us...@lists.libvirt.org/thread/QZ43KUTWO5UY2FLC5BMKKHA7CCCKJ3HI/ and v1 was posted here: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/AVRYA5W3TKYKRPHRCI7VRMELAKHZC5NN/ diff to v1: - Expanded commit message

[PATCH v2 1/2] qemu_process: Skip over non-virtio non-TAP NIC models when refreshing rx-filter

2024-01-25 Thread Michal Privoznik
: 060d4c83ef436cf56abfad51a4d64c39448e199d Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3563ad215c..c1115b440f 100644 --- a/src/qemu/qemu_process.c +++ b/src

[PATCH v2 2/2] NEWS: Document recent rx-filter bugfix

2024-01-25 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 9 + 1 file changed, 9 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 4c79fe..e2796fd8b2 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -27,6 +27,15 @@ v10.1.0 (unreleased) * **Bug fixes** + * qemu_process: Skip over non-virtio non

[PATCH] qemu_hotplug: Don't lose 'created' flag in qemuDomainChangeNet()

2024-01-25 Thread Michal Privoznik
d (see loop inside of qemuProcessStop()). Copy this flag into new definition and leave a note in _qemuDomainNetworkPrivate struct. Fixes: 61d1b9e6592660121aeda66bf7adbcd39de06aa8 Resolves: https://issues.redhat.com/browse/RHEL-22714 Signed-off-by: Michal Privoznik --- I also contemplated idea of preserv

[PATCH] remote_driver: Restore special behavior of remoteDomainGetBlockIoTune()

2024-01-29 Thread Michal Privoznik
(so that client can allocate memory and call the API second time). IOW - the usual, old style of APIs where we didn't want to allocate memory on caller's behalf. But because of this bug, a negative one is returned instead. Fixes: 501825011c1fe80f458820c7efe5a198e0af9be5 Signed-off-

[PATCH 0/5] A couple of virsocket related cleanups

2024-02-02 Thread Michal Privoznik
After I've merged some patches mingw fails to build. The first patch fixes the issue, and the rest is just a cleanup. Michal Prívozník (5): virsocket: Drop unused #include and #define virSocketSendMsgWithFDs: Don't report errors, just set errno virSocketSendMsgWithFDs: Introduce @payload_len

[PATCH 1/5] virsocket: Drop unused #include and #define

2024-02-02 Thread Michal Privoznik
Inside of virsocket.c there is an include of poll.h and PKT_TIMEOUT_MS macro definition. Neither of these is really needed and in fact it's a leftover after I reworked one of previously merged commits during review. Signed-off-by: Michal Privoznik --- src/util/virsocket.c | 3 --- 1

[PATCH 4/5] virsocket: Simplify virSocketSendFD()

2024-02-02 Thread Michal Privoznik
After previous cleanups, virSocketSendFD() is but a thin wrapper over virSocketSendMsgWithFDs(). Replace the body of the former with a call to the latter. Signed-off-by: Michal Privoznik --- src/util/virsocket.c | 28 +++- 1 file changed, 3 insertions(+), 25 deletions

[PATCH 5/5] qemu_monitor: Simplify qemuMonitorIOWriteWithFD()

2024-02-02 Thread Michal Privoznik
After previous cleanups, qemuMonitorIOWriteWithFD() is but a thin wrapper over virSocketSendMsgWithFDs(). Replace the body of the former with a call to the latter. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 27 ++- 1 file changed, 2 insertions(+), 25

[PATCH 2/5] virSocketSendMsgWithFDs: Don't report errors, just set errno

2024-02-02 Thread Michal Privoznik
few lines above. The motivation is to unify behavior of virSocketSendMsgWithFDs() and virSocketSendFD() because the latter is just a subset of the former (will be addressed later). Signed-off-by: Michal Privoznik --- po/POTFILES | 1 - src/ch/ch_process.c | 6 -- src/util

[PATCH 3/5] virSocketSendMsgWithFDs: Introduce @payload_len argument

2024-02-02 Thread Michal Privoznik
Instead of using strlen() to calculate length of payload we're sending, let caller specify the size: they may want to send just a portion of a buffer (even though the only current user doesn't). Signed-off-by: Michal Privoznik --- src/ch/ch_process.c | 5 - src/util/virsoc

[PATCH 0/2] A couple of trivial patches

2024-02-07 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): virsh-domain: Fix return of virshGetDBusDisplay() in one error path examples: Define _GNU_SOURCE for more examples examples/c/admin/logging.c | 1 + examples/c/domain/domtop.c | 1 + tools/virsh-domain.c | 2 +- 3 files changed, 3 insertions(+),

[PATCH 1/2] virsh-domain: Fix return of virshGetDBusDisplay() in one error path

2024-02-07 Thread Michal Privoznik
The virshGetDBusDisplay() function is declared to return a pointer and yet, in one error path false is returned. Switch the statement to return NULL, which is what other error paths use to indicate an error. Signed-off-by: Michal Privoznik --- tools/virsh-domain.c | 2 +- 1 file changed, 1

[PATCH 2/2] examples: Define _GNU_SOURCE for more examples

2024-02-07 Thread Michal Privoznik
declared in meson-config.h). Signed-off-by: Michal Privoznik --- examples/c/admin/logging.c | 1 + examples/c/domain/domtop.c | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/c/admin/logging.c b/examples/c/admin/logging.c index 575d15a3a6..f7620b2ab5 100644 --- a/examples/c/admin

[PATCH 0/4] secret: Modernize XML parsing and formatting

2024-02-13 Thread Michal Privoznik
Couple of things happening here: 1) add a missing case to our polkit checks 2) modernize XML parsing and formatting, so that the code is prepared for a new feature I'm working on. Michal Prívozník (4): viraccessdriverpolkit: Add missing vtpm case secret_conf: Simplify calling of virSecretDe

[PATCH 1/4] viraccessdriverpolkit: Add missing vtpm case

2024-02-13 Thread Michal Privoznik
When adding vtpm virSecret usage type (in v5.6.0-rc1~61) we forgot to update polkit access check. This limited user's ability to match secrets in their rules. Add missing case into switch in virAccessDriverPolkitCheckSecret(). Signed-off-by: Michal Privoznik --- src/a

[PATCH 3/4] virSecretDef: Convert 'usage_type' field to proper enum type

2024-02-13 Thread Michal Privoznik
Convert the field and adjust the XML parsers to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/access/viraccessdriverpolkit.c | 4 src/conf/secret_conf.c | 24 src/conf/secret_conf.h | 2 +- 3 files changed, 13 insertions

[PATCH 2/4] secret_conf: Simplify calling of virSecretDefParseUsage()

2024-02-13 Thread Michal Privoznik
The virSecretDefParseUsage() function is called conditionally. Call it unconditionally and keep pointer to the node as it'll come handy soon. Signed-off-by: Michal Privoznik --- src/conf/secret_conf.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --

[PATCH 4/4] secret_conf: Modernize XML parsing & formatting

2024-02-13 Thread Michal Privoznik
Our virSecret XML is still parsed and formatted using old way (e.g. virXPathString() + virXXXTypeFromString() combo, or formatting elements using plain virBufferAsprintf() instead of virXMLFormatElement()). Modernize the code as it'll make it easier for future expansion. Signed-off-by: M

[PATCH 0/4] Protect secret values stored on disk with TPM

2024-02-13 Thread Michal Privoznik
Secret values are stored effectively in plaintext on a disk and we rely on file perms to secure them. But with systemd-cred we can use system's TPM chip and encrypt them. Such secrets won't be transferable to another system by simply copying files stored on disk, but: a) that's not recommended way

[PATCH 1/4] virsecret: Introduce APIs to talk to systemd-cred

2024-02-13 Thread Michal Privoznik
ay to encrypt/decrypt plaintext using a key that's stored in host's TPM (when --with-key=tpm is passed). In addition, there's 'has-tpm2' command which allows us to detect whether host and the OS have everything needed to utilize the TPM. Signed-off-by: Michal Privoznik

[PATCH 2/4] conf: Introduce @tpm attribute to

2024-02-13 Thread Michal Privoznik
un, we can even encrypt secret values that are kept in memory (so they can't be obtained by dumping virtsecretd's memory). But that's not what is being implemented here. Signed-off-by: Michal Privoznik --- docs/formatsecret.rst| 8 ++-- src/conf/schemas/sec

[PATCH 3/4] virsecretobj: Encrypt/decrypt secrets using TPM

2024-02-13 Thread Michal Privoznik
ed). And since we can detect usability of host's TPM, let's do that when a virSecret is defined and TPM is requested. This avoids unpleasant surprises later on. Resolves: https://issues.redhat.com/browse/RHEL-7125 Signed-off-by: Michal Privoznik --- src

[PATCH 4/4] NEWS: Document new virSecret TPM feature

2024-02-13 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 15b0da31b6..9c0e4b4b65 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -30,6 +30,12 @@ v10.1.0 (unreleased) to resolve names of the connected guests using the name server

  1   2   3   4   5   6   >