WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Error in Xend-API method VM_set_actions_after_crash

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Error in Xend-API method VM_set_actions_after_crash
From: "Dube, Lutz" <lutz.dube@xxxxxxxxxxxxxx>
Date: Tue, 27 Jul 2010 11:07:16 +0200
Accept-language: de-DE, en-US
Acceptlanguage: de-DE, en-US
Delivery-date: Tue, 27 Jul 2010 02:08:16 -0700
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=lutz.dube@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1280222027; x=1311758027; h=from:to:date:subject:message-id:mime-version; z=From:=20"Dube,=20Lutz"=20<lutz.dube@xxxxxxxxxxxxxx>|To: =20"xen-devel@xxxxxxxxxxxxxxxxxxx"=20<xen-devel@xxxxxxxxx source.com>|Date:=20Tue,=2027=20Jul=202010=2011:07:16=20+ 0200|Subject:=20[PATCH]=20Error=20in=20Xend-API=20method =20VM_set_actions_after_crash|Message-ID:=20<3958B14F314B 884890EEE2F4CCDAB6A601122BDC5527@xxxxxxxxxxxxxxxx> |MIME-Version:=201.0; bh=q3I8yG9JxweBuECJIDyoN8rqBiKKhsOvX4qspS9Mncs=; b=oxOQQSNpUbzdUQpCqehACuaTFGUSfSJXAMSmwZsT6i+PBeLAQ08aeq2L 4gul411Pp73SWrT8gp1+fuUmZ/WYaC66UVNue6RKa0o0M/NzU7x5N8jnZ pTUh9sJDtK6cSsRhX8yPoRD3g5fwmIGGDZwkJZ8kS1fnhTd02moP3P7eN 04wv8O7ye5LXZV8Dg5lw+qJBC2hck9bdWDBdW3NTy+NBE7ydfFPLTjWII w0lAjabAJKsHVhSgkCr0Y2BIDumI8;
Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:Received:From:To:Date: Subject:Thread-Topic:Thread-Index:Message-ID: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:acceptlanguage:Content-Type: MIME-Version; b=NnFKrbmCqZCg217j0tgZ1HbtzvOnYAT7u+oPNuk1qL8ug8bnn0jAa797 LbKJS3AJW3SHE3fYfrThAJDyEluvnx8KRqmA0jN2CbzdtuCjL0q/ogLjv WtiwSIS2PmGl8Q6v0OPJInwev9EYYWZhD4fomfBB4jc88G0E8zrpvk3Y6 agHYiBkW8ost/3Gpx0CTMrnyxUVfT99viun26HHeQtKXJEfiQJ/lM0zXs nTmQxQNqEXYySuEaP/ZI2ejWZjBEd;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acstaxw64m3v7pcDR1Sse2trqiYtxw==
Thread-topic: [PATCH] Error in Xend-API method VM_set_actions_after_crash
Xend-API defines the method VM_set_actions_after_crash with valid action
names coredump_and_destroy, coredump_and_restart,... . These values have to
be converted into internal representation “coredump-destroy”, “coredump-restart”, …
otherwise start of the domain is rejected.
Same error occurs, if I try to create a VM using the Xend-API with
actions_after_crash set to coredump_and_destroy.
 
Could you please apply my patch to xen-4-0-testing, too.
 
Signed-off-by: Lutz Dube Lutz.Dube@xxxxxxxxxxxxxx
 
diff -r 8963f83ba73b -r dcd575d8a83b tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Tue Jul 20 17:56:07 2010 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Wed Jul 21 09:52:10 2010 +0200
@@ -1701,7 +1701,8 @@
     def VM_set_actions_after_crash(self, session, vm_ref, action):
         if action not in XEN_API_ON_CRASH_BEHAVIOUR:
             return xen_api_error(['VM_ON_CRASH_BEHAVIOUR_INVALID', vm_ref])
-        return self.VM_set('actions_after_crash', session, vm_ref, action)
+        return self.VM_set('actions_after_crash', session, vm_ref,
+                XEN_API_ON_CRASH_BEHAVIOUR_LEGACY[action])
 
     def VM_set_HVM_boot_policy(self, session, vm_ref, value):
         if value != "" and value != "BIOS order":
diff -r 8963f83ba73b -r dcd575d8a83b tools/python/xen/xend/XendAPIConstants.py
--- a/tools/python/xen/xend/XendAPIConstants.py Tue Jul 20 17:56:07 2010 +0100
+++ b/tools/python/xen/xend/XendAPIConstants.py Wed Jul 21 09:52:10 2010 +0200
@@ -63,6 +63,18 @@
     'rename_restart' : 'rename_restart',
}
 
+XEN_API_ON_CRASH_BEHAVIOUR_LEGACY = {
+    'destroy' : 'destroy',
+    'coredump-destroy' : 'coredump-destroy',
+    'coredump_and_destroy' : 'coredump-destroy',
+    'restart' : 'restart',
+    'coredump-restart' : 'coredump-restart',
+    'coredump_and_restart' : 'coredump-restart',
+    'preserve' : 'preserve',
+    'rename-restart' : 'rename-restart',
+    'rename_restart' : 'rename-restart',
+}
+
XEN_API_VBD_MODE = ['RO', 'RW']
XEN_API_VDI_TYPE = ['system', 'user', 'ephemeral']
XEN_API_VBD_TYPE = ['CD', 'Disk']
diff -r 8963f83ba73b -r dcd575d8a83b tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Tue Jul 20 17:56:07 2010 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Wed Jul 21 09:52:10 2010 +0200
@@ -41,6 +41,7 @@
from xen.xend.XendSXPDev import dev_dict_to_sxp
from xen.util import xsconstants
from xen.util import auxbin
+from xen.xend.XendAPIConstants import *
import xen.util.fileuri
 
log = logging.getLogger("xend.XendConfig")
@@ -61,6 +62,11 @@
 
def bool0(v):
     return v != '0' and v != 'False' and bool(v)
+
+def convert_on_crash(v):
+    v = str(v)
+    return XEN_API_ON_CRASH_BEHAVIOUR_LEGACY[v] \
+            if v in XEN_API_ON_CRASH_BEHAVIOUR else v
 
# Recursively copy a data struct, scrubbing out VNC passwords.
# Will scrub any dict entry with a key of 'vncpasswd' or any
@@ -212,7 +218,7 @@
     'VCPUs_live': int,
     'actions_after_shutdown': str,
     'actions_after_reboot': str,
-    'actions_after_crash': str,
+    'actions_after_crash': convert_on_crash,
     'PV_bootloader': str,
     'PV_kernel': str,
     'PV_ramdisk': str,
 
 
---
Mit freundlichen Grüßen
 
Lutz Dube
Softwareentwickler
TSP ES&S SWE OS7
 
FUJITSU TECHNOLOGY SOLUTIONS GMBH
Domagkstr. 28
D-80807 München
 
Telefon:        +49 (0)89 3222 2688
Telefax:        +49 (0)89 3222 329 2688
Email:          Lutz Dube@xxxxxxxxxxxxxx
 
Internet:        http://ts.fujitsu.com
 
 
 
 

Attachment: patch.coredump
Description: patch.coredump

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel