[pve-devel] [PATCH qemu-server v2 1/5] add create and remove reboot trigger subs

Dominik Csapak d.csapak at proxmox.com
Fri Aug 23 10:55:56 CEST 2019


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
new in v2
 PVE/QemuServer.pm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 9f5bf56..d1767a9 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -7369,6 +7369,18 @@ sub nbd_stop {
     vm_mon_cmd($vmid, 'nbd-server-stop');
 }
 
+sub create_reboot_trigger {
+    my ($vmid) = @_;
+    open(my $fh, '>', "/run/qemu-server/$vmid.reboot")
+	or die "failed to create reboot trigger file: $!\n";
+    close($fh);
+}
+
+sub remove_reboot_trigger {
+    my ($vmid) = @_;
+    return unlink("/run/qemu-server/$vmid.reboot");
+}
+
 # bash completion helper
 
 sub complete_backup_archives {
-- 
2.20.1





More information about the pve-devel mailing list