aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-04-06 16:50:16 +0100
committerIan Campbell <ian.campbell@citrix.com>2011-04-06 16:50:16 +0100
commitbbfc7c38075c1f5181ff205b5111eddc0a8c76eb (patch)
tree255743bf4cfc1ab2b4e075cc1ba891b15bd07fb8 /tools/python
parente15c160c0f6ee65e0160826d8a3987a65ccfa9ec (diff)
downloadxen-bbfc7c38075c1f5181ff205b5111eddc0a8c76eb.tar.gz
xen-bbfc7c38075c1f5181ff205b5111eddc0a8c76eb.tar.bz2
xen-bbfc7c38075c1f5181ff205b5111eddc0a8c76eb.zip
libxl: do not expose libxenctrl/libxenstore headers via libxl.h
This completely removes libxenstore from libxl users' view. xl still needs libxenctrl directly due to the direct use of the xentoollog functionality but it is not exposed to the indirect linkage anymore. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/python')
-rw-r--r--tools/python/setup.py2
-rw-r--r--tools/python/xen/lowlevel/xl/xl.c32
2 files changed, 17 insertions, 17 deletions
diff --git a/tools/python/setup.py b/tools/python/setup.py
index dd88de89ef..81540bcf49 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -83,7 +83,7 @@ netlink = Extension("netlink",
xl = Extension("xl",
extra_compile_args = extra_compile_args,
- include_dirs = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC, PATH_XENSTORE, "xen/lowlevel/xl" ],
+ include_dirs = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC, "xen/lowlevel/xl" ],
library_dirs = [ PATH_LIBXL ],
libraries = [ "xenlight" ],
depends = [ PATH_LIBXL + "/libxenlight.so" ],
diff --git a/tools/python/xen/lowlevel/xl/xl.c b/tools/python/xen/lowlevel/xl/xl.c
index 1a2ce8f8a9..9910c449da 100644
--- a/tools/python/xen/lowlevel/xl/xl.c
+++ b/tools/python/xen/lowlevel/xl/xl.c
@@ -370,7 +370,7 @@ PyObject *attrib__struct_in_addr_get(struct in_addr *pptr)
typedef struct {
PyObject_HEAD;
- libxl_ctx ctx;
+ libxl_ctx *ctx;
xentoollog_logger_stdiostream *logger;
xentoollog_level minmsglevel;
} XlObject;
@@ -381,7 +381,7 @@ static PyObject *pyxl_list_domains(XlObject *self)
PyObject *list;
int nr_dom, i;
- info = libxl_list_domain(&self->ctx, &nr_dom);
+ info = libxl_list_domain(self->ctx, &nr_dom);
if ( NULL == info )
return PyList_New(0);
@@ -416,7 +416,7 @@ static PyObject *pyxl_domid_to_name(XlObject *self, PyObject *args)
if ( !PyArg_ParseTuple(args, "i", &domid) )
return NULL;
- domname = libxl_domid_to_name(&self->ctx, domid);
+ domname = libxl_domid_to_name(self->ctx, domid);
ret = PyString_FromString(domname);
free(domname);
@@ -428,7 +428,7 @@ static PyObject *pyxl_domain_shutdown(XlObject *self, PyObject *args)
int domid, req = 0;
if ( !PyArg_ParseTuple(args, "i|i", &domid, &req) )
return NULL;
- if ( libxl_domain_shutdown(&self->ctx, domid, req) ) {
+ if ( libxl_domain_shutdown(self->ctx, domid, req) ) {
PyErr_SetString(xl_error_obj, "cannot shutdown domain");
return NULL;
}
@@ -441,7 +441,7 @@ static PyObject *pyxl_domain_destroy(XlObject *self, PyObject *args)
int domid, force = 1;
if ( !PyArg_ParseTuple(args, "i|i", &domid, &force) )
return NULL;
- if ( libxl_domain_destroy(&self->ctx, domid, force) ) {
+ if ( libxl_domain_destroy(self->ctx, domid, force) ) {
PyErr_SetString(xl_error_obj, "cannot destroy domain");
return NULL;
}
@@ -454,7 +454,7 @@ static PyObject *pyxl_domain_pause(XlObject *self, PyObject *args)
int domid;
if ( !PyArg_ParseTuple(args, "i", &domid) )
return NULL;
- if ( libxl_domain_pause(&self->ctx, domid) ) {
+ if ( libxl_domain_pause(self->ctx, domid) ) {
PyErr_SetString(xl_error_obj, "cannot pause domain");
return NULL;
}
@@ -467,7 +467,7 @@ static PyObject *pyxl_domain_unpause(XlObject *self, PyObject *args)
int domid;
if ( !PyArg_ParseTuple(args, "i", &domid) )
return NULL;
- if ( libxl_domain_unpause(&self->ctx, domid) ) {
+ if ( libxl_domain_unpause(self->ctx, domid) ) {
PyErr_SetString(xl_error_obj, "cannot unpause domain");
return NULL;
}
@@ -481,7 +481,7 @@ static PyObject *pyxl_domain_rename(XlObject *self, PyObject *args)
int domid;
if ( !PyArg_ParseTuple(args, "is|s", &domid, &new_name, &old_name) )
return NULL;
- if ( libxl_domain_rename(&self->ctx, domid, old_name, new_name) ) {
+ if ( libxl_domain_rename(self->ctx, domid, old_name, new_name) ) {
PyErr_SetString(xl_error_obj, "cannot rename domain");
return NULL;
}
@@ -501,7 +501,7 @@ static PyObject *pyxl_pci_add(XlObject *self, PyObject *args)
return NULL;
}
pci = (Py_device_pci *)obj;
- if ( libxl_device_pci_add(&self->ctx, domid, &pci->obj) ) {
+ if ( libxl_device_pci_add(self->ctx, domid, &pci->obj) ) {
PyErr_SetString(xl_error_obj, "cannot add pci device");
return NULL;
}
@@ -522,7 +522,7 @@ static PyObject *pyxl_pci_del(XlObject *self, PyObject *args)
return NULL;
}
pci = (Py_device_pci *)obj;
- if ( libxl_device_pci_remove(&self->ctx, domid, &pci->obj, force) ) {
+ if ( libxl_device_pci_remove(self->ctx, domid, &pci->obj, force) ) {
PyErr_SetString(xl_error_obj, "cannot remove pci device");
return NULL;
}
@@ -544,7 +544,7 @@ static PyObject *pyxl_pci_parse(XlObject *self, PyObject *args)
return NULL;
}
- if ( libxl_device_pci_parse_bdf(&self->ctx, &pci->obj, str) ) {
+ if ( libxl_device_pci_parse_bdf(self->ctx, &pci->obj, str) ) {
PyErr_SetString(xl_error_obj, "cannot parse pci device spec (BDF)");
Py_DECREF(pci);
return NULL;
@@ -559,7 +559,7 @@ static PyObject *pyxl_pci_list_assignable(XlObject *self, PyObject *args)
PyObject *list;
int nr_dev, i;
- if ( libxl_device_pci_list_assignable(&self->ctx, &dev, &nr_dev) ) {
+ if ( libxl_device_pci_list_assignable(self->ctx, &dev, &nr_dev) ) {
PyErr_SetString(xl_error_obj, "Cannot list assignable devices");
return NULL;
}
@@ -595,7 +595,7 @@ static PyObject *pyxl_pci_list(XlObject *self, PyObject *args)
if ( !PyArg_ParseTuple(args, "i", &domid) )
return NULL;
- if ( libxl_device_pci_list_assigned(&self->ctx, &dev, domid, &nr_dev) ) {
+ if ( libxl_device_pci_list_assigned(self->ctx, &dev, domid, &nr_dev) ) {
PyErr_SetString(xl_error_obj, "Cannot list assignable devices");
return NULL;
}
@@ -663,7 +663,7 @@ static PyObject *PyXl_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (self == NULL)
return NULL;
- memset(&self->ctx, 0, sizeof(self->ctx));
+ self->ctx = NULL;
self->logger = NULL;
self->minmsglevel = XTL_PROGRESS;
@@ -679,7 +679,7 @@ PyXl_init(XlObject *self, PyObject *args, PyObject *kwds)
return -1;
}
- if ( libxl_ctx_init(&self->ctx, LIBXL_VERSION,
+ if ( libxl_ctx_alloc(&self->ctx, LIBXL_VERSION,
(xentoollog_logger*)self->logger) ) {
PyErr_SetString(xl_error_obj, "cannot init xl context");
return -1;
@@ -690,7 +690,7 @@ PyXl_init(XlObject *self, PyObject *args, PyObject *kwds)
static void PyXl_dealloc(XlObject *self)
{
- libxl_ctx_free(&self->ctx);
+ libxl_ctx_free(self->ctx);
if ( self->logger )
xtl_logger_destroy((xentoollog_logger*)self->logger);