From: "Elias Huhsovitz" <e.huhsovitz@proxmox.com>
To: "Fiona Ebner" <f.ebner@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH qemu-server v2 3/7] api: clone disk: downgrade failure to register unused volume to warning
Date: Fri, 30 Oct 2026 11:56:12 +0100 [thread overview]
Message-ID: <DMI49V1MBFAD.325H924PHV1G5@proxmox.com> (raw)
In-Reply-To: <20261029120811.107814-4-f.ebner@proxmox.com>
I like the approach. I was also considering to simply check the number of
slots used before the actual cloning of the disk, but then we might just
encounter a new edge case down the line... So IMO this solution is
better :D
Reviewed-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
On Thu Oct 29, 2026 at 1:06 PM CET, Fiona Ebner wrote:
> When reaching the call to register the source volume as unused after
> clone, a running VM will already be switched over to the new disk. If
> an error occurs there (because all unused slots are already in use),
> the new disk would be removed in the error handling. Even if it is an
> offline clone, the failure to register the source volume as unused
> should not lead to aborting/reversing the whole operation. Downgrade
> the error to a warning.
>
> Reported-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>
> New in v2.
>
> src/PVE/API2/Qemu.pm | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
> index ebbfcb1b..9540db86 100644
> --- a/src/PVE/API2/Qemu.pm
> +++ b/src/PVE/API2/Qemu.pm
> @@ -5012,8 +5012,12 @@ __PACKAGE__->register_method({
> $conf->{$disk} = PVE::QemuServer::print_drive($newdrive);
>
> if (!$param->{delete}) {
> - my $unused_key = PVE::QemuConfig->add_unused_volume($conf, $old_volid);
> - print("adding source volume '$old_volid' as '$unused_key' to config\n");
> + eval {
> + my $unused_key = PVE::QemuConfig->add_unused_volume($conf, $old_volid);
> + print("adding source volume '$old_volid' as '$unused_key' to config\n");
> + };
> + log_warn("cannot add source volume '$old_volid' as unused to config - $@")
> + if $@;
> }
>
> # convert moved disk to base if part of template
next prev parent reply other threads:[~2026-10-30 10:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 12:06 [PATCH-SERIES qemu-server v2 0/7] fix #8209: clone disk: do not ignore failure to query size of target Fiona Ebner
2026-10-29 12:06 ` [PATCH qemu-server v2 1/7] block job: monitor: document that job-complete is not used if source differs from target Fiona Ebner
2026-10-30 10:37 ` Elias Huhsovitz
2026-10-29 12:06 ` [PATCH qemu-server v2 2/7] drive: get tpm state size: also warn if there was no size returned Fiona Ebner
2026-10-30 10:39 ` Elias Huhsovitz
2026-10-29 12:06 ` [PATCH qemu-server v2 3/7] api: clone disk: downgrade failure to register unused volume to warning Fiona Ebner
2026-10-30 10:56 ` Elias Huhsovitz [this message]
2026-10-29 12:06 ` [PATCH qemu-server v2 4/7] fix #8209: clone disk: do not ignore failure to query size of target Fiona Ebner
2026-10-30 10:36 ` Elias Huhsovitz
2026-10-29 12:06 ` [PATCH qemu-server v2 5/7] clone disk: abort early when failing to query size of source disk Fiona Ebner
2026-10-29 12:06 ` [PATCH qemu-server v2 6/7] drive: get tpm state size: add timeout parameter Fiona Ebner
2026-10-30 11:02 ` Elias Huhsovitz
2026-10-29 12:06 ` [PATCH qemu-server v2 7/7] clone disk: bump timeout for querying volume sizes to 1 minute Fiona Ebner
2026-10-30 11:14 ` Elias Huhsovitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DMI49V1MBFAD.325H924PHV1G5@proxmox.com \
--to=e.huhsovitz@proxmox.com \
--cc=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox