Re: PATCH: 6/16: python API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This extends the generator / manual bindings to implement all the
storage APIs. Most are handle automatically, and those which are
not, pretty much follow the existing pattern for virDomain and
virNetwork APIs.

 generator.py   |   93 +++++++++++++++++-
 libvir.c       |  293 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libvirt_wrap.h |   20 +++
 types.c        |   36 +++++++
 4 files changed, 439 insertions(+), 3 deletions(-)

diff -r 7e5658cc1a93 python/generator.py
--- a/python/generator.py	Thu Feb 07 12:33:22 2008 -0500
+++ b/python/generator.py	Thu Feb 07 12:33:27 2008 -0500
@@ -233,18 +233,32 @@ py_types = {
     'unsigned char *':  ('z', None, "charPtr", "char *"),
     'char *':  ('z', None, "charPtr", "char *"),
     'const char *':  ('z', None, "charPtrConst", "const char *"),
+
     'virJobPtr':  ('O', "virJob", "virJobPtr", "virJobPtr"),
     'const virJobPtr':  ('O', "virJob", "virJobPtr", "virJobPtr"),
     'virJob *':  ('O', "virJob", "virJobPtr", "virJobPtr"),
     'const virJob *':  ('O', "virJob", "virJobPtr", "virJobPtr"),
+
     'virDomainPtr':  ('O', "virDomain", "virDomainPtr", "virDomainPtr"),
     'const virDomainPtr':  ('O', "virDomain", "virDomainPtr", "virDomainPtr"),
     'virDomain *':  ('O', "virDomain", "virDomainPtr", "virDomainPtr"),
     'const virDomain *':  ('O', "virDomain", "virDomainPtr", "virDomainPtr"),
+
     'virNetworkPtr':  ('O', "virNetwork", "virNetworkPtr", "virNetworkPtr"),
     'const virNetworkPtr':  ('O', "virNetwork", "virNetworkPtr", "virNetworkPtr"),
     'virNetwork *':  ('O', "virNetwork", "virNetworkPtr", "virNetworkPtr"),
     'const virNetwork *':  ('O', "virNetwork", "virNetworkPtr", "virNetworkPtr"),
+
+    'virStoragePoolPtr':  ('O', "virStoragePool", "virStoragePoolPtr", "virStoragePoolPtr"),
+    'const virStoragePoolPtr':  ('O', "virStoragePool", "virStoragePoolPtr", "virStoragePoolPtr"),
+    'virStoragePool *':  ('O', "virStoragePool", "virStoragePoolPtr", "virStoragePoolPtr"),
+    'const virStoragePool *':  ('O', "virStoragePool", "virStoragePoolPtr", "virStoragePoolPtr"),
+
+    'virStorageVolPtr':  ('O', "virStorageVol", "virStorageVolPtr", "virStorageVolPtr"),
+    'const virStorageVolPtr':  ('O', "virStorageVol", "virStorageVolPtr", "virStorageVolPtr"),
+    'virStorageVol *':  ('O', "virStorageVol", "virStorageVolPtr", "virStorageVolPtr"),
+    'const virStorageVol *':  ('O', "virStorageVol", "virStorageVolPtr", "virStorageVolPtr"),
+
     'virConnectPtr':  ('O', "virConnect", "virConnectPtr", "virConnectPtr"),
     'const virConnectPtr':  ('O', "virConnect", "virConnectPtr", "virConnectPtr"),
     'virConnect *':  ('O', "virConnect", "virConnectPtr", "virConnectPtr"),
@@ -273,6 +287,10 @@ skip_impl = (
     'virConnectListDefinedDomains',
     'virConnectListNetworks',
     'virConnectListDefinedNetworks',
+    'virConnectListStoragePools',
+    'virConnectListDefinedStoragePools',
+    'virConnectListStorageVols',
+    'virConnectListDefinedStorageVols',
     'virConnGetLastError',
     'virGetLastError',
     'virJobGetInfo',
@@ -294,6 +312,14 @@ skip_impl = (
     'virDomainSetSchedulerParameters',
     'virDomainGetVcpus',
     'virDomainPinVcpu',
+    'virStoragePoolGetUUID',
+    'virStoragePoolLookupByUUID',
+    'virStorageVolGetUUID',
+    'virStorageVolLookupByUUID',
+    'virStoragePoolGetInfo',
+    'virStorageVolGetInfo',
+    'virStoragePoolGetAutostart',
+    'virStoragePoolListVolumes',
 )
 
 
@@ -313,6 +339,7 @@ skip_function = (
     'virDefaultErrorFunc', # Python virErrorFuncHandler impl calls this from C
     'virJobCopyLastError', # XXX fixme
     'virJobGetError', # XXX fixme
+    'virConnectDiscoverStoragePools', # XXX fixme
 )
 
 
@@ -575,6 +602,10 @@ classes_type = {
     "virDomain *": ("._o", "virDomain(self, _obj=%s)", "virDomain"),
     "virNetworkPtr": ("._o", "virNetwork(self, _obj=%s)", "virNetwork"),
     "virNetwork *": ("._o", "virNetwork(self, _obj=%s)", "virNetwork"),
+    "virStoragePoolPtr": ("._o", "virStoragePool(self, _obj=%s)", "virStoragePool"),
+    "virStoragePool *": ("._o", "virStoragePool(self, _obj=%s)", "virStoragePool"),
+    "virStorageVolPtr": ("._o", "virStorageVol(self, _obj=%s)", "virStorageVol"),
+    "virStorageVol *": ("._o", "virStorageVol(self, _obj=%s)", "virStorageVol"),
     "virConnectPtr": ("._o", "virConnect(_obj=%s)", "virConnect"),
     "virConnect *": ("._o", "virConnect(_obj=%s)", "virConnect"),
 }
@@ -582,7 +613,7 @@ converter_type = {
 converter_type = {
 }
 
-primary_classes = ["virDomain", "virNetwork", "virConnect"]
+primary_classes = ["virDomain", "virNetwork", "virStoragePool", "virStorageVol", "virConnect"]
 
 classes_ancestor = {
 }
@@ -590,12 +621,18 @@ classes_destructors = {
     "virJob": "virJobFree",
     "virDomain": "virDomainFree",
     "virNetwork": "virNetworkFree",
+    "virStoragePool": "virStoragePoolFree",
+    "virStorageVol": "virStorageVolFree",
     "virConnect": "virConnectClose",
 }
 
 functions_noexcept = {
     'virDomainGetID': True,
     'virDomainGetName': True,
+    'virNetworkGetName': True,
+    'virStoragePoolGetName': True,
+    'virStorageVolGetName': True,
+    'virStorageVolGetkey': True,
 }
 
 reference_keepers = {
@@ -609,6 +646,8 @@ function_post = {
     'virJobDestroy': "self._o = None",
     'virDomainDestroy': "self._o = None",
     'virNetworkDestroy': "self._o = None",
+    'virStoragePoolDestroy': "self._o = None",
+    'virStorageVolDestroy': "self._o = None",
 }
 
 # Functions returning an integral type which need special rules to
@@ -644,6 +683,18 @@ def nameFixup(name, classe, type, file):
     elif name[0:16] == "virNetworkLookup":
         func = name[3:]
         func = string.lower(func[0:1]) + func[1:]
+    elif name[0:20] == "virStoragePoolDefine":
+        func = name[3:]
+        func = string.lower(func[0:1]) + func[1:]
+    elif name[0:20] == "virStoragePoolLookup":
+        func = name[3:]
+        func = string.lower(func[0:1]) + func[1:]
+    elif name[0:19] == "virStorageVolDefine":
+        func = name[3:]
+        func = string.lower(func[0:1]) + func[1:]
+    elif name[0:19] == "virStorageVolLookup":
+        func = name[3:]
+        func = string.lower(func[0:1]) + func[1:]
     elif name[0:12] == "virJobGet":
         func = name[9:]
         func = string.lower(func[0:1]) + func[1:]
@@ -658,6 +709,18 @@ def nameFixup(name, classe, type, file):
         func = string.lower(func[0:1]) + func[1:]
     elif name[0:10] == "virNetwork":
         func = name[10:]
+        func = string.lower(func[0:1]) + func[1:]
+    elif name[0:17] == "virStoragePoolGet":
+        func = name[17:]
+        func = string.lower(func[0:1]) + func[1:]
+    elif name[0:14] == "virStoragePool":
+        func = name[14:]
+        func = string.lower(func[0:1]) + func[1:]
+    elif name[0:16] == "virStorageVolGet":
+        func = name[16:]
+        func = string.lower(func[0:1]) + func[1:]
+    elif name[0:13] == "virStorageVol":
+        func = name[13:]
         func = string.lower(func[0:1]) + func[1:]
     elif name[0:7] == "virNode":
         func = name[7:]
@@ -908,7 +971,7 @@ def buildWrappers():
 	    else:
 		txt.write("Class %s()\n" % (classname))
 		classes.write("class %s:\n" % (classname))
-                if classname in ["virDomain", "virNetwork", "virJob"]:
+                if classname in ["virDomain", "virNetwork", "virJob", "virStoragePool", "virStorageVol"]:
                     classes.write("    def __init__(self, conn, _obj=None):\n")
                 else:
                     classes.write("    def __init__(self, _obj=None):\n")
@@ -916,7 +979,7 @@ def buildWrappers():
 		    list = reference_keepers[classname]
 		    for ref in list:
 		        classes.write("        self.%s = None\n" % ref[1])
-                if classname in ["virDomain", "virNetwork", "virJob"]:
+                if classname in ["virDomain", "virNetwork", "virJob", "virStoragePool", "virStorageVol"]:
                     classes.write("        self._conn = conn\n")
 		classes.write("        if _obj != None:self._o = _obj;return\n")
 		classes.write("        self._o = None\n\n");
@@ -1014,6 +1077,14 @@ def buildWrappers():
                                 classes.write(
 		     "        if ret is None:raise libvirtError('%s() failed', net=self)\n" %
                                               (name))
+                            elif classname == "virStoragePool":
+                                classes.write(
+		     "        if ret is None:raise libvirtError('%s() failed', pool=self)\n" %
+                                              (name))
+                            elif classname == "virStorageVol":
+                                classes.write(
+		     "        if ret is None:raise libvirtError('%s() failed', vol=self)\n" %
+                                              (name))
                             else:
                                 classes.write(
 		     "        if ret is None:raise libvirtError('%s() failed')\n" %
@@ -1090,6 +1161,14 @@ def buildWrappers():
                                 classes.write (("        if " + test +
                                                 ": raise libvirtError ('%s() failed', net=self)\n") %
                                                ("ret", name))
+                            elif classname == "virStoragePool":
+                                classes.write (("        if " + test +
+                                                ": raise libvirtError ('%s() failed', pool=self)\n") %
+                                               ("ret", name))
+                            elif classname == "virStorageVol":
+                                classes.write (("        if " + test +
+                                                ": raise libvirtError ('%s() failed', vol=self)\n") %
+                                               ("ret", name))
                             else:
                                 classes.write (("        if " + test +
                                                 ": raise libvirtError ('%s() failed')\n") %
@@ -1123,6 +1202,14 @@ def buildWrappers():
                             elif classname == "virNetwork":
                                 classes.write (("        if " + test +
                                                 ": raise libvirtError ('%s() failed', net=self)\n") %
+                                               ("ret", name))
+                            elif classname == "virStoragePool":
+                                classes.write (("        if " + test +
+                                                ": raise libvirtError ('%s() failed', pool=self)\n") %
+                                               ("ret", name))
+                            elif classname == "virStorageVol":
+                                classes.write (("        if " + test +
+                                                ": raise libvirtError ('%s() failed', vol=self)\n") %
                                                ("ret", name))
                             else:
                                 classes.write (("        if " + test +
diff -r 7e5658cc1a93 python/libvir.c
--- a/python/libvir.c	Thu Feb 07 12:33:22 2008 -0500
+++ b/python/libvir.c	Thu Feb 07 12:33:27 2008 -0500
@@ -1098,6 +1098,291 @@ error:
     free(freeMems);
     return(py_retval);
 }
+
+
+static PyObject *
+libvirt_virConnectListStoragePools(PyObject *self ATTRIBUTE_UNUSED,
+                                   PyObject *args) {
+    PyObject *py_retval;
+    char **names = NULL;
+    int c_retval, i;
+    virConnectPtr conn;
+    PyObject *pyobj_conn;
+
+
+    if (!PyArg_ParseTuple(args, (char *)"O:virConnectListStoragePools", &pyobj_conn))
+        return(NULL);
+    conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+    c_retval = virConnectNumOfStoragePools(conn);
+    if (c_retval < 0)
+        return VIR_PY_NONE;
+
+    if (c_retval) {
+        names = malloc(sizeof(*names) * c_retval);
+        if (!names)
+            return VIR_PY_NONE;
+        c_retval = virConnectListStoragePools(conn, names, c_retval);
+        if (c_retval < 0) {
+            free(names);
+            return VIR_PY_NONE;
+        }
+    }
+    py_retval = PyList_New(c_retval);
+    if (py_retval == NULL) {
+        if (names) {
+            for (i = 0;i < c_retval;i++)
+                free(names[i]);
+            free(names);
+        }
+        return VIR_PY_NONE;
+    }
+
+    if (names) {
+        for (i = 0;i < c_retval;i++) {
+            PyList_SetItem(py_retval, i, libvirt_constcharPtrWrap(names[i]));
+            free(names[i]);
+        }
+        free(names);
+    }
+
+    return(py_retval);
+}
+
+
+static PyObject *
+libvirt_virConnectListDefinedStoragePools(PyObject *self ATTRIBUTE_UNUSED,
+                                          PyObject *args) {
+    PyObject *py_retval;
+    char **names = NULL;
+    int c_retval, i;
+    virConnectPtr conn;
+    PyObject *pyobj_conn;
+
+
+    if (!PyArg_ParseTuple(args, (char *)"O:virConnectListDefinedStoragePools", &pyobj_conn))
+        return(NULL);
+    conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+    c_retval = virConnectNumOfDefinedStoragePools(conn);
+    if (c_retval < 0)
+        return VIR_PY_NONE;
+
+    if (c_retval) {
+        names = malloc(sizeof(*names) * c_retval);
+        if (!names)
+            return VIR_PY_NONE;
+        c_retval = virConnectListDefinedStoragePools(conn, names, c_retval);
+        if (c_retval < 0) {
+            free(names);
+            return VIR_PY_NONE;
+        }
+    }
+    py_retval = PyList_New(c_retval);
+    if (py_retval == NULL) {
+        if (names) {
+            for (i = 0;i < c_retval;i++)
+                free(names[i]);
+            free(names);
+        }
+        return VIR_PY_NONE;
+    }
+
+    if (names) {
+        for (i = 0;i < c_retval;i++) {
+            PyList_SetItem(py_retval, i, libvirt_constcharPtrWrap(names[i]));
+            free(names[i]);
+        }
+        free(names);
+    }
+
+    return(py_retval);
+}
+
+
+static PyObject *
+libvirt_virStoragePoolListVolumes(PyObject *self ATTRIBUTE_UNUSED,
+                                  PyObject *args) {
+    PyObject *py_retval;
+    char **names = NULL;
+    int c_retval, i;
+    virStoragePoolPtr pool;
+    PyObject *pyobj_pool;
+
+
+    if (!PyArg_ParseTuple(args, (char *)"O:virStoragePoolListVolumes", &pyobj_pool))
+        return(NULL);
+    pool = (virStoragePoolPtr) PyvirStoragePool_Get(pyobj_pool);
+
+    c_retval = virStoragePoolNumOfVolumes(pool);
+    if (c_retval < 0)
+        return VIR_PY_NONE;
+
+    if (c_retval) {
+        names = malloc(sizeof(*names) * c_retval);
+        if (!names)
+            return VIR_PY_NONE;
+        c_retval = virStoragePoolListVolumes(pool, names, c_retval);
+        if (c_retval < 0) {
+            free(names);
+            return VIR_PY_NONE;
+        }
+    }
+    py_retval = PyList_New(c_retval);
+    if (py_retval == NULL) {
+        if (names) {
+            for (i = 0;i < c_retval;i++)
+                free(names[i]);
+            free(names);
+        }
+        return VIR_PY_NONE;
+    }
+
+    if (names) {
+        for (i = 0;i < c_retval;i++) {
+            PyList_SetItem(py_retval, i, libvirt_constcharPtrWrap(names[i]));
+            free(names[i]);
+        }
+        free(names);
+    }
+
+    return(py_retval);
+}
+
+static PyObject *
+libvirt_virStoragePoolGetAutostart(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+    PyObject *py_retval;
+    int c_retval, autostart;
+    virStoragePoolPtr pool;
+    PyObject *pyobj_pool;
+
+    if (!PyArg_ParseTuple(args, (char *)"O:virStoragePoolGetAutostart", &pyobj_pool))
+        return(NULL);
+
+    pool = (virStoragePoolPtr) PyvirStoragePool_Get(pyobj_pool);
+
+    LIBVIRT_BEGIN_ALLOW_THREADS;
+    c_retval = virStoragePoolGetAutostart(pool, &autostart);
+    LIBVIRT_END_ALLOW_THREADS;
+
+    if (c_retval < 0)
+        return VIR_PY_NONE;
+
+    py_retval = libvirt_intWrap(autostart);
+    return(py_retval);
+}
+
+static PyObject *
+libvirt_virStoragePoolGetInfo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+    PyObject *py_retval;
+    int c_retval;
+    virStoragePoolPtr pool;
+    PyObject *pyobj_pool;
+    virStoragePoolInfo info;
+
+    if (!PyArg_ParseTuple(args, (char *)"O:virStoragePoolGetInfo", &pyobj_pool))
+        return(NULL);
+    pool = (virStoragePoolPtr) PyvirStoragePool_Get(pyobj_pool);
+
+    LIBVIRT_BEGIN_ALLOW_THREADS;
+    c_retval = virStoragePoolGetInfo(pool, &info);
+    LIBVIRT_END_ALLOW_THREADS;
+    if (c_retval < 0)
+        return VIR_PY_NONE;
+
+    if ((py_retval = PyList_New(4)) == NULL)
+        return VIR_PY_NONE;
+
+    PyList_SetItem(py_retval, 0, libvirt_intWrap((int) info.state));
+    PyList_SetItem(py_retval, 1,
+                   libvirt_longlongWrap((unsigned long long) info.capacity));
+    PyList_SetItem(py_retval, 2,
+                   libvirt_longlongWrap((unsigned long long) info.allocation));
+    PyList_SetItem(py_retval, 3,
+                   libvirt_longlongWrap((unsigned long long) info.available));
+    return(py_retval);
+}
+
+
+static PyObject *
+libvirt_virStorageVolGetInfo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+    PyObject *py_retval;
+    int c_retval;
+    virStorageVolPtr pool;
+    PyObject *pyobj_pool;
+    virStorageVolInfo info;
+
+    if (!PyArg_ParseTuple(args, (char *)"O:virStorageVolGetInfo", &pyobj_pool))
+        return(NULL);
+    pool = (virStorageVolPtr) PyvirStorageVol_Get(pyobj_pool);
+
+    LIBVIRT_BEGIN_ALLOW_THREADS;
+    c_retval = virStorageVolGetInfo(pool, &info);
+    LIBVIRT_END_ALLOW_THREADS;
+    if (c_retval < 0)
+        return VIR_PY_NONE;
+
+    if ((py_retval = PyList_New(3)) == NULL)
+        return VIR_PY_NONE;
+    PyList_SetItem(py_retval, 0, libvirt_intWrap((int) info.type));
+    PyList_SetItem(py_retval, 1,
+                   libvirt_longlongWrap((unsigned long long) info.capacity));
+    PyList_SetItem(py_retval, 2,
+                   libvirt_longlongWrap((unsigned long long) info.allocation));
+    return(py_retval);
+}
+
+static PyObject *
+libvirt_virStoragePoolGetUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+    PyObject *py_retval;
+    unsigned char uuid[VIR_UUID_BUFLEN];
+    virStoragePoolPtr pool;
+    PyObject *pyobj_pool;
+    int c_retval;
+
+    if (!PyArg_ParseTuple(args, (char *)"O:virStoragePoolGetUUID", &pyobj_pool))
+        return(NULL);
+    pool = (virStoragePoolPtr) PyvirStoragePool_Get(pyobj_pool);
+
+    if (pool == NULL)
+        return VIR_PY_NONE;
+    LIBVIRT_BEGIN_ALLOW_THREADS;
+    c_retval = virStoragePoolGetUUID(pool, &uuid[0]);
+    LIBVIRT_END_ALLOW_THREADS;
+
+    if (c_retval < 0)
+        return VIR_PY_NONE;
+
+    py_retval = PyString_FromStringAndSize((char *) &uuid[0], VIR_UUID_BUFLEN);
+
+    return(py_retval);
+}
+
+
+static PyObject *
+libvirt_virStoragePoolLookupByUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+    PyObject *py_retval;
+    virStoragePoolPtr c_retval;
+    virConnectPtr conn;
+    PyObject *pyobj_conn;
+    unsigned char * uuid;
+    int len;
+
+    if (!PyArg_ParseTuple(args, (char *)"Oz#:virStoragePoolLookupByUUID", &pyobj_conn, &uuid, &len))
+        return(NULL);
+    conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+    if ((uuid == NULL) || (len != VIR_UUID_BUFLEN))
+        return VIR_PY_NONE;
+
+    LIBVIRT_BEGIN_ALLOW_THREADS;
+    c_retval = virStoragePoolLookupByUUID(conn, uuid);
+    LIBVIRT_END_ALLOW_THREADS;
+    py_retval = libvirt_virStoragePoolPtrWrap((virStoragePoolPtr) c_retval);
+    return(py_retval);
+}
+
+
 
 /************************************************************************
  *									*
@@ -1131,6 +1416,14 @@ static PyMethodDef libvirtMethods[] = {
     {(char *) "virDomainSetSchedulerParameters", libvirt_virDomainSetSchedulerParameters, METH_VARARGS, NULL},
     {(char *) "virDomainGetVcpus", libvirt_virDomainGetVcpus, METH_VARARGS, NULL},
     {(char *) "virDomainPinVcpu", libvirt_virDomainPinVcpu, METH_VARARGS, NULL},
+    {(char *) "virConnectListStoragePools", libvirt_virConnectListStoragePools, METH_VARARGS, NULL},
+    {(char *) "virConnectListDefinedStoragePools", libvirt_virConnectListDefinedStoragePools, METH_VARARGS, NULL},
+    {(char *) "virStoragePoolGetAutostart", libvirt_virStoragePoolGetAutostart, METH_VARARGS, NULL},
+    {(char *) "virStoragePoolListVolumes", libvirt_virStoragePoolListVolumes, METH_VARARGS, NULL},
+    {(char *) "virStoragePoolGetInfo", libvirt_virStoragePoolGetInfo, METH_VARARGS, NULL},
+    {(char *) "virStorageVolGetInfo", libvirt_virStorageVolGetInfo, METH_VARARGS, NULL},
+    {(char *) "virStoragePoolGetUUID", libvirt_virStoragePoolGetUUID, METH_VARARGS, NULL},
+    {(char *) "virStoragePoolLookupByUUID", libvirt_virStoragePoolLookupByUUID, METH_VARARGS, NULL},
     {NULL, NULL, 0, NULL}
 };
 
diff -r 7e5658cc1a93 python/libvirt_wrap.h
--- a/python/libvirt_wrap.h	Thu Feb 07 12:33:22 2008 -0500
+++ b/python/libvirt_wrap.h	Thu Feb 07 12:33:27 2008 -0500
@@ -57,6 +57,24 @@ typedef struct {
 } PyvirNetwork_Object;
 
 
+#define PyvirStoragePool_Get(v) (((v) == Py_None) ? NULL : \
+	(((PyvirStoragePool_Object *)(v))->obj))
+
+typedef struct {
+    PyObject_HEAD
+    virStoragePoolPtr obj;
+} PyvirStoragePool_Object;
+
+
+#define PyvirStorageVol_Get(v) (((v) == Py_None) ? NULL : \
+	(((PyvirStorageVol_Object *)(v))->obj))
+
+typedef struct {
+    PyObject_HEAD
+    virStorageVolPtr obj;
+} PyvirStorageVol_Object;
+
+
 PyObject * libvirt_intWrap(int val);
 PyObject * libvirt_longWrap(long val);
 PyObject * libvirt_ulongWrap(unsigned long val);
@@ -68,6 +86,8 @@ PyObject * libvirt_virJobPtrWrap(virJobP
 PyObject * libvirt_virJobPtrWrap(virJobPtr node);
 PyObject * libvirt_virDomainPtrWrap(virDomainPtr node);
 PyObject * libvirt_virNetworkPtrWrap(virNetworkPtr node);
+PyObject * libvirt_virStoragePoolPtrWrap(virStoragePoolPtr node);
+PyObject * libvirt_virStorageVolPtrWrap(virStorageVolPtr node);
 
 
 /* Provide simple macro statement wrappers (adapted from GLib, in turn from Perl):
diff -r 7e5658cc1a93 python/types.c
--- a/python/types.c	Thu Feb 07 12:33:22 2008 -0500
+++ b/python/types.c	Thu Feb 07 12:33:27 2008 -0500
@@ -163,6 +163,42 @@ libvirt_virNetworkPtrWrap(virNetworkPtr 
 }
 
 PyObject *
+libvirt_virStoragePoolPtrWrap(virStoragePoolPtr node)
+{
+    PyObject *ret;
+
+#ifdef DEBUG
+    printf("libvirt_virStoragePoolPtrWrap: node = %p\n", node);
+#endif
+    if (node == NULL) {
+        Py_INCREF(Py_None);
+        return (Py_None);
+    }
+    ret =
+        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virStoragePoolPtr",
+                                     NULL);
+    return (ret);
+}
+
+PyObject *
+libvirt_virStorageVolPtrWrap(virStorageVolPtr node)
+{
+    PyObject *ret;
+
+#ifdef DEBUG
+    printf("libvirt_virStorageVolPtrWrap: node = %p\n", node);
+#endif
+    if (node == NULL) {
+        Py_INCREF(Py_None);
+        return (Py_None);
+    }
+    ret =
+        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virStorageVolPtr",
+                                     NULL);
+    return (ret);
+}
+
+PyObject *
 libvirt_virConnectPtrWrap(virConnectPtr node)
 {
     PyObject *ret;

-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]