[PATCH v2 3/3] qemu: Setup host side of VDPA device for block copy

2023-10-26 Thread Peter Krempa
Setup the VDPA bits of the appropriate part of the image chain for block copy. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 4 src/qemu/qemu_driver.c | 12 2 files changed, 16 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index

[PATCH v2 1/3] qemu: process: Extract host setup of disk device into helpers

2023-10-26 Thread Peter Krempa
Currently the code sets up only VDPA backends but will be used later in hotplug code too. This patch also uses normal forward iteration in the loop in qemuProcessPrepareHostStorage as we don't need to remove disks from the disk list at that point. Signed-off-by: Peter Krempa --- src

[PATCH v2 2/3] qemu: hotplug: Setup host side of VDPA device for disk hotplug

2023-10-26 Thread Peter Krempa
p the VDPA definition. Closes: https://gitlab.com/libvirt/libvirt/-/issues/539 Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1f7f5bdd26..fec7c4be4e 100644 --- a/src/qemu/qemu_hotplug.c

[PATCH v2 0/3] qemu: Fix hotplug and blockcopy to VDPA disks

2023-10-26 Thread Peter Krempa
Content-type: text/plain v2: - also deal with blockcopy (requires more helpers) Peter Krempa (3): qemu: process: Extract host setup of disk device into helpers qemu: hotplug: Setup host side of VDPA device for disk hotplug qemu: Setup host side of VDPA device for block copy src/qemu

Re: [PATCH 0/2] qemu: Fix hotplug of VDPA disks

2023-10-26 Thread Peter Krempa
On Thu, Oct 26, 2023 at 15:15:15 +0200, Peter Krempa wrote: > Peter Krempa (2): > qemu: process: Extract host setup of disk device into a helper > qemu: hotplug: Setup host side of VDPA device for disk hotplug > > src/qemu/qemu_hotplug.c | 3 +++ > src/qemu/q

[PATCH 1/2] qemu: process: Extract host setup of disk device into a helper

2023-10-26 Thread Peter Krempa
Currently the code sets up only VDPA backends but will be used later in hotplug code too. This patch also uses normal forward iteration in the loop in qemuProcessPrepareHostStorage as we don't need to remove disks from the disk list at that point. Signed-off-by: Peter Krempa --- src

[PATCH 2/2] qemu: hotplug: Setup host side of VDPA device for disk hotplug

2023-10-26 Thread Peter Krempa
p the VDPA definition. Closes: https://gitlab.com/libvirt/libvirt/-/issues/539 Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1f7f5bdd26..fec7c4be4e 100644 --- a/src/qemu/qemu_hotplug.c

[PATCH 0/2] qemu: Fix hotplug of VDPA disks

2023-10-26 Thread Peter Krempa
Peter Krempa (2): qemu: process: Extract host setup of disk device into a helper qemu: hotplug: Setup host side of VDPA device for disk hotplug src/qemu/qemu_hotplug.c | 3 +++ src/qemu/qemu_process.c | 42 - src/qemu/qemu_process.h | 3 +++ 3 files

[PATCH] docs: formatdomain: Clarify that the SLIC ACPI table config is available for all modes

2023-10-26 Thread Peter Krempa
Move the docs for the element under a common section as it's not specific for direct kernel boot. In fact the original use was for Windows activation. Fixes: 72f652da63255c7f1a9914625cce617dde9128d0 Signed-off-by: Peter Krempa --- docs/formatdomain.rst | 29 +--

[PATCH 15/22] qemuBlockStorageSourceGetBackendProps: Unify ordering of fields

2023-10-25 Thread Peter Krempa
Use the same ordering of the relevant fields as we do for the format layer -blockdev so that later they can be refactored without test fallout. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 2 +- .../xml2json/dir-fat-cache.json | 6

[PATCH 10/22] qemublocktest: Drop 'sheepdog' and 'vxhs' test cases

2023-10-25 Thread Peter Krempa
QEMU deprecated and removed support for those protocols, but due to a logic bug in the tests it was not caught. Remove the test cases first. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/tests/qemublocktest.c b/tests

[PATCH 22/22] qemu: block: Remove unused flags QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_ flags

2023-10-25 Thread Peter Krempa
d-off-by: Peter Krempa --- src/qemu/qemu_block.c | 7 +-- src/qemu/qemu_block.h | 4 +--- tests/qemublocktest.c | 7 ++- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index a625e72a5d..382015f293 100644 --- a/src/qemu/qemu_bl

[PATCH 20/22] qemuBlockStorageSourceGetBackendProps: Use qemuBlockStorageSourceAddBlockdevCommonProps

2023-10-25 Thread Peter Krempa
Use the qemuBlockStorageSourceAddBlockdevCommonProps helper when formatting protocol layer both when it's used as backing for a format node and when it's used as the effective node. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 29 +++-- 1 file

[PATCH 19/22] qemuBuildHostdevSCSIAttachPrepare: Use "effective node" mode for getting blockdev props

2023-10-25 Thread Peter Krempa
The resulting properties are identical, as the hostdev backend code doesn't set any of the extra properties. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c

[PATCH 08/22] qemuBlockStorageSourceGetBlockdevGetCacheProps: Return the cache object rather than appending it

2023-10-25 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 29 - src/qemu/qemu_domain.c | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0f47b5b37f..41038fb994 100644 --- a/src/qemu

[PATCH 13/22] qemuBlockStorageSourceGetBackendProps: Unify cases for '!onlytarget' and '!legacy'

2023-10-25 Thread Peter Krempa
At this point only a single code path (for formatting -drive for legacy SD cards) uses the 'legacy' output and that code path doesn't populate the node name. Thus we can unify the code block and simplify the JSON formatters. Signed-off-by: Peter Krempa --- src/qemu/qe

[PATCH 14/22] virDomainDiskGetDetectZeroesMode: Return proper type

2023-10-25 Thread Peter Krempa
Change the return value type to 'virDomainDiskGetDetectZeroes'. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 2 +- src/qemu/qemu_block.c | 4 ++-- src/qemu/qemu_command.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff -

[PATCH 16/22] qemu: block: Add helper to add common properties for -blockdev configuration

2023-10-25 Thread Peter Krempa
es between the modes. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 128 +- 1 file changed, 88 insertions(+), 40 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 689eb535cb..aeb05a7f00 100644 --- a/src/qemu/qemu_block.c

[PATCH 07/22] qemuDomainDiskCachemodeFlags: Simplify usage

2023-10-25 Thread Peter Krempa
Return whether a relevant cachemode was presented rather than returning an error, so that callers can be simplified. Use the proper enum type as argument rather than typecasting in the switch statement. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 5 + src/qemu/qemu_command.c

[PATCH 18/22] qemuBlockStorageSourceGetBackendProps: Introduce QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE

2023-10-25 Thread Peter Krempa
Introduce a mode where the protocol layer -blockdev will be formatted so that it can be used as the effective node (used to access data from the device). For this new mode we'll use qemuBlockStorageSourceAddBlockdevCommonProps. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c

[PATCH 11/22] qemublocktest: Fix logical bug in TEST_JSON_FORMAT macro

2023-10-25 Thread Peter Krempa
Condition handling failure of the first virTestRun was lacking the 'ret = -1' line thus the subsequent line was taken as it's body rendering the first invocation useless. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 1 + 1 file changed, 1 insertion(+) dif

[PATCH 17/22] qemu: block: Use qemuBlockStorageSourceAddBlockdevCommonProps for storage slice

2023-10-25 Thread Peter Krempa
Use the new helper in qemuBlockStorageSourceGetBlockdevStorageSliceProps to format the common bits. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 17 ++--- .../disk-slices.x86_64-latest.args | 6 +++--- 2 files changed, 9 insertions

[PATCH 00/22] qemu: Refactor blockdev protocol JSON generators ('raw' driver removal part 2)

2023-10-25 Thread Peter Krempa
Second part cleans up tests and various bits and refactors the protocol blockdev JSON configuration generator to be reusable. This still doesn't change the configuration of the blockdevs, just reorders some arguments. Peter Krempa (22): qemuxml2(argv|xml)test: Add network backed disk typ

[PATCH 12/22] qemublocktest: testBackingXMLjsonXML: Drop 'legacy' mode

2023-10-25 Thread Peter Krempa
Legacy mode used to be needed for use with -drive, which was almost completely deleted. We now have qemuxml2argvtest test cases checking a few cases and the rest uses the modern mode only. Thus we don't need to test the legacy mode any more. Signed-off-by: Peter Krempa --- tests/qemublockt

[PATCH 06/22] virStorageSource: Use proper type for shadow copies of iomode/cachemode/discard/detect_zeroes

2023-10-25 Thread Peter Krempa
The aforementioned fields in virStorageSource struct are copies of the disk properties, but were not converted to the proper type yet. Signed-off-by: Peter Krempa --- src/conf/storage_source_conf.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf

[PATCH 21/22] qemuBlockStorageSourceGetBackendProps: Remove unused logic for (auto-)read-only flags

2023-10-25 Thread Peter Krempa
The code was refactored to format the 'read-only' and 'auto-read-only' flags via the common helper, so the logic determining their values can be removed. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 36 +++- 1 file changed,

[PATCH 05/22] conf: Move definition of some disk type enums to a common header

2023-10-25 Thread Peter Krempa
Certain disk config fields are mirrored between the disk and storage source definitions. We nee Signed-off-by: Peter Krempa --- src/conf/domain_conf.h | 37 - src/conf/virconftypes.h | 39 ++- 2 files changed, 38

[PATCH 09/22] qemublocktest: Use "target only" mode in 'testJSONtoJSON' and 'testBackingXMLjsonXML'

2023-10-25 Thread Peter Krempa
eason QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY used in 'testJSONtoJSON' doesn't make sense. Signed-off-by: Peter Krempa --- tests/qemublocktest.c| 4 ++-- tests/qemublocktestdata/jsontojson/curl-libguestfs-out.json | 5 ++--- .../jsontojson/ssh-passthrough

[PATCH 02/22] qemu: migration: No longer avoid 'auto-read-only' option for migration

2023-10-25 Thread Peter Krempa
The 'auto-read-only' blockdev option is available in all supported qemu versions so we can remove the migration hack which disabled it. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 8 ++-- src/qemu/qemu_block.h | 3 +-- src/qemu/qemu_command.c | 2 +-

[PATCH 01/22] qemuxml2(argv|xml)test: Add network backed disk type='sd'

2023-10-25 Thread Peter Krempa
Add a few examples of SD cards backed with network storage to capture the current state as the formatter code is about to be refactored. Signed-off-by: Peter Krempa --- .../disk-arm-virtio-sd.aarch64-latest.args | 2 ++ tests/qemuxml2argvdata/disk-arm-virtio-sd.xml| 16

[PATCH 04/22] qemuBlockStorageSourceGetBackendProps: Remove unnecessary indent for non-nbdkit code path

2023-10-25 Thread Peter Krempa
Formatting of the 'nbdkit' driven backend breaks out of the switch statement so we don't need to have an unnecessary block and indentation level for the case when nbdkit is not in use. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 132 +--

[PATCH 03/22] qemuBuildDriveSourceStr: Absorb only use of qemuDiskSourceGetProps

2023-10-25 Thread Peter Krempa
'qemuBuildDriveSourceStr' used to build the legacy -drive commandline for SD cards is the only user of qemuDiskSourceGetProps. Move the helper directly inline. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 39 +++ 1 file changed, 11

[PATCH 13/31] qemuDomainGetStatsBlockExportDisk: Use 'storage' node name accessors

2023-10-16 Thread Peter Krempa
In all cases we want to probe stats from the 'storage' layer as we're interested in the 'threshold' value, which we set there. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu

[PATCH 17/31] qemu: block: Add accessors for storage source effective nodename

2023-10-16 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 14 ++ src/qemu/qemu_block.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index cba1fb1c1e..10c2c0104b 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c

[PATCH 11/31] qemu: Refactor storage backend attach/detach setup code to use 'storage' nodename accessors

2023-10-16 Thread Peter Krempa
Refactor the code settin up data structures used to attach/detach disks and SCSI hostdevs. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 7 --- src/qemu/qemu_command.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu

[PATCH 08/31] qemu: domain: Convert the status XML code for 'storage' nodenames to new accessors

2023-10-16 Thread Peter Krempa
appropriate 'virStorageSource' struct so using the storage layer node name is simpler. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[PATCH 26/31] qemu: Use 'format' nodename accessors for block dirty bitmap operations

2023-10-16 Thread Peter Krempa
rations. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 27 ++- src/qemu/qemu_blockjob.c | 4 ++-- src/qemu/qemu_checkpoint.c | 9 + src/qemu/qemu_driver.c | 7 --- src/qemu/qemu_snapshot.c | 6 -- 5 files changed, 29 inserti

[PATCH 21/31] qemu: block: Use 'format' nodename accessors in '-blockdev' setup code

2023-10-16 Thread Peter Krempa
Convert the main -blockdev JSON object setup code to use the new accessors. In these we use mainly the real 'format' layer node name. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu

[PATCH 23/31] tests: Use 'format' layer nodename accessors in test code

2023-10-16 Thread Peter Krempa
The test code cares mostly about the actual layer nodenames thus, appropriate accessors are used. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 10 +- tests/qemumonitorjsontest.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests

[PATCH 14/31] qemuDomainSetBlockThreshold: Use 'storage' node name accessor

2023-10-16 Thread Peter Krempa
We need to keep setting the block threshold on the real storage layer per semantics of the API. Use the appropriate accessor. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu

[PATCH 20/31] qemu: blockjob: Use 'format' nodename accessors for job naming

2023-10-16 Thread Peter Krempa
Use the effective nodename for naming the job as we use that one now. It doesn't matter too much which one we pick, because it's used just for the name of the job, which we preserve in the status XML. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 14 +- 1 fi

[PATCH 19/31] qemu: backup: Use format nodename accessors

2023-10-16 Thread Peter Krempa
Both modified cases in this patch require the effective nodename as they deal with the data being backed up. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index

[PATCH 25/31] qemu: driver: Convert disk stats code to use 'format' nodename accessors

2023-10-16 Thread Peter Krempa
I case of statistics we're interested in the statistics of the effective bitmap whatever it happens to be. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c

[PATCH 24/31] qemu: Convert disk backend setup code to use 'format' nodename accessors

2023-10-16 Thread Peter Krempa
The disk backend setup code is concerned only about the effective nodename. Doing this conversion will also simplify further changes needed to drop the 'raw' layer in cases when it's not really needed. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 6 +++--- src/qemu/qe

[PATCH 31/31] conf: Rename 'nodeformat' field of virStorageSource to 'nodenameformat'

2023-10-16 Thread Peter Krempa
While the name itself doesn't matter, this rename is done to prove that all places using 'nodeformat' were converted to the appropriate accessors. Signed-off-by: Peter Krempa --- src/conf/storage_source_conf.c | 4 ++-- src/conf/storage_source_conf.h | 2 +- src/qemu/qemu_block

[PATCH 07/31] qemu: block: Use proper accessors for image formatting/creation code

2023-10-16 Thread Peter Krempa
ppropriate entry. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c| 10 +- src/qemu/qemu_blockjob.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0c9460f678..a98caa330e 100644 --- a/src/qemu/qe

[PATCH 29/31] qemu: migration: Use 'format' nodename accessors in dirty bitmap migration

2023-10-16 Thread Peter Krempa
The persistent bitmaps are stored in the format layer, using 'effective' bitmap name is the most reasonable approach in this case. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c| 11 ++- src/qemu/qemu_migration_cookie.c | 2 +- 2 files changed, 7 insert

[PATCH 18/31] qemuBlockStorageSourceGetFormatProps: Use new frontend name accessor

2023-10-16 Thread Peter Krempa
--- src/qemu/qemu_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 10c2c0104b..0fa5b6e55d 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1418,7 +1418,7 @@ qemuBlockStorageSourceGetFormatProps(virStor

[PATCH 28/31] qemu: Convert migration setup code to use 'format' layer node name accessors

2023-10-16 Thread Peter Krempa
The blockjob, NBD export and setup of the cookie data all care about the effective nodename. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c| 6 +++--- src/qemu/qemu_migration.c| 4 ++-- src/qemu/qemu_migration_cookie.c | 3 ++- 3 files changed, 7 insertions(+), 6

[PATCH 27/31] qemu: command: Use 'format' nodename accessors for 'pflash' backend setup

2023-10-16 Thread Peter Krempa
The frontend device needs to access the blocks directly so it cares about the effective nodename. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 40de712c61

[PATCH 30/31] qemu: driver: Use 'format' nodename accessors for disk resize

2023-10-16 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b286d94ca1..43d96739d5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9252,7 +9252,7

[PATCH 22/31] qemu: domain: Use 'format' layer node name accessors for nodename setup code

2023-10-16 Thread Peter Krempa
The code setting the nodenames needs to use the 'true' nodename of the format layer. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[PATCH 10/31] qemu: domain: Rework assignment of 'storage' nodenames to use new accessors

2023-10-16 Thread Peter Krempa
Refactor the code which assigns the 'storage' layer nodenames for disks. scsi hostdevs and pflash backend. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c| 25 ++--- src/qemu/qemu_migration.c | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-)

[PATCH 05/31] tests: Use 'storage' layer nodename accessors in tests

2023-10-16 Thread Peter Krempa
Convert all places in tests to use the 'storage' layer nodename accessors instead of (virStorageSource)->nodestorage. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 4 ++-- tests/qemumonitorjsontest.c | 2 +- tests/qemuxml2argvtest.c| 3 ++- 3 files changed,

[PATCH 15/31] conf: Rename 'nodestorage' field of virStorageSource to 'nodenamestorage'

2023-10-16 Thread Peter Krempa
While the name itself doesn't matter, this rename is done to prove that all places using 'nodestorage' were converted to the appropriate accessors. Signed-off-by: Peter Krempa --- src/conf/storage_source_conf.c | 4 ++-- src/conf/storage_source_conf.h | 2 +- src/qemu/qemu_block

[PATCH 09/31] qemu: block: Convert disk 'storage' backend JSON props generator to new accessors

2023-10-16 Thread Peter Krempa
torage' layer props, or the storage slice, which refers to the proper storage backend. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index a98caa330e..1fc36

[PATCH 16/31] qemu: block: Add accessors for format layer node names

2023-10-16 Thread Peter Krempa
Introduce a set of accessors, which return node names based on semantics. This will allow to us to modify how we setup the backing chain in cases when e.g. the format driver can be omitted, without breaking all the code. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 31

[PATCH 12/31] qemu: Refactor storage backend 'storage' layer helepr object setup

2023-10-16 Thread Peter Krempa
Use the new nodename accessors for any storage layer helper object. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_nbdkit.c | 4 ++-- src/qemu/qemu_process.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu

[PATCH 01/31] qemu: domain: Identify blockjobs by storage nodename in VM status XML

2023-10-16 Thread Peter Krempa
Use the node name of the storage access driver to identify the block job volumes. This will prepare the blockjob code to the possibility that the format layer may be missing. Our lookup code can find either of them, thus we can safely switch. Signed-off-by: Peter Krempa --- src/qemu

[PATCH 04/31] qemu: block: Add accessors for protocol/storage node names

2023-10-16 Thread Peter Krempa
Introduce a set of accessors, which return node names based on semantics. This will allow to us to modify how we setup the backing chain in cases when e.g. the format driver can be omitted, without breaking all the code. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 48

[PATCH 03/31] qemu: block: Rename qemuBlockStorageSourceGetBlockdevProps

2023-10-16 Thread Peter Krempa
Use qemuBlockStorageSourceGetFormatProps as it formats the properties of the 'format' driver in qemu. Adjust the comment which was hinting otherwise. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 16 +++- src/qemu/qemu_block.h | 4 ++-- tests/qemublocktest.c

[PATCH 06/31] qemuDomainVirStorageSourceFindByNodeName: Use proper accessor

2023-10-16 Thread Peter Krempa
The lookup by nodename requires the proper storage nodename which we use also in status XML. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 918b5a14e1..f891defa91

[PATCH 02/31] qemu: block: Refactor logic in qemuBlockStorageSourceGetBlockdevProps

2023-10-16 Thread Peter Krempa
Restructure the conditions so that we can use virJSONValueObjectAdd with a clearer logic for backing store control. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 46 ++- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/qemu

[PATCH 00/31] qemu: Add accessors for 'storage' and 'format' nodenames and refactor callers ('raw' driver removal part 1)

2023-10-16 Thread Peter Krempa
This is a prequel series necessary for removing the dummy 'raw' driver node if it isn't needed for performance reasons. Peter Krempa (31): qemu: domain: Identify blockjobs by storage nodename in VM status XML qemu: block: Refactor logic in qemuBlockStorageSourceGetBlockdevProp

Re: [libvirt] [PATCHv2 37/62] qemu: process: Setup disk io throttling?for -blockdev

2023-10-16 Thread Peter Krempa
On Mon, Oct 16, 2023 at 14:19:08 +, Chun Feng Wu wrote: > Thanks for your info! Currently, the iotune in libvirt’s xml indeed works > well, BTW, is there any plan for such “re-engineering”? No, there are no plans, as the current approach covers the vast majority of use cases. Spending signifi

Re: [libvirt] [PATCHv2 37/62] qemu: process: Setup disk io throttling for -blockdev

2023-10-16 Thread Peter Krempa
On Mon, Oct 16, 2023 at 13:36:42 +, Chun Feng Wu wrote: > Does this libvirt throttling support “chained throttle filters” for single > disk described in QEMU doc: > https://github.com/qemu/qemu/blob/master/docs/throttle.txt (“The 'throttle' > block filter”) No, libvirt currently still uses

Re: [PATCH 4/4] virSecretLoad: Simplify cleanup path

2023-10-16 Thread Peter Krempa
_autoptr() after which all error paths can just > return NULL instantly. > > Signed-off-by: Michal Privoznik > --- > src/conf/virsecretobj.c | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) Reviewed-by: Peter Krempa

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

2023-10-16 Thread Peter Krempa
> Signed-off-by: Michal Privoznik > --- > src/conf/virsecretobj.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) Reviewed-by: Peter Krempa

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

2023-10-16 Thread Peter Krempa
-- > src/util/virfile.h | 5 - > 3 files changed, 28 deletions(-) Reviewed-by: Peter Krempa

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

2023-10-16 Thread Peter Krempa
char *path = NULL; > g_autoptr(virCommand) cmd = NULL; > > - virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr); > + path = g_build_filename(LIBVIRT_HOOK_DIR, drvstr); It's docs, but it's missing the NULL sentinel. Reviewed-by: Peter Krempa

[PATCH 6/7] conf: Save translated disk definition for disk type='volume' to status XML

2023-10-12 Thread Peter Krempa
the status XML. Resolves: https://issues.redhat.com/browse/RHEL-7345 Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 3 ++- src/conf/virdomainobjlist.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH 1/7] virStorageSourcePoolDef: Turn 'mode' member into proper enum type

2023-10-12 Thread Peter Krempa
Use proper enum type and refactor the formatter accordingly. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 src/conf/storage_source_conf.h | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c

[PATCH 5/7] qemustatusxml2xmltest: Demonstrate use of VIR_DOMAIN_DEF_(PARSE|FORMAT)_VOLUME_TRANSLATED

2023-10-12 Thread Peter Krempa
Enable the flags in the status xml2xmtest and add an exaple to the test data. Signed-off-by: Peter Krempa --- tests/qemustatusxml2xmldata/modern-in.xml | 4 ++-- tests/qemustatusxml2xmltest.c | 6 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests

[PATCH 2/7] virDomainDiskSourcePoolDefParse: Refactor cleanup

2023-10-12 Thread Peter Krempa
Register autoptr cleanup function for virStorageSourcePoolDef and refactor the parser to simplify the logic. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 35 +++--- src/conf/storage_source_conf.h | 1 + 2 files changed, 12 insertions(+), 24

[PATCH 4/7] qemu: domain: Allow preserving translated disk type='volume' data into XML if needed

2023-10-12 Thread Peter Krempa
or if the virt-aa-helper program tries to setup labelling for apparmor. Add a new flag which will preserve the translated data in the definition. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 69 ++ src/conf/domain_conf.h | 4 +++ 2 files c

[PATCH 0/7] qemu: Fix two pool-translation related bugs

2023-10-12 Thread Peter Krempa
st it though as I don't have such distro handy. Peter Krempa (7): virStorageSourcePoolDef: Turn 'mode' member into proper enum type virDomainDiskSourcePoolDefParse: Refactor cleanup virDomainDiskTranslateSourcePool: Don't re-translate already translated defs qemu:

[PATCH 3/7] virDomainDiskTranslateSourcePool: Don't re-translate already translated defs

2023-10-12 Thread Peter Krempa
If a disk definition was already translated re-doing it makes no sense. Skip the translation if the 'actualtype' is already populated. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c

[PATCH 7/7] security: apparmor: Use translated disk definitions for disk type=volume

2023-10-12 Thread Peter Krempa
ssues/546 The configuration in the issue above was created by Cockpit on Debian. Since Cockpit is getting more popular it's more likely that users will be impacted by this problem. Signed-off-by: Peter Krempa --- src/security/security_apparmor.c | 8 ++-- src/security/virt-aa-helper.c

Re: [PATCH 1/1] Checking the value returned by the function

2023-10-11 Thread Peter Krempa
On Wed, Oct 11, 2023 at 15:24:17 +0300, Sergey Mironov wrote: > The virSecuritySELinuxSetFilecon function (by definition) always returns > values 0 or -1. > The result of this function is written to 'ret'. > The code compares the value of the variable 'ret' with 1. > > Signed-off-by: Sergey Miron

Re: [PATCHv2 1/1] Changes from [v1]:

2023-10-11 Thread Peter Krempa
empty for -blockdev */ > -if (*devAlias == '\0') > +if (devAlias && *devAlias == '\0') Reviewed-by: Peter Krempa

Re: [PATCH 1/1] The virJSONValueObjectGetString function can return NULL, there are no checks

2023-10-10 Thread Peter Krempa
On Tue, Oct 10, 2023 at 17:55:26 +0300, Sergey Mironov wrote: > The devAlias check is performed in the "if (!devAlias && !devid) {", so the > situation is not handled when devAlias is NULL, and devid is not NULL > > Signed-off-by: Sergey Mironov > --- > src/qemu/qemu_monitor_json.c | 5 + >

Re: [RFC PATCH 4/4] qemu_command: Added "ebpf_rss_fds" support for virtio-net.

2023-10-09 Thread Peter Krempa
On Mon, Oct 09, 2023 at 09:16:14 +0300, Andrew Melnychenko wrote: > Added logic for loading the "RSS" eBPF program. > eBPF file descriptors passed to the QEMU. > > Signed-off-by: Andrew Melnychenko > --- > src/qemu/qemu_command.c | 53 + > src/qemu/qemu_do

Re: [RFC PATCH 3/4] qemu_interface: Added routine for loading the eBPF objects.

2023-10-09 Thread Peter Krempa
On Mon, Oct 09, 2023 at 09:16:13 +0300, Andrew Melnychenko wrote: > Also, added dependencies for libbpf with bpf option. > > Signed-off-by: Andrew Melnychenko > --- > meson.build | 6 ++ > meson_options.txt | 1 + > src/qemu/meson.build | 1 + > src/qemu/qemu_in

Re: [RFC PATCH 2/4] qemu_capabilities: Added new capability ebpf_rss_fds for QEMU.

2023-10-09 Thread Peter Krempa
On Mon, Oct 09, 2023 at 09:16:12 +0300, Andrew Melnychenko wrote: > Also, added logic for retrieving eBPF objects from QEMU. > eBPF objects stored in the hash table during runtime. > eBPF objects cached encoded in base64 in the .xml cache file. > > Signed-off-by: Andrew Melnychenko > --- > src/q

Re: [RFC PATCH 1/4] qemu_monitor: Added QEMU's "request-ebpf" support.

2023-10-09 Thread Peter Krempa
On Mon, Oct 09, 2023 at 09:16:11 +0300, Andrew Melnychenko wrote: > Added code for monitor and monitor_json. > The "request-ebpf" return's eBPF binary object encoded in base64. > The function qemuMonitorGetEbpf() returns a decoded blob. > > QEMU provides eBPF that can be loaded and passed to it fr

Re: [RFC PATCH 0/4] Added virtio-net RSS with eBPF support.

2023-10-09 Thread Peter Krempa
On Mon, Oct 09, 2023 at 10:15:34 +0200, Peter Krempa wrote: > On Mon, Oct 09, 2023 at 09:16:10 +0300, Andrew Melnychenko wrote: > > This series of rfc patches adds support for loading the RSS eBPF program > > and passing it to the QEMU. > > Comments and suggestions would be

Re: [RFC PATCH 0/4] Added virtio-net RSS with eBPF support.

2023-10-09 Thread Peter Krempa
On Mon, Oct 09, 2023 at 09:16:10 +0300, Andrew Melnychenko wrote: > This series of rfc patches adds support for loading the RSS eBPF program and > passing it to the QEMU. > Comments and suggestions would be useful. > > QEMU with vhost may work with RSS through eBPF. To load eBPF, > the capabiliti

Re: [PATCH] qemu: add 'media=cdrom' attribute for usb CDROM

2023-10-07 Thread Peter Krempa
On Sat, Oct 07, 2023 at 16:12:09 +0800, Minglei Liu wrote: > From: "minglei.liu" > > In commit 1328a83, the 'media=cdrom' attribute was removed from -drive. > However, this attribute is still essential for usb cdrom and is still > supported in qemu 8.1.1. Therefore, we need to reintroduce this at

Re: [RFC: vf-token 5/5] qemu: validate and generate vf-token on command line

2023-10-06 Thread Peter Krempa
On Thu, Oct 05, 2023 at 16:05:04 -0700, Vivek Kashyap wrote: > Introduce a validation function for vf-token support in qemu > and generate vf-token device attribute in qmeu command line. > > Signed-off-by: Vivek Kashyap > --- > src/qemu/qemu_command.c | 27 --- >

Re: [RFC: vf-token 4/5] conf: vf-token parsing and formatting

2023-10-06 Thread Peter Krempa
On Thu, Oct 05, 2023 at 16:05:03 -0700, Vivek Kashyap wrote: > Introduce XML parsing and formatting of vf-token attribute > > Signed-off-by: Vivek Kashyap > --- > src/conf/device_conf.c| 31 +-- > src/conf/domain_conf.c| 5 + > src/conf/sc

Re: [RFC: vf-token 3/5] conf: vf-token flag

2023-10-06 Thread Peter Krempa
On Thu, Oct 05, 2023 at 16:05:02 -0700, Vivek Kashyap wrote: > Define PCI address extension flag for vf-token > > Signed-off-by: Vivek Kashyap > --- > src/conf/device_conf.h | 3 +++ > src/conf/domain_addr.h | 1 + > src/qemu/qemu_domain_address.c | 3 +++ > 3 files changed, 7 in

Re: [RFC: vf-token 2/5] qemu: vf-token capability

2023-10-06 Thread Peter Krempa
On Thu, Oct 05, 2023 at 16:05:01 -0700, Vivek Kashyap wrote: > Introduce qemu capability for vf-token > > Signed-off-by: Vivek Kashyap > --- > src/qemu/qemu_capabilities.c | 3 +++ > src/qemu/qemu_capabilities.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/src/qemu/qemu_capabiliti

Re: [RFC: vf-token 1/5] virpci: Define vf-token

2023-10-06 Thread Peter Krempa
On Thu, Oct 05, 2023 at 16:05:00 -0700, Vivek Kashyap wrote: > Define the vf-token extension for PCI device > > Signed-off-by: Vivek Kashyap > --- > src/util/virpci.h | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/src/util/virpci.h b/src/util/virpci.h > index faca6cf6f9..

Re: [RFC: vf-token 0/5] Introduce vf-token when using userspace PF

2023-10-06 Thread Peter Krempa
On Thu, Oct 05, 2023 at 16:04:59 -0700, Vivek Kashyap wrote: > vf token is set by a vfio-pci based PF driver and it must be known to the > vfio-pci based VF driver. This vf-token is set by the PF driver before VF > drivers can access the device. vfio-pci driver and qemu support vf-token. > This RF

Re: [libvirt PATCH v3 00/10] external snapshot revert fixes

2023-09-26 Thread Peter Krempa
ting external snapshot when not all disks are > included > qemu_snapshot: correctly load the saved memory state file > capabilities: report full external snapshot support > NEWS: document support for reverting external snapshots Reviewed-by: Peter Krempa

Re: [libvirt PATCH v3 06/10] qemuProcessStartWithMemoryState: make it possible to use without data

2023-09-26 Thread Peter Krempa
On Mon, Sep 18, 2023 at 15:29:23 +0200, Pavel Hrdina wrote: > When used with internal snapshots there is no memory state file so we > have no data to load and decompression is not needed. > > Signed-off-by: Pavel Hrdina > --- > src/qemu/qemu_process.c | 23 +-- > 1 file chang

Re: [libvirt PATCH v3 05/10] qemuProcessStartWithMemoryState: add snapshot argument

2023-09-26 Thread Peter Krempa
On Mon, Sep 18, 2023 at 15:29:22 +0200, Pavel Hrdina wrote: > When called from snapshot code we will need to pass snapshot object in > order to make internal snapshots work correctly. > > Signed-off-by: Pavel Hrdina > --- > src/qemu/qemu_process.c | 9 - > src/qemu/qemu_process.h | 1

Re: [PATCH 08/31] configure: ensure dependency for cross-compile setup

2023-09-25 Thread Peter Maydell
t, you should also add it for other config-*.mak > > files. However, I'd remove this line and just change > > > > -# 1. ensure config-host.mak is up-to-date > > +# 1. ensure config-host.mak is up-to-date. All other config-*.mak > > +# files for subdirectories will be upd

Re: [libvirt PATCH v8 10/37] qemu: add functions to start and stop nbdkit

2023-09-21 Thread Peter Krempa
or a given virStorageSource. > > > > > > Signed-off-by: Jonathon Jongsma > > > Reviewed-by: Peter Krempa > > > --- > > > src/qemu/qemu_nbdkit.c | 250 + > > > src/qemu/qemu_nbdkit.h | 10 ++ > &g

Re: [libvirt PATCH] qemu_nbdkit: fix possible null dereference

2023-09-20 Thread Peter Krempa
nbdkit.c | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Peter Krempa

  1   2   3   4   5   6   7   8   9   10   >