]> git.proxmox.com Git - qemu-server.git/commitdiff
destroy VM: also check if unused volumes are base images
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 19 Apr 2021 08:46:43 +0000 (10:46 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 28 May 2021 10:12:50 +0000 (12:12 +0200)
It's arguably not likely in practice that only an unused volume is still in use
as a base image, but do it for completeness sake.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/QemuServer.pm

index e0039cb9f13d212ec931e9cc2a5bcfaa3c680837..1b2c65e894fe94c1c66e0587f37304ed99993cdb 100644 (file)
@@ -2127,7 +2127,7 @@ sub destroy_vm {
 
     if ($conf->{template}) {
        # check if any base image is still used by a linked clone
-       PVE::QemuConfig->foreach_volume($conf, sub {
+       PVE::QemuConfig->foreach_volume_full($conf, { include_unused => 1 }, sub {
                my ($ds, $drive) = @_;
                return if drive_is_cdrom($drive);