[pve-devel] [PATCH 09/11] add watchdog device and watchdog option

Derumier Alexandre aderumier at odiso.com
Wed Sep 7 15:34:44 CEST 2011


new vm config values :

watchdog: i6300esb (default) / ib700
watchdogaction: reset (default)/shutdown/poweroff/pause/debug/none

Signed-off-by: Derumier Alexandre <aderumier at odiso.com>
---
 PVE/QemuServer.pm |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a6ef452..5cce444 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -286,6 +286,16 @@ EODESC
 	description => "Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'. Default is 'std' for win7/w2k8, and 'cirrur' for other OS types",
 	enum => [qw(std cirrus vmware)],
     },
+    watchdog => {
+        optional => 1,
+        type => 'string',
+        description => "Watchdog model (i6300esb/ib700)",
+    },
+    watchdogaction => {
+        optional => 1,
+        type => 'string',
+        description => "Action on watchdog event reset/shutdown/poweroff/pause/debug/none",
+    },
     hostpci => {
 	optional => 1,
         type => 'string', format => 'pve-qm-hostpci',
@@ -2027,6 +2037,12 @@ sub config_to_command {
     my $kb = $conf->{keyboard} || $defaults->{keyboard};
     push @$cmd, '-k', $kb if $kb;
 
+    # enable watchdog device
+    my $watchdog = $conf->{watchdog} || $defaults->{watchdog};
+    push @$cmd, '-device', $watchdog.',id=watchdog0' if $watchdog;
+    my $watchdogaction = $conf->{watchdogaction} || $defaults->{watchdogaction};
+    push @$cmd, '-watchdog-action', $watchdogaction if $watchdogaction;
+
     # enable sound
     my $soundhw = $conf->{soundhw} || $defaults->{soundhw};
     push @$cmd, '-device', $soundhw.',id=sound0' if $soundhw;
-- 
1.7.2.5



More information about the pve-devel mailing list