diff options
| author | Ian Campbell <ian.campbell@citrix.com> | 2011-12-21 10:47:11 +0000 | 
|---|---|---|
| committer | Ian Campbell <ian.campbell@citrix.com> | 2011-12-21 10:47:11 +0000 | 
| commit | 79e162885078a9daaaf9679d547aaa65c78e3559 (patch) | |
| tree | 48ad30dd5f08cf7956cf756f566dbeabb6ac1913 /tools/python/xen | |
| parent | 1a061168bd1ded7ba5623100f1890288fc8e6afc (diff) | |
| download | xen-79e162885078a9daaaf9679d547aaa65c78e3559.tar.gz xen-79e162885078a9daaaf9679d547aaa65c78e3559.tar.bz2 xen-79e162885078a9daaaf9679d547aaa65c78e3559.zip  | |
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>
Diffstat (limited to 'tools/python/xen')
| -rw-r--r-- | tools/python/xen/lowlevel/xl/xl.c | 21 | 
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/python/xen/lowlevel/xl/xl.c b/tools/python/xen/lowlevel/xl/xl.c index 041daadc81..c916e2f54f 100644 --- a/tools/python/xen/lowlevel/xl/xl.c +++ b/tools/python/xen/lowlevel/xl/xl.c @@ -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,  | 
