libxl: split libxl_domain_shutdown into libxl_domain_shutdown,..._reboot

The other integer request types which shutdown supported are not
useful. Specifically:

 * "suspend" is not usable via this interface since it requires other
   scaffolding, libxl_domain_suspend provides this already.
 * "halt" is the same as "poweroff".
 * "crash" is unused and at least Linux does not implement it. If a user
   steps forward then libxl_domain_crash is trivial to add.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
This commit is contained in:
Ian Campbell committed 2011-12-21 10:47:11 +00:00
1 parent 1a061168bd
commit 79e1628850
4 files changed
+44 -28

No files matched your search

+18 -3
View File
@@ -424,10 +424,10 @@ static PyObject *pyxl_domid_to_name(XlObject *self, PyObject *args)
static PyObject *pyxl_domain_shutdown(XlObject *self, PyObject *args)
{
int domid, req = 0;
if ( !PyArg_ParseTuple(args, "i|i", &domid, &req) )
int domid;
if ( !PyArg_ParseTuple(args, "i", &domid) )
return NULL;
if ( libxl_domain_shutdown(self->ctx, domid, req) ) {
if ( libxl_domain_shutdown(self->ctx, domid) ) {
PyErr_SetString(xl_error_obj, "cannot shutdown domain");
return NULL;
}
@@ -435,6 +435,19 @@ static PyObject *pyxl_domain_shutdown(XlObject *self, PyObject *args)
return Py_None;
}
static PyObject *pyxl_domain_reboot(XlObject *self, PyObject *args)
{
int domid;
if ( !PyArg_ParseTuple(args, "i", &domid) )
return NULL;
if ( libxl_domain_reboot(self->ctx, domid) ) {
PyErr_SetString(xl_error_obj, "cannot reboot domain");
return NULL;
}
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *pyxl_domain_destroy(XlObject *self, PyObject *args)
{
int domid;
@@ -637,6 +650,8 @@ static PyMethodDef pyxl_methods[] = {
"Retrieve name from domain-id"},
{"domain_shutdown", (PyCFunction)pyxl_domain_shutdown, METH_VARARGS,
"Shutdown a domain"},
{"domain_reboot", (PyCFunction)pyxl_domain_reboot, METH_VARARGS,
"Reboot a domain"},
{"domain_destroy", (PyCFunction)pyxl_domain_destroy, METH_VARARGS,
"Destroy a domain"},
{"domain_pause", (PyCFunction)pyxl_domain_pause, METH_VARARGS,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.