2012-09-17 17:49:23 +02:00
|
|
|
Index: xen-4.2.0-testing/tools/python/xen/xm/create.py
|
2011-07-01 21:31:25 +02:00
|
|
|
===================================================================
|
2012-09-17 17:49:23 +02:00
|
|
|
--- xen-4.2.0-testing.orig/tools/python/xen/xm/create.py
|
|
|
|
+++ xen-4.2.0-testing/tools/python/xen/xm/create.py
|
2011-07-01 21:31:25 +02:00
|
|
|
@@ -535,6 +535,21 @@ gopts.var('usbdevice', val='NAME',
|
|
|
|
fn=set_value, default='',
|
|
|
|
use="Name of USB device to add?")
|
|
|
|
|
|
|
|
+gopts.var('watchdog', val='NAME',
|
|
|
|
+ fn=set_value, default='',
|
|
|
|
+ use="Watchdog device to use. May be ib700 or i6300esb")
|
|
|
|
+
|
|
|
|
+gopts.var('watchdog_action', val='reset|shutdown|poweroff|pause|none|dump',
|
|
|
|
+ fn=set_value, default="reset",
|
|
|
|
+ use="""Action when watchdog timer expires:
|
|
|
|
+ - reset: Default, forcefully reset the guest;
|
|
|
|
+ - shutdown: Gracefully shutdown the guest (not recommended);
|
|
|
|
+ - poweroff: Forcefully power off the guest;
|
|
|
|
+ - pause: Pause the guest;
|
|
|
|
+ - none: Do nothing;
|
|
|
|
+ - dump: Automatically dump the guest;
|
|
|
|
+ """)
|
|
|
|
+
|
|
|
|
gopts.var('description', val='NAME',
|
|
|
|
fn=set_value, default='',
|
|
|
|
use="Description of a domain")
|
2012-09-17 17:49:23 +02:00
|
|
|
@@ -1097,6 +1112,7 @@ def configure_hvm(config_image, vals):
|
2011-07-01 21:31:25 +02:00
|
|
|
'usb', 'usbdevice',
|
|
|
|
'vcpus', 'vnc', 'vncconsole', 'vncdisplay', 'vnclisten',
|
|
|
|
'vncunused', 'viridian', 'vpt_align',
|
|
|
|
+ 'watchdog', 'watchdog_action',
|
|
|
|
'xauthority', 'xen_extended_power_mgmt', 'xen_platform_pci',
|
|
|
|
'memory_sharing' ]
|
|
|
|
|
2012-09-17 17:49:23 +02:00
|
|
|
Index: xen-4.2.0-testing/tools/python/xen/xm/xenapi_create.py
|
2011-07-01 21:31:25 +02:00
|
|
|
===================================================================
|
2012-09-17 17:49:23 +02:00
|
|
|
--- xen-4.2.0-testing.orig/tools/python/xen/xm/xenapi_create.py
|
|
|
|
+++ xen-4.2.0-testing/tools/python/xen/xm/xenapi_create.py
|
2011-07-01 21:31:25 +02:00
|
|
|
@@ -1113,7 +1113,9 @@ class sxp2xml:
|
|
|
|
'xen_platform_pci',
|
|
|
|
'tsc_mode'
|
|
|
|
'description',
|
|
|
|
- 'nomigrate'
|
|
|
|
+ 'nomigrate',
|
|
|
|
+ 'watchdog',
|
|
|
|
+ 'watchdog_action'
|
|
|
|
]
|
|
|
|
|
|
|
|
platform_configs = []
|
2012-09-17 17:49:23 +02:00
|
|
|
Index: xen-4.2.0-testing/tools/python/xen/xend/image.py
|
2011-07-01 21:31:25 +02:00
|
|
|
===================================================================
|
2012-09-17 17:49:23 +02:00
|
|
|
--- xen-4.2.0-testing.orig/tools/python/xen/xend/image.py
|
|
|
|
+++ xen-4.2.0-testing/tools/python/xen/xend/image.py
|
|
|
|
@@ -855,7 +855,8 @@ class HVMImageHandler(ImageHandler):
|
2011-07-01 21:31:25 +02:00
|
|
|
|
|
|
|
dmargs = [ 'boot', 'fda', 'fdb', 'soundhw',
|
|
|
|
'localtime', 'serial', 'stdvga', 'isa',
|
|
|
|
- 'acpi', 'usb', 'usbdevice', 'gfx_passthru' ]
|
|
|
|
+ 'acpi', 'usb', 'usbdevice', 'gfx_passthru',
|
|
|
|
+ 'watchdog', 'watchdog_action' ]
|
|
|
|
|
|
|
|
for a in dmargs:
|
|
|
|
v = vmConfig['platform'].get(a)
|
2012-09-17 17:49:23 +02:00
|
|
|
@@ -863,6 +864,7 @@ class HVMImageHandler(ImageHandler):
|
2011-07-01 21:31:25 +02:00
|
|
|
# python doesn't allow '-' in variable names
|
|
|
|
if a == 'stdvga': a = 'std-vga'
|
|
|
|
if a == 'keymap': a = 'k'
|
|
|
|
+ if a == 'watchdog_action': a = 'watchdog-action'
|
|
|
|
|
|
|
|
# Handle booleans gracefully
|
|
|
|
if a in ['localtime', 'std-vga', 'isa', 'usb', 'acpi']:
|
2012-09-17 17:49:23 +02:00
|
|
|
Index: xen-4.2.0-testing/tools/python/xen/xend/XendConfig.py
|
2011-07-01 21:31:25 +02:00
|
|
|
===================================================================
|
2012-09-17 17:49:23 +02:00
|
|
|
--- xen-4.2.0-testing.orig/tools/python/xen/xend/XendConfig.py
|
|
|
|
+++ xen-4.2.0-testing/tools/python/xen/xend/XendConfig.py
|
|
|
|
@@ -192,6 +192,8 @@ XENAPI_PLATFORM_CFG_TYPES = {
|
2011-07-01 21:31:25 +02:00
|
|
|
'xen_platform_pci': int,
|
|
|
|
"gfx_passthru": int,
|
|
|
|
'oos' : int,
|
|
|
|
+ 'watchdog': str,
|
|
|
|
+ 'watchdog_action': str,
|
|
|
|
}
|
|
|
|
|
|
|
|
# Xen API console 'other_config' keys.
|
2012-09-17 17:49:23 +02:00
|
|
|
Index: xen-4.2.0-testing/tools/libxl/libxl_dm.c
|
2011-07-01 21:31:25 +02:00
|
|
|
===================================================================
|
2012-09-17 17:49:23 +02:00
|
|
|
--- xen-4.2.0-testing.orig/tools/libxl/libxl_dm.c
|
|
|
|
+++ xen-4.2.0-testing/tools/libxl/libxl_dm.c
|
|
|
|
@@ -196,6 +196,12 @@ static char ** libxl__build_device_model
|
|
|
|
"-usbdevice", b_info->u.hvm.usbdevice, NULL);
|
2011-07-01 21:31:25 +02:00
|
|
|
}
|
|
|
|
}
|
2012-09-17 17:49:23 +02:00
|
|
|
+ if (b_info->u.hvm.watchdog || b_info->u.hvm.watchdog_action) {
|
2011-07-01 21:31:25 +02:00
|
|
|
+ flexarray_append(dm_args, "-watchdog");
|
2012-09-17 17:49:23 +02:00
|
|
|
+ if (b_info->u.hvm.watchdog_action) {
|
|
|
|
+ flexarray_vappend(dm_args, "-watchdog-action", b_info->u.hvm.watchdog_action, NULL);
|
2011-07-01 21:31:25 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
2012-09-17 17:49:23 +02:00
|
|
|
if (b_info->u.hvm.soundhw) {
|
|
|
|
flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
|
2011-07-01 21:31:25 +02:00
|
|
|
}
|
2012-09-17 17:49:23 +02:00
|
|
|
@@ -449,6 +455,12 @@ static char ** libxl__build_device_model
|
|
|
|
"-usbdevice", b_info->u.hvm.usbdevice, NULL);
|
2011-07-01 21:31:25 +02:00
|
|
|
}
|
|
|
|
}
|
2012-09-17 17:49:23 +02:00
|
|
|
+ if (b_info->u.hvm.watchdog || b_info->u.hvm.watchdog_action) {
|
2011-07-01 21:31:25 +02:00
|
|
|
+ flexarray_append(dm_args, "-watchdog");
|
2012-09-17 17:49:23 +02:00
|
|
|
+ if (b_info->u.hvm.watchdog_action) {
|
|
|
|
+ flexarray_vappend(dm_args, "-watchdog-action", b_info->u.hvm.watchdog_action, NULL);
|
2011-07-01 21:31:25 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
2012-09-17 17:49:23 +02:00
|
|
|
if (b_info->u.hvm.soundhw) {
|
|
|
|
flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
|
2011-07-01 21:31:25 +02:00
|
|
|
}
|
2012-09-17 17:49:23 +02:00
|
|
|
Index: xen-4.2.0-testing/tools/libxl/libxl_types.idl
|
2011-07-01 21:31:25 +02:00
|
|
|
===================================================================
|
2012-09-17 17:49:23 +02:00
|
|
|
--- xen-4.2.0-testing.orig/tools/libxl/libxl_types.idl
|
|
|
|
+++ xen-4.2.0-testing/tools/libxl/libxl_types.idl
|
2013-01-14 18:52:04 +01:00
|
|
|
@@ -320,6 +320,8 @@ libxl_domain_build_info = Struct("domain
|
2012-09-17 17:49:23 +02:00
|
|
|
("usbdevice", string),
|
|
|
|
("soundhw", string),
|
|
|
|
("xen_platform_pci", libxl_defbool),
|
|
|
|
+ ("watchdog", string),
|
|
|
|
+ ("watchdog_action", string),
|
|
|
|
])),
|
|
|
|
("pv", Struct(None, [("kernel", string),
|
|
|
|
("slack_memkb", MemKB),
|
|
|
|
Index: xen-4.2.0-testing/tools/libxl/xl_cmdimpl.c
|
2011-07-01 21:31:25 +02:00
|
|
|
===================================================================
|
2012-09-17 17:49:23 +02:00
|
|
|
--- xen-4.2.0-testing.orig/tools/libxl/xl_cmdimpl.c
|
|
|
|
+++ xen-4.2.0-testing/tools/libxl/xl_cmdimpl.c
|
2013-01-14 18:52:04 +01:00
|
|
|
@@ -1412,6 +1412,8 @@ skip_vfb:
|
2012-09-17 17:49:23 +02:00
|
|
|
xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
|
|
|
|
xlu_cfg_get_defbool(config, "xen_platform_pci",
|
|
|
|
&b_info->u.hvm.xen_platform_pci, 0);
|
|
|
|
+ xlu_cfg_replace_string (config, "watchdog", &b_info->u.hvm.watchdog, 0);
|
|
|
|
+ xlu_cfg_replace_string (config, "watchdog_action", &b_info->u.hvm.watchdog_action, 0);
|
|
|
|
}
|
2011-07-01 21:31:25 +02:00
|
|
|
|
2012-09-17 17:49:23 +02:00
|
|
|
xlu_cfg_destroy(config);
|