[pve-devel] [PATCH qemu-server 10/11] live-restore: register qmeventd handle

Stefan Reiter s.reiter at proxmox.com
Mon Jan 11 12:14:08 CET 2021


Similar to backups, prevent QEMU from being killed by qmeventd during
the live-restore, so a guest can shut itself down without aborting the
restore operation.

Note that the 'close' is only to be explicit, the handle will also be
closed in case an operation errors (i.e. when the 'eval' is left).

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 PVE/QemuServer.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index aa88a9d..e22fbed 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6331,6 +6331,8 @@ sub pbs_live_restore {
 	    {},
 	);
 
+	my $qmeventd_fd = register_qmeventd_handle($vmid);
+
 	# begin streaming, i.e. data copy from PBS to target disk for every vol,
 	# this will effectively collapse the backing image chain consisting of
 	# [target <- alloc-track -> PBS snapshot] to just [target] (alloc-track
@@ -6352,6 +6354,8 @@ sub pbs_live_restore {
 	foreach my $ds (keys %$restored_disks) {
 	    mon_cmd($vmid, 'blockdev-del', 'node-name' => "$ds-pbs");
 	}
+
+	close($qmeventd_fd);
     };
 
     my $err = $@;
-- 
2.20.1





More information about the pve-devel mailing list