* [PATCH] Error in Xend-API method VM_set_actions_after_crash
@ 2010-07-27 9:07 Dube, Lutz
2010-07-27 15:02 ` Jim Fehlig
0 siblings, 1 reply; 7+ messages in thread
From: Dube, Lutz @ 2010-07-27 9:07 UTC (permalink / raw)
To: xen-devel@lists.xensource.com
[-- Attachment #1.1: Type: text/plain, Size: 3702 bytes --]
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@ts.fujitsu.com<mailto:Lutz.Dube@ts.fujitsu.com>
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@ts.fujitsu.com
Internet: http://ts.fujitsu.com<http://ts.fujitsu.com/>
Firmenangaben: http://de.ts.fujitsu.com/imprint.html
[-- Attachment #1.2: Type: text/html, Size: 7166 bytes --]
[-- Attachment #2: patch.coredump --]
[-- Type: application/octet-stream, Size: 3333 bytes --]
# HG changeset patch
# User root@abgskidoo
# Date 1279698730 -7200
# Node ID dcd575d8a83ba131c10c580d737426f5a46a2347
# Parent 8963f83ba73b16cf09c9a1dec3d80c7b5ffab6df
Error in Xend-API method VM_set_actions_after_crash
Xend-API defines the method VM_set_actions_after_crash with vaild 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.
Signed-off-by: Lutz Dube Lutz.Dube@ts.fujitsu.com
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,
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Error in Xend-API method VM_set_actions_after_crash
2010-07-27 9:07 [PATCH] Error in Xend-API method VM_set_actions_after_crash Dube, Lutz
@ 2010-07-27 15:02 ` Jim Fehlig
2010-07-27 15:08 ` Keir Fraser
2010-07-27 15:54 ` [PATCH] Error in Xend-API method VM_set_actions_after_crash [and 1 more messages] Ian Jackson
0 siblings, 2 replies; 7+ messages in thread
From: Jim Fehlig @ 2010-07-27 15:02 UTC (permalink / raw)
To: Dube, Lutz; +Cc: xen-devel@lists.xensource.com
Dube, Lutz wrote:
> 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.
I've had similar reports when using legacy python config files and
xend's xmlrpc interface. I'll post a patch for that soon.
Your patch looks good, although I've not tested it.
>
> Could you please apply my patch to xen-4-0-testing, too.
It sounds like this will be the primary target for xend fixes going
forward. How long will, if at all, will xend bug fixes be applied to
-unstable?
Regards,
Jim
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Error in Xend-API method VM_set_actions_after_crash
2010-07-27 15:02 ` Jim Fehlig
@ 2010-07-27 15:08 ` Keir Fraser
2010-07-27 15:21 ` Jim Fehlig
2010-07-27 15:45 ` Ian Jackson
2010-07-27 15:54 ` [PATCH] Error in Xend-API method VM_set_actions_after_crash [and 1 more messages] Ian Jackson
1 sibling, 2 replies; 7+ messages in thread
From: Keir Fraser @ 2010-07-27 15:08 UTC (permalink / raw)
To: Jim Fehlig, Dube, Lutz; +Cc: xen-devel@lists.xensource.com
On 27/07/2010 16:02, "Jim Fehlig" <jfehlig@novell.com> wrote:
>> Could you please apply my patch to xen-4-0-testing, too.
>
> It sounds like this will be the primary target for xend fixes going
> forward. How long will, if at all, will xend bug fixes be applied to
> -unstable?
While xend continues to exist in xen-unstable, fixes should go there first,
no?
-- Keir
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Error in Xend-API method VM_set_actions_after_crash
2010-07-27 15:08 ` Keir Fraser
@ 2010-07-27 15:21 ` Jim Fehlig
2010-07-27 16:45 ` Ian Jackson
2010-07-27 15:45 ` Ian Jackson
1 sibling, 1 reply; 7+ messages in thread
From: Jim Fehlig @ 2010-07-27 15:21 UTC (permalink / raw)
To: Keir Fraser; +Cc: Dube, Lutz, xen-devel@lists.xensource.com
Keir Fraser wrote:
> On 27/07/2010 16:02, "Jim Fehlig" <jfehlig@novell.com> wrote:
>
>
>>> Could you please apply my patch to xen-4-0-testing, too.
>>>
>> It sounds like this will be the primary target for xend fixes going
>> forward. How long will, if at all, will xend bug fixes be applied to
>> -unstable?
>>
>
> While xend continues to exist in xen-unstable, fixes should go there first,
> no?
>
Err, yes :-). Recent comments had me assuming xend's life support was
about to be terminated.
Regards,
Jim
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Error in Xend-API method VM_set_actions_after_crash
2010-07-27 15:21 ` Jim Fehlig
@ 2010-07-27 16:45 ` Ian Jackson
0 siblings, 0 replies; 7+ messages in thread
From: Ian Jackson @ 2010-07-27 16:45 UTC (permalink / raw)
To: Jim Fehlig; +Cc: xen-devel@lists.xensource.com, Dube, Lutz, Keir Fraser
Jim Fehlig writes ("Re: [Xen-devel] [PATCH] Error in Xend-API method VM_set_actions_after_crash"):
> Err, yes :-). Recent comments had me assuming xend's life support was
> about to be terminated.
We don't plan to remove it from the tree until after 4.1, at the
earliest.
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Error in Xend-API method VM_set_actions_after_crash
2010-07-27 15:08 ` Keir Fraser
2010-07-27 15:21 ` Jim Fehlig
@ 2010-07-27 15:45 ` Ian Jackson
1 sibling, 0 replies; 7+ messages in thread
From: Ian Jackson @ 2010-07-27 15:45 UTC (permalink / raw)
To: Keir Fraser; +Cc: Jim Fehlig, Dube, Lutz, xen-devel@lists.xensource.com
Keir Fraser writes ("Re: [Xen-devel] [PATCH] Error in Xend-API method VM_set_actions_after_crash"):
> On 27/07/2010 16:02, "Jim Fehlig" <jfehlig@novell.com> wrote:
> > It sounds like this will be the primary target for xend fixes going
> > forward. How long will, if at all, will xend bug fixes be applied to
> > -unstable?
>
> While xend continues to exist in xen-unstable, fixes should go there first,
> no?
Yes.
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Error in Xend-API method VM_set_actions_after_crash [and 1 more messages]
2010-07-27 15:02 ` Jim Fehlig
2010-07-27 15:08 ` Keir Fraser
@ 2010-07-27 15:54 ` Ian Jackson
1 sibling, 0 replies; 7+ messages in thread
From: Ian Jackson @ 2010-07-27 15:54 UTC (permalink / raw)
To: Jim Fehlig, Dube, Lutz; +Cc: xen-devel@lists.xensource.com
Dube, Lutz writes ("[Xen-devel] [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.
Thanks, I've applied this patch.
> Could you please apply my patch to xen-4-0-testing, too.
We'll test it in xen-unstable first, and cherry-pick it later.
Jim Fehlig writes ("Re: [Xen-devel] [PATCH] Error in Xend-API method VM_set_actions_after_crash"):
> Your patch looks good, although I've not tested it.
Thanks for the review. I've taken that as an ack of this patch. For
reference, explicitly writing
Acked-by: Your Name <email@example.com>
is very helpful.
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-07-27 16:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 9:07 [PATCH] Error in Xend-API method VM_set_actions_after_crash Dube, Lutz
2010-07-27 15:02 ` Jim Fehlig
2010-07-27 15:08 ` Keir Fraser
2010-07-27 15:21 ` Jim Fehlig
2010-07-27 16:45 ` Ian Jackson
2010-07-27 15:45 ` Ian Jackson
2010-07-27 15:54 ` [PATCH] Error in Xend-API method VM_set_actions_after_crash [and 1 more messages] Ian Jackson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.