mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1396 (4277318fhBrWTxIQcLWvjKyF4aX-_w)
Merge
This commit is contained in:
commit
34f6661b0a
77 files changed
+4801
-2498
No files matched your search
@@ -36,6 +36,33 @@ typedef struct {
|
||||
* Definitions for the 'xc' object type.
|
||||
*/
|
||||
|
||||
static PyObject *pyxc_domain_dumpcore(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
{
|
||||
XcObject *xc = (XcObject *)self;
|
||||
|
||||
u32 dom;
|
||||
char *corefile;
|
||||
|
||||
static char *kwd_list[] = { "dom", "corefile", NULL };
|
||||
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "is", kwd_list, &dom, &corefile) )
|
||||
goto exit;
|
||||
|
||||
if ( (corefile == NULL) || (corefile[0] == '\0') )
|
||||
goto exit;
|
||||
|
||||
if ( xc_domain_dumpcore(xc->xc_handle, dom, corefile) != 0 )
|
||||
return PyErr_SetFromErrno(xc_error);
|
||||
|
||||
Py_INCREF(zero);
|
||||
return zero;
|
||||
|
||||
exit:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static PyObject *pyxc_domain_create(PyObject *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
@@ -854,6 +881,14 @@ static PyMethodDef pyxc_methods[] = {
|
||||
" mem_kb [int, 0]: Memory allocation, in kilobytes.\n"
|
||||
"Returns: [int] new domain identifier; -1 on error.\n" },
|
||||
|
||||
{ "domain_dumpcore",
|
||||
(PyCFunction)pyxc_domain_dumpcore,
|
||||
METH_VARARGS | METH_KEYWORDS, "\n"
|
||||
"dump core of a domain.\n"
|
||||
" dom [int]: Identifier of domain to be paused.\n\n"
|
||||
" corefile [string]: Name of corefile to be created.\n\n"
|
||||
"Returns: [int] 0 on success; -1 on error.\n" },
|
||||
|
||||
{ "domain_pause",
|
||||
(PyCFunction)pyxc_domain_pause,
|
||||
METH_VARARGS | METH_KEYWORDS, "\n"
|
||||
|
||||
@@ -309,7 +309,9 @@ class XendDomain:
|
||||
eserver.inject('xend.domain.exit', [name, id, reason])
|
||||
self.domain_restart_schedule(id, reason)
|
||||
else:
|
||||
eserver.inject('xend.domain.exit', [name, id, 'crash'])
|
||||
if xroot.get_enable_dump() == 'true':
|
||||
xc.domain_dumpcore(dom = int(id), corefile = "/var/xen/dump/%s.%s.core"%(name,id))
|
||||
eserver.inject('xend.domain.exit', [name, id, 'crash'])
|
||||
destroyed += 1
|
||||
self.final_domain_destroy(id)
|
||||
if self.domain_restarts_exist():
|
||||
|
||||
@@ -296,6 +296,9 @@ class XendRoot:
|
||||
def get_network_script(self):
|
||||
return self.get_config_value('network-script', 'network')
|
||||
|
||||
def get_enable_dump(self):
|
||||
return self.get_config_value('enable-dump', 'false')
|
||||
|
||||
def get_vif_bridge(self):
|
||||
return self.get_config_value('vif-bridge', 'xen-br0')
|
||||
|
||||
|
||||