debuggers.hg

changeset 22774:f80eeb755b15

tools/python/pyxl: Export relevant integer constants from python wrapper

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Gianni Tedesco <gianni.tedesco@citrix.com>
date Tue Jan 11 18:56:48 2011 +0000 (2011-01-11)
parents 99da390ace2e
children 659ffaf66e88
files tools/python/xen/lowlevel/xl/xl.c
line diff
     1.1 --- a/tools/python/xen/lowlevel/xl/xl.c	Tue Jan 11 18:55:24 2011 +0000
     1.2 +++ b/tools/python/xen/lowlevel/xl/xl.c	Tue Jan 11 18:56:48 2011 +0000
     1.3 @@ -651,6 +651,8 @@ static PyTypeObject PyXlType = {
     1.4  
     1.5  static PyMethodDef xl_methods[] = { { NULL } };
     1.6  
     1.7 +#define  _INT_CONST(m, c) PyModule_AddIntConstant(m, #c, c)
     1.8 +#define  _INT_CONST_LIBXL(m, c) PyModule_AddIntConstant(m, #c, LIBXL_ ## c)
     1.9  PyMODINIT_FUNC initxl(void)
    1.10  {
    1.11      PyObject *m;
    1.12 @@ -671,6 +673,36 @@ PyMODINIT_FUNC initxl(void)
    1.13      Py_INCREF(xl_error_obj);
    1.14      PyModule_AddObject(m, "Error", xl_error_obj);
    1.15  
    1.16 +    _INT_CONST(m, SHUTDOWN_poweroff);
    1.17 +    _INT_CONST(m, SHUTDOWN_reboot);
    1.18 +    _INT_CONST(m, SHUTDOWN_suspend);
    1.19 +    _INT_CONST(m, SHUTDOWN_crash);
    1.20 +    _INT_CONST(m, SHUTDOWN_watchdog);
    1.21 +
    1.22 +    _INT_CONST(m, XENFV);
    1.23 +    _INT_CONST(m, XENPV);
    1.24 +
    1.25 +    _INT_CONST_LIBXL(m, CONSTYPE_SERIAL);
    1.26 +    _INT_CONST_LIBXL(m, CONSTYPE_PV);
    1.27 +
    1.28 +    _INT_CONST_LIBXL(m, CONSBACK_XENCONSOLED);
    1.29 +    _INT_CONST_LIBXL(m, CONSBACK_IOEMU);
    1.30 +
    1.31 +    _INT_CONST(m, PHYSTYPE_QCOW);
    1.32 +    _INT_CONST(m, PHYSTYPE_QCOW2);
    1.33 +    _INT_CONST(m, PHYSTYPE_VHD);
    1.34 +    _INT_CONST(m, PHYSTYPE_AIO);
    1.35 +    _INT_CONST(m, PHYSTYPE_FILE);
    1.36 +    _INT_CONST(m, PHYSTYPE_PHY);
    1.37 +
    1.38 +    _INT_CONST(m, NICTYPE_IOEMU);
    1.39 +    _INT_CONST(m, NICTYPE_VIF);
    1.40 +
    1.41 +    _INT_CONST_LIBXL(m, EVENT_DOMAIN_DEATH);
    1.42 +    _INT_CONST_LIBXL(m, EVENT_DISK_EJECT);
    1.43 +
    1.44 +    _INT_CONST(m, POWER_BUTTON);
    1.45 +    _INT_CONST(m, SLEEP_BUTTON);
    1.46      genwrap__init(m);
    1.47  }
    1.48