[PATCH qemu-server 2/3] api: disk move: print description of core operations to task log

Fiona Ebner
2026-04-01T09:52:32Z

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/API2/Qemu.pm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 09f88ae1..2a1e3854 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -4802,6 +4802,9 @@ __PACKAGE__->register_method({
"move disk VM $vmid: move --disk $disk --storage $storeid",
);

+ print("copying volume '$old_volid' from current storage '$oldstoreid' to target"
+ . " storage '$storeid'\n");
+
my $running = PVE::QemuServer::check_running($vmid);

PVE::Storage::activate_volumes($storecfg, [$drive->{file}]);
@@ -4851,7 +4854,10 @@ __PACKAGE__->register_method({
);
$conf->{$disk} = PVE::QemuServer::print_drive($newdrive);

- PVE::QemuConfig->add_unused_volume($conf, $old_volid) if !$param->{delete};
+ 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");
+ }

# convert moved disk to base if part of template
PVE::QemuServer::template_create($vmid, $conf, $disk)
@@ -4880,6 +4886,7 @@ __PACKAGE__->register_method({
}

if ($param->{delete}) {
+ print("removing source volume '$old_volid' after successful copy\n");
eval {
PVE::Storage::deactivate_volumes($storecfg, [$old_volid]);
PVE::Storage::vdisk_free($storecfg, $old_volid);
--
2.47.3