[pushed][libvirt PATCH] Fix cpu-host-model test data

2023-11-24 Thread Tim Wiederhake
This was broken by the recent addition of vmx-* features. Signed-off-by: Tim Wiederhake --- .../cpu-host-model-fallback-kvm.x86_64-4.2.0.args | 2 +- .../cpu-host-model-fallback-kvm.x86_64-5.0.0.args | 2 +- .../cpu-host-model-fallback-kvm.x86_64-latest.args

[PATCH 0/7] storage_file_probe: Handle qcow2 images with 'protocol' driver name in 'backing file format' field (part 1 - the fix)

2023-11-24 Thread Peter Krempa
See 6/7 and 7/7 for the rationale. Further patches will be posted to refactor the rest of the parsers which are bitrotten. Peter Krempa (7): storage_file_probe: Remove unused state 'BACKING_STORE_ERROR' virStorageFileProbeGetMetadata: Do not partially skip probing of the image storage_fi

[PATCH 1/7] storage_file_probe: Remove unused state 'BACKING_STORE_ERROR'

2023-11-24 Thread Peter Krempa
None of the backing store parser functions actually use it. Remove it to avoid confusion. Signed-off-by: Peter Krempa --- src/storage_file/storage_file_probe.c | 4 1 file changed, 4 deletions(-) diff --git a/src/storage_file/storage_file_probe.c b/src/storage_file/storage_file_probe.c in

[PATCH 2/7] virStorageFileProbeGetMetadata: Do not partially skip probing of the image

2023-11-24 Thread Peter Krempa
Since we consider the failure of parsing the backing store to be actually success based on the value we return to the caller, we should continue parsing also features and the 'compat' field so that we don't have a partial definition if e.g. the backing store format is not known. Signed-off-by: Pet

[PATCH 3/7] storage_file_probe: Remove BACKING_STORE_OK,BACKING_STORE_INVALID states

2023-11-24 Thread Peter Krempa
Replace the return values by 0 because none of the callers care and some of the backing store parser functions return this state also in cases the rest of the code would consider as success. Subsequently the parsers will be refactored and proper error reporting returned. Signed-off-by: Peter Krem

[PATCH 4/7] virstoragetest: Use strings for storage type and format in output data

2023-11-24 Thread Peter Krempa
Make it easier for the humans to read/compare the outputs. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 8 tests/virstoragetestdata/out/directory-dir | 4 ++-- tests/virstoragetestdata/out/directory-none | 4 ++-- tests/vir

[PATCH 5/7] virstoragetest: Format detected/unprocessed backing store format into output files

2023-11-24 Thread Peter Krempa
Compare also the detected format of the backing file ('backingStoreRawFormat' field) into the outptu data for comparison with others. Since the ToString function can't convert VIR_STORAGE_FILE_AUTO use also the numeric value. Signed-off-by: Peter Krempa --- tests/virstoragetest.c

[PATCH 6/7] virstoragetest: Add test cases for QCOW2 files with a protocol name as backing file format

2023-11-24 Thread Peter Krempa
QEMU allows and in cases where you omit the not-strictly-needed 'raw' driver on top of raw images automatically uses the protocol name inside of the 'backing file format' field of the qcow2 image. Libvirt expects only format names in that field. Add example images showing this scenario, which wil

[PATCH 7/7] storage_file_probe: Treat qcow2 images with protocol drivers in backing store field as raw

2023-11-24 Thread Peter Krempa
qemu allows and in some cases uses protocol driver names ('file', 'host_device', 'nbd', ...) in the 'backing file format' field of a qcow to denote a image where the dummy 'raw' driver was not used on top. Adapt our backing store parser for such cases. The examples added in previous patch show the

[PATCH 01/17] qemu: block: Introduce qemuBlockStorageSourceGetSliceNodename

2023-11-24 Thread Peter Krempa
The helper retrieves the nodename of the slice layer if it's present. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 23 --- src/qemu/qemu_block.h | 3 +++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c

[PATCH 00/17] qemu: Prepare block device setup for removing the 'raw' driver ('raw' driver removal part 3)

2023-11-24 Thread Peter Krempa
This series prepares the setup of the block device backend for removal of the raw driver from the block graph, and actually removes it from the migration NBD connection. Unfortunately for normal usage it's not yet possible as qemu then records the protocol driver name in the backing file format fi

[PATCH 02/17] qemu: block: Use qemuBlockStorageSourceNeedsStorageSliceLayer only for setup

2023-11-24 Thread Peter Krempa
Add a note stating that qemuBlockStorageSourceNeedsStorageSliceLayer must be used only when setting up a new blockdev, any other case when the device might been already set up must use the existance of the nodename to do so. Adjust qemuBlockStorageSourceAttachPrepareBlockdev to do so and refactor

[PATCH 03/17] qemu: block: Introduce helper for deciding when a 'format' layer is needed

2023-11-24 Thread Peter Krempa
The 'format' layer is not required in certain cases. As the logic for this will be a bit more involved create a helper function to do the decision. For now we'll keep to always format the 'format' -blockdev layer. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 19 +++ s

[PATCH 04/17] qemuBlockStorageSourceGetBlockdevStorageSliceProps: Allow turning the slice layer into effective blockdev layer

2023-11-24 Thread Peter Krempa
Allow using the slice layer as effective layer once we stop formatting the unnecessary 'raw' driver. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 123

[PATCH 05/17] qemuBlockStorageSourceAttachPrepareBlockdev: Prepare for optionally missing format layer

2023-11-24 Thread Peter Krempa
Restructure the code logic so that the function is prepared for the possibility that the 'format' blockdev layer may be missing if not needed. To achieve this we need to introduce logic that selects which node (format/slice/storage) becomes the effective node and thus formats the correct set of ar

[PATCH 06/17] qemuBlockStorageSourceDetachPrepare: Prepare for possibly missing 'format' layer

2023-11-24 Thread Peter Krempa
Setup the data for detaching of the 'format' layer only when it's present. Restructure the logic to follow the same order as qemuBlockStorageSourceAttachPrepareBlockdev in terms of format/slice/storage -blockdev objects, and drop the now-misleading comment for 'slice' of raw disks. Signed-off-by:

[PATCH 07/17] qemuDomainPrepareStorageSourceBlockdevNodename: Restructure code to allow missing 'format' layer

2023-11-24 Thread Peter Krempa
Similarly to other bits of code, we don't need to setup the format layer if it will not be formatted. Add logic which uses qemuBlockStorageSourceNeedsFormatLayer to see whether the setup of the format node is needed. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 17 -

[PATCH 08/17] qemuBlockStorageSourceGetEffectiveNodename: Prepare for missing 'format' driver

2023-11-24 Thread Peter Krempa
Return the effective storage nodename if the format layer is not present. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 7137604e36..b7f16b43ae 100644 --- a/src/qemu

[PATCH 09/17] qemu: block: Extract logic from qemuBlockReopenReadWrite/ReadOnly

2023-11-24 Thread Peter Krempa
We want to preserve the wrappers for clarity but the inner logic can be extracted to a common function qemuBlockReopenAccess. In further patches the code from qemuBlockReopenFormat will be merged into the new wrapper as well as logic for handling scenarios with missing 'format' layers will be added

[PATCH 10/17] qemu: block: Absorb logic from qemuBlockReopenFormat to qemuBlockReopenAccess

2023-11-24 Thread Peter Krempa
Move all the logic into the new function and remove the old one. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 60 +++ 1 file changed, 21 insertions(+), 39 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 1ef6bf98bc.

[PATCH 11/17] qemu: monitor: Sanitize arguments of qemuMonitorBlockdevReopen

2023-11-24 Thread Peter Krempa
Take the virJSONValue array object which is passed to the 'blockdev-reopen' command as the 'options' argument rather than making the caller wrap all the properties. The code was a leftover from the time when the blockdev-reopen command had a different syntax, and thus can be cleaned up. Also note

[PATCH 12/17] testQemuMonitorJSONBlockdevReopen: Don't use qemuBlockReopenFormatMon

2023-11-24 Thread Peter Krempa
Use the low level monitor API directly to test the QMP wrapper itself. Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 6293b416bd..d9ebb429e7

[PATCH 13/17] qemu: block: Absorb qemuBlockReopenFormatMon into qemuBlockReopenAccess

2023-11-24 Thread Peter Krempa
Move all the code into the now only caller. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 31 +-- src/qemu/qemu_block.h | 5 - 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 84d9ddd9ef

[PATCH 15/17] qemuMigrationSrcNBDCopyCancel: Use qemuBlockStorageSourceAttachRollback to detach migration NBD blockdevs

2023-11-24 Thread Peter Krempa
Rewrite the code to use the common tooling for removing blockdevs instead of the ad-hoc qemuBlockStorageSourceDetachOneBlockdev helper. Use of the common infrastructure will properly handle cases when the raw driver is ommited from the block graph. Since the TLS data object is shared for all migr

[PATCH 16/17] qemu: block: Remove unused qemuBlockStorageSourceDetachOneBlockdev

2023-11-24 Thread Peter Krempa
The only caller was converted to use the common blockdev infrastructure thus this function is no longer needed. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 34 -- src/qemu/qemu_block.h | 5 - 2 files changed, 39 deletions(-) diff --git a/src/qemu

[PATCH 17/17] qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource: Don't setup 'raw' layer for migration NBD connection

2023-11-24 Thread Peter Krempa
The raw driver layer is not needed in this case and can be dropped. Removing the nodename will cause other pieces of the code to pick up and stop addign the layer. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_migration

[PATCH 14/17] qemuBlockReopenAccess: prepare for removal of 'raw' format layer

2023-11-24 Thread Peter Krempa
Make the helper reopening a blockdev for access pick the correct layer to reopen based on what is currently in use. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_blo

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

2023-11-24 Thread Michal Privoznik
On systems with humongous pages (16GiB) and 32bit int it's easy to hit integer overflow in virNumaGetPages(). What happens is, inside of virNumaGetPages() as we process hugepages for given NUMA node (e.g. in order to produce capabilities XML), we keep a sum of sizes of pools in an ULL variable (hug

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

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Michal Privoznik wrote: On systems with humongous pages (16GiB) and 32bit int it's easy to hit integer overflow in virNumaGetPages(). What happens is, inside of virNumaGetPages() as we process hugepages for given NUMA node (e.g. in order to produce capabilities XML), we keep

Re: [PATCH 2/2] qemu: block: Don't try to merge bitmaps into 'raw' images

2023-11-24 Thread Ján Tomko
On a Thursday in 2023, Peter Krempa wrote: If any of the images in a chain above a raw image have bitmaps, libvirt would attempt to merge them when doing a block commit or block copy operation, which would result into a error in the logs as creating persistent bitmaps in a raw image is not suppor

Re: [PATCH 0/2] qemu: block fixes

2023-11-24 Thread Ján Tomko
On a Thursday in 2023, Peter Krempa wrote: Few issues I've found while testing the block layer for an upcoming patchset. Peter Krempa (2): qemu: hotplug: Detect disk backing images before setting up security access qemu: block: Don't try to merge bitmaps into 'raw' images src/qemu/qemu_blo

Re: [PATCH 5/7] virstoragetest: Format detected/unprocessed backing store format into output files

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Peter Krempa wrote: Compare also the detected format of the backing file ('backingStoreRawFormat' field) into the outptu data for comparison with *output Jano others. Since the ToString function can't convert VIR_STORAGE_FILE_AUTO use also the numeric value. Signed-off-

Re: [PATCH 0/7] storage_file_probe: Handle qcow2 images with 'protocol' driver name in 'backing file format' field (part 1 - the fix)

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Peter Krempa wrote: See 6/7 and 7/7 for the rationale. Further patches will be posted to refactor the rest of the parsers which are bitrotten. Peter Krempa (7): storage_file_probe: Remove unused state 'BACKING_STORE_ERROR' virStorageFileProbeGetMetadata: Do not partially s

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

2023-11-24 Thread Michal Privoznik
QEMU gained support for PipeWire audio backend (see QEMU commit of v8.0.0-403-gc2d3d1c294). Its configuration knobs are basically the same as pulseaudio's, except for PA's server name. Therefore, a lot of code is copied over from pulseadio and fixed by s/Pulse/Pipewire/ or s/pulseaudio/pipewire/.

[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
This is mostly straightforward, except for a teensy-weensy detail: usually, there's no system wide daemon running, no system wide available socket that anybody could connect to. PipeWire uses a per user daemon approach instead. But this in turn means, that the socket location floats between various

Re: [PATCH 02/17] qemu: block: Use qemuBlockStorageSourceNeedsStorageSliceLayer only for setup

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Peter Krempa wrote: Add a note stating that qemuBlockStorageSourceNeedsStorageSliceLayer must be used only when setting up a new blockdev, any other case when the device might been already set up must use the existance of the existence nodename to do so. Adjust qemuBlock

Re: [PATCH 15/17] qemuMigrationSrcNBDCopyCancel: Use qemuBlockStorageSourceAttachRollback to detach migration NBD blockdevs

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Peter Krempa wrote: Rewrite the code to use the common tooling for removing blockdevs instead of the ad-hoc qemuBlockStorageSourceDetachOneBlockdev helper. Use of the common infrastructure will properly handle cases when the raw driver is ommited from the block graph. Since

Re: [PATCH 17/17] qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource: Don't setup 'raw' layer for migration NBD connection

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Peter Krempa wrote: The raw driver layer is not needed in this case and can be dropped. Removing the nodename will cause other pieces of the code to pick up and stop addign the layer. *adding Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 1 - 1 file changed

Re: [PATCH 00/17] qemu: Prepare block device setup for removing the 'raw' driver ('raw' driver removal part 3)

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Peter Krempa wrote: This series prepares the setup of the block device backend for removal of the raw driver from the block graph, and actually removes it from the migration NBD connection. Unfortunately for normal usage it's not yet possible as qemu then records the protoco

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

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Michal Privoznik wrote: QEMU gained support for PipeWire audio backend (see QEMU commit of v8.0.0-403-gc2d3d1c294). Its configuration knobs are basically the same as pulseaudio's, except for PA's server name. Therefore, a lot of code is copied over from pulseadio and fixed by

Re: [PATCH v2 0/3] Introduce pipewire audio backend

2023-11-24 Thread Ján Tomko
On a Friday in 2023, Michal Privoznik wrote: 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