5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-08-03 04:21:54 +03:00

blockdev: delete: delete format block node first

Nodes need to be deleted from top to bottom. See also commit 32102c06
("blockdev: blockdev replace: delete format block node first").

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250731104935.53039-2-f.ebner@proxmox.com
This commit is contained in:
Fiona Ebner
2025-07-31 12:48:46 +02:00
committed by Thomas Lamprecht
parent f06f3a3c4a
commit 4a0952d985

View File

@ -874,8 +874,8 @@ sub blockdev_delete {
my ($storecfg, $vmid, $drive, $file_blockdev, $fmt_blockdev, $snap) = @_;
#add eval as reopen is auto removing the old nodename automatically only if it was created at vm start in command line argument
eval { mon_cmd($vmid, 'blockdev-del', 'node-name' => $file_blockdev->{'node-name'}) };
eval { mon_cmd($vmid, 'blockdev-del', 'node-name' => $fmt_blockdev->{'node-name'}) };
eval { mon_cmd($vmid, 'blockdev-del', 'node-name' => $file_blockdev->{'node-name'}) };
#delete the file (don't use vdisk_free as we don't want to delete all snapshot chain)
print "delete old $file_blockdev->{filename}\n";