all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Fiona Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server] fix #6713: snapshot volume chain: fix snapshot after disk move with zeroinit
Date: Fri, 19 Sep 2025 15:38:00 +0200	[thread overview]
Message-ID: <160ecea1-21ca-431d-baea-6ecdce09da04@proxmox.com> (raw)
In-Reply-To: <20250919120848.60751-1-f.ebner@proxmox.com>

Tested by moving a disk from RBD to a directory storage with snapshot 
chains enabled. Verified without the patch that the error in the bug 
still happens.
Then tested again after a cold boot of the VM with the patch. Rollback 
also worked.

Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>

On  2025-09-19  14:09, Fiona Ebner wrote:
> After mirror, the node below throttle might not be the format node,
> but can also be a zeroinit node. In particular, this is the node that
> needs to be used by when replacing the blockdev for volume-chain
> snapshots for the 'current' snapshot. Look up the actually inserted
> node below throttle, rather than assuming that it's the format node.
> 
> Also removes the $src_file_blockdev_name variable that has been unused
> since commit e7cf7c00 ("blockdev: delete/replace: re-use detach()
> helper").
> 
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>   src/PVE/QemuServer/Blockdev.pm | 14 ++++++++++----
>   1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
> index d4062148..8e6749e8 100644
> --- a/src/PVE/QemuServer/Blockdev.pm
> +++ b/src/PVE/QemuServer/Blockdev.pm
> @@ -924,9 +924,15 @@ sub blockdev_replace {
>       my $volid = $drive->{file};
>       my $drive_id = PVE::QemuServer::Drive::get_drive_id($drive);
>   
> -    my $src_name_options = $src_snap eq 'current' ? {} : { 'snapshot-name' => $src_snap };
> -    my $src_file_blockdev_name = get_node_name('file', $drive_id, $volid, $src_name_options);
> -    my $src_fmt_blockdev_name = get_node_name('fmt', $drive_id, $volid, $src_name_options);
> +    my $src_name_options = {};
> +    my $src_blockdev_name;
> +    if ($src_snap eq 'current') {
> +        # there might be other nodes on top like zeroinit, look up the current node below throttle
> +        $src_blockdev_name = get_node_name_below_throttle($vmid, $deviceid, 1);
> +    } else {
> +        $src_name_options = { 'snapshot-name' => $src_snap };
> +        $src_blockdev_name = get_node_name('fmt', $drive_id, $volid, $src_name_options);
> +    }
>   
>       my $target_file_blockdev = generate_file_blockdev(
>           $storecfg,
> @@ -989,7 +995,7 @@ sub blockdev_replace {
>       }
>   
>       # delete old file|fmt nodes
> -    eval { detach($vmid, $src_fmt_blockdev_name); };
> +    eval { detach($vmid, $src_blockdev_name); };
>       warn "detaching block node for $src_snap failed - $@" if $@;
>   }
>   



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


      reply	other threads:[~2025-09-19 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 12:08 Fiona Ebner
2025-09-19 13:38 ` Aaron Lauterer [this message]

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=160ecea1-21ca-431d-baea-6ecdce09da04@proxmox.com \
    --to=a.lauterer@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal