提交 cb96ae25 编写于 作者: D Daniel Veillard

* python/generator.py python/libvir.c python/libvirt-python-api.xml:

  Apply patch from Cole Robinson fixing UUIDString for python
Daniel
上级 406d8963
Tue Jun 10 17:10:31 CEST 2008 Daniel Veillard <veillard@redhat.com>
* python/generator.py python/libvir.c python/libvirt-python-api.xml:
Apply patch from Cole Robinson fixing UUIDString for python
Tue Jun 10 15:33:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
Pass syntax check for XM block devices over to XenD
......
......@@ -291,8 +291,10 @@ skip_impl = (
'virDomainGetInfo',
'virNodeGetInfo',
'virDomainGetUUID',
'virDomainGetUUIDString',
'virDomainLookupByUUID',
'virNetworkGetUUID',
'virNetworkGetUUIDString',
'virNetworkLookupByUUID',
'virDomainGetAutostart',
'virNetworkGetAutostart',
......@@ -305,9 +307,8 @@ skip_impl = (
'virDomainGetVcpus',
'virDomainPinVcpu',
'virStoragePoolGetUUID',
'virStoragePoolGetUUIDString',
'virStoragePoolLookupByUUID',
'virStorageVolGetUUID',
'virStorageVolLookupByUUID',
'virStoragePoolGetInfo',
'virStorageVolGetInfo',
'virStoragePoolGetAutostart',
......
......@@ -863,6 +863,33 @@ libvirt_virDomainGetUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(py_retval);
}
static PyObject *
libvirt_virDomainGetUUIDString(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args) {
PyObject *py_retval;
char uuidstr[VIR_UUID_STRING_BUFLEN];
virDomainPtr dom;
PyObject *pyobj_dom;
int c_retval;
if (!PyArg_ParseTuple(args, (char *)"O:virDomainGetUUIDString",
&pyobj_dom))
return(NULL);
dom = (virDomainPtr) PyvirDomain_Get(pyobj_dom);
if (dom == NULL)
return VIR_PY_NONE;
LIBVIRT_BEGIN_ALLOW_THREADS;
c_retval = virDomainGetUUIDString(dom, &uuidstr[0]);
LIBVIRT_END_ALLOW_THREADS;
if (c_retval < 0)
return VIR_PY_NONE;
py_retval = PyString_FromString((char *) &uuidstr[0]);
return(py_retval);
}
static PyObject *
libvirt_virDomainLookupByUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
......@@ -996,6 +1023,33 @@ libvirt_virNetworkGetUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(py_retval);
}
static PyObject *
libvirt_virNetworkGetUUIDString(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args) {
PyObject *py_retval;
char uuidstr[VIR_UUID_STRING_BUFLEN];
virNetworkPtr net;
PyObject *pyobj_net;
int c_retval;
if (!PyArg_ParseTuple(args, (char *)"O:virNetworkGetUUIDString",
&pyobj_net))
return(NULL);
net = (virNetworkPtr) PyvirNetwork_Get(pyobj_net);
if (net == NULL)
return VIR_PY_NONE;
LIBVIRT_BEGIN_ALLOW_THREADS;
c_retval = virNetworkGetUUIDString(net, &uuidstr[0]);
LIBVIRT_END_ALLOW_THREADS;
if (c_retval < 0)
return VIR_PY_NONE;
py_retval = PyString_FromString((char *) &uuidstr[0]);
return(py_retval);
}
static PyObject *
libvirt_virNetworkLookupByUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
......@@ -1363,6 +1417,31 @@ libvirt_virStoragePoolGetUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(py_retval);
}
static PyObject *
libvirt_virStoragePoolGetUUIDString(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args) {
PyObject *py_retval;
char uuidstr[VIR_UUID_STRING_BUFLEN];
virStoragePoolPtr pool;
PyObject *pyobj_pool;
int c_retval;
if (!PyArg_ParseTuple(args, (char *)"O:virStoragePoolGetUUIDString", &pyobj_pool))
return(NULL);
pool = (virStoragePoolPtr) PyvirStoragePool_Get(pyobj_pool);
if (pool == NULL)
return VIR_PY_NONE;
LIBVIRT_BEGIN_ALLOW_THREADS;
c_retval = virStoragePoolGetUUIDString(pool, &uuidstr[0]);
LIBVIRT_END_ALLOW_THREADS;
if (c_retval < 0)
return VIR_PY_NONE;
py_retval = PyString_FromString((char *) &uuidstr[0]);
return(py_retval);
}
static PyObject *
libvirt_virStoragePoolLookupByUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
......@@ -1403,6 +1482,7 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virDomainGetInfo", libvirt_virDomainGetInfo, METH_VARARGS, NULL},
{(char *) "virNodeGetInfo", libvirt_virNodeGetInfo, METH_VARARGS, NULL},
{(char *) "virDomainGetUUID", libvirt_virDomainGetUUID, METH_VARARGS, NULL},
{(char *) "virDomainGetUUIDString", libvirt_virDomainGetUUIDString, METH_VARARGS, NULL},
{(char *) "virDomainLookupByUUID", libvirt_virDomainLookupByUUID, METH_VARARGS, NULL},
{(char *) "virRegisterErrorHandler", libvirt_virRegisterErrorHandler, METH_VARARGS, NULL},
{(char *) "virGetLastError", libvirt_virGetLastError, METH_VARARGS, NULL},
......@@ -1410,6 +1490,7 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virConnectListNetworks", libvirt_virConnectListNetworks, METH_VARARGS, NULL},
{(char *) "virConnectListDefinedNetworks", libvirt_virConnectListDefinedNetworks, METH_VARARGS, NULL},
{(char *) "virNetworkGetUUID", libvirt_virNetworkGetUUID, METH_VARARGS, NULL},
{(char *) "virNetworkGetUUIDString", libvirt_virNetworkGetUUIDString, METH_VARARGS, NULL},
{(char *) "virNetworkLookupByUUID", libvirt_virNetworkLookupByUUID, METH_VARARGS, NULL},
{(char *) "virDomainGetAutostart", libvirt_virDomainGetAutostart, METH_VARARGS, NULL},
{(char *) "virNetworkGetAutostart", libvirt_virNetworkGetAutostart, METH_VARARGS, NULL},
......@@ -1428,6 +1509,7 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virStoragePoolGetInfo", libvirt_virStoragePoolGetInfo, METH_VARARGS, NULL},
{(char *) "virStorageVolGetInfo", libvirt_virStorageVolGetInfo, METH_VARARGS, NULL},
{(char *) "virStoragePoolGetUUID", libvirt_virStoragePoolGetUUID, METH_VARARGS, NULL},
{(char *) "virStoragePoolGetUUIDString", libvirt_virStoragePoolGetUUIDString, METH_VARARGS, NULL},
{(char *) "virStoragePoolLookupByUUID", libvirt_virStoragePoolLookupByUUID, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};
......
......@@ -48,11 +48,31 @@
<return type='char *' info='the 16 bytes string or None in case of error'/>
<arg name='domain' type='virDomainPtr' info='a domain object'/>
</function>
<function name='virDomainGetUUIDString' file='python'>
<info>Fetch globally unique ID of the domain as a string.</info>
<return type='char *' info='the UUID string or None in case of error'/>
<arg name='pool' type='virDomainPtr' info='a domain object'/>
</function>
<function name='virNetworkGetUUID' file='python'>
<info>Extract the UUID unique Identifier of a network.</info>
<return type='char *' info='the 16 bytes string or None in case of error'/>
<arg name='domain' type='virNetworkPtr' info='a network object'/>
</function>
<function name='virNetworkGetUUIDString' file='python'>
<info>Fetch globally unique ID of the network as a string.</info>
<return type='char *' info='the UUID string or None in case of error'/>
<arg name='net' type='virNetworkPtr' info='a network object'/>
</function>
<function name='virStoragePoolGetUUID' file='python'>
<info>Extract the UUID unique Identifier of a storage pool.</info>
<return type='char *' info='the 16 bytes string or None in case of error'/>
<arg name='pool' type='virStoragePoolPtr' info='a storage pool object'/>
</function>
<function name='virStoragePoolGetUUIDString' file='python'>
<info>Fetch globally unique ID of the storage pool as a string.</info>
<return type='char *' info='the UUID string or None in case of error'/>
<arg name='pool' type='virStoragePoolPtr' info='a storage pool object'/>
</function>
<function name='virNetworkGetAutostart' file='python'>
<info>Extract the autostart flag for a network.</info>
<return type='int' info='the autostart flag, or None in case of error'/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册