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

Stefan Reiter s.reiter at proxmox.com
Wed Mar 3 10:56:11 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>
---

v2:
* unchanged

 PVE/QemuServer.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index e420de3..233441e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6356,6 +6356,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
@@ -6377,6 +6379,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