diff options
author | Daniel Veillard <veillard@redhat.com> | 2006-02-23 11:26:17 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2006-02-23 11:26:17 +0000 |
commit | 2ce9e08fac637cb6a19e5244027b118dbed708c2 (patch) | |
tree | 0fac58555ce1d3828590b09b13a089abadd6498f /libvir.c | |
parent | 9000be07f8575994c143c6d19e7c4de395588582 (diff) | |
download | libvirt-python-v6-2ce9e08fac637cb6a19e5244027b118dbed708c2.tar.gz libvirt-python-v6-2ce9e08fac637cb6a19e5244027b118dbed708c2.tar.xz libvirt-python-v6-2ce9e08fac637cb6a19e5244027b118dbed708c2.zip |
* src/libvirt.c: fixing a bug before the release of 0.0.5v0.0.5LIBVIRT_0_0_5
* python/generator.py python/libvir.c python/libvirt-python-api.xml:
also fixing the binding for getting a domain UUID
* python/tests/Makefile.am python/tests/uuid.py: added a test
for the new UUID API
Daniel
Diffstat (limited to 'libvir.c')
-rw-r--r-- | libvir.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -100,6 +100,31 @@ libvirt_virDomainGetInfo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } +PyObject * +libvirt_virDomainGetUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + unsigned char uuid[16]; + virDomainPtr domain; + PyObject *pyobj_domain; + virDomainInfo info; + + if (!PyArg_ParseTuple(args, (char *)"O:virDomainGetUUID", &pyobj_domain)) + return(NULL); + domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); + + if (domain == NULL) { + Py_INCREF(Py_None); + return(Py_None); + } + if (virDomainGetUUID(domain, &uuid[0]) < 0) { + Py_INCREF(Py_None); + return(Py_None); + } + py_retval = PyString_FromStringAndSize((char *) &uuid[0], 16); + + return(py_retval); +} + /************************************************************************ * * * The registration stuff * @@ -111,6 +136,7 @@ static PyMethodDef libvirtMethods[] = { {(char *) "virConnectClose", libvirt_virConnectClose, METH_VARARGS, NULL}, {(char *) "virConnectListDomainsID", libvirt_virConnectListDomainsID, METH_VARARGS, NULL}, {(char *) "virDomainGetInfo", libvirt_virDomainGetInfo, METH_VARARGS, NULL}, + {(char *) "virDomainGetUUID", libvirt_virDomainGetUUID, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; |