On Wed, Nov 20, 2024 at 18:48:48 +0300, Nikolai Barybin via Devel wrote:
> - propogate data-file to cmdline
> - determine data-file within disk chain
> - enable live disk insertion
>
> Signed-off-by: Nikolai Barybin <[email protected]>
> ---
> src/qemu/qemu_block.c | 14 ++++++++++++++
> src/qemu/qemu_command.c | 5 +++++
> src/qemu/qemu_domain.c | 14 +++++++++++++-
> 3 files changed, 32 insertions(+), 1 deletion(-)
We need to also forbid formatting of qcow2 images if 'data-file' woudl
be requested by the user until it'll be implemented. Given that it's not
really necessary I'll be adding
@@ -2589,6 +2603,12 @@ qemuBlockStorageSourceCreateFormat(virDomainObj *vm,
if (qemuBlockStorageSourceIsRaw(src))
return 0;
+ if (src->dataFileStore) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("creation of storage images with <dataStore> feature
is not supported"));
+ return -1;
+ }
+
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index f4430275dc..cdc80cee73 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -11018,6 +11018,11 @@
> qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource *top)
> if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, n,
>
> n->backingStore) < 0)
> return NULL;
> +
> + if (n->dataFileStore &&
> + qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data,
> n->dataFileStore,
> +
> n->dataFileStore->backingStore) < 0)
It makes no sense to pass n->dataFileStore->backingStore. Instead I'll
explain why we're not doing that in a comment.
> + return NULL;
> }
>
> return g_steal_pointer(&data);
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 393c7dcac1..d0700db3be 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -6242,9 +6242,17 @@ qemuDomainDetermineDiskChain(virQEMUDriver *driver,
> true) < 0)
> return -1;
>
> + if (src->dataFileStore &&
> + qemuDomainPrepareStorageSource(src->dataFileStore, vm, disk, cfg) <
> 0)
> + return -1;
This requires explanation otherwise it looks misplaced here.
> +
> for (n = src->backingStore; virStorageSourceIsBacking(n); n =
> n->backingStore) {
> if (qemuDomainPrepareStorageSource(n, vm, disk, cfg) < 0)
> return -1;
Reviewed-by: Peter Krempa <[email protected]>