Hello community, here is the log from the commit of package libvirt-python for openSUSE:Factory checked in at 2014-12-23 11:50:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libvirt-python (Old) and /work/SRC/openSUSE:Factory/.libvirt-python.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libvirt-python" Changes: -------- --- /work/SRC/openSUSE:Factory/libvirt-python/libvirt-python.changes 2014-11-11 10:16:01.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libvirt-python.new/libvirt-python.changes 2014-12-23 11:49:22.000000000 +0100 @@ -1,0 +2,6 @@ +Mon Dec 15 10:42:02 MST 2014 - jfehlig@suse.com + +- Update to 1.2.11 + - Add all new APIs and constants in libvirt 1.2.11 + +------------------------------------------------------------------- Old: ---- libvirt-python-1.2.10.tar.gz libvirt-python-1.2.10.tar.gz.asc New: ---- libvirt-python-1.2.11.tar.gz libvirt-python-1.2.11.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libvirt-python.spec ++++++ --- /var/tmp/diff_new_pack.hLAh0G/_old 2014-12-23 11:49:24.000000000 +0100 +++ /var/tmp/diff_new_pack.hLAh0G/_new 2014-12-23 11:49:24.000000000 +0100 @@ -18,7 +18,7 @@ Name: libvirt-python Url: http://libvirt.org/ -Version: 1.2.10 +Version: 1.2.11 Release: 0 Summary: Library providing a simple virtualization API License: LGPL-2.1+ ++++++ libvirt-python-1.2.10.tar.gz -> libvirt-python-1.2.11.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/AUTHORS new/libvirt-python-1.2.11/AUTHORS --- old/libvirt-python-1.2.10/AUTHORS 2014-11-03 07:36:13.000000000 +0100 +++ new/libvirt-python-1.2.11/AUTHORS 2014-12-13 03:57:15.000000000 +0100 @@ -430,7 +430,9 @@ Jiri Denemark <jdenemar@redhat.com> Jiri Denemark <jdenemar@redhat.com> Jiri Denemark <jdenemar@redhat.com> + Jiri Denemark <jdenemar@redhat.com> Jiri Denemark <Jiri.Denemark@gmail.com> + John Ferlan <jferlan@redhat.com> Ján Tomko <jtomko@redhat.com> KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Lai Jiangshan <laijs@cn.fujitsu.com> @@ -441,6 +443,7 @@ Lei Li <lilei@linux.vnet.ibm.com> Luyao Huang <lhuang@redhat.com> Luyao Huang <lhuang@redhat.com> + Luyao Huang <lhuang@redhat.com> Marcelo Cerri <mhcerri@linux.vnet.ibm.com> Marian Neagul <marian@info.uvt.ro> Mark McLoughlin <markmc@redhat.com> @@ -531,6 +534,8 @@ Pavel Hrdina <phrdina@redhat.com> Pavel Hrdina <phrdina@redhat.com> Pavel Hrdina <phrdina@redhat.com> + Pavel Hrdina <phrdina@redhat.com> + Peter Krempa <pkrempa@redhat.com> Peter Krempa <pkrempa@redhat.com> Peter Krempa <pkrempa@redhat.com> Peter Krempa <pkrempa@redhat.com> @@ -561,6 +566,7 @@ Richard W.M. Jones <rjones@redhat.com> Richard W.M. Jones <rjones@redhat.com> Richard W.M. Jones <rjones@redhat.com> + Richard W.M. Jones <rjones@redhat.com> Robie Basak <robie.basak@canonical.com> Serge Hallyn <serge.hallyn@canonical.com> Stefan Berger <stefanb@linux.vnet.ibm.com> @@ -572,6 +578,8 @@ Taku Izumi <izumi.taku@jp.fujitsu.com> Taku Izumi <izumi.taku@jp.fujitsu.com> Tomoki Sekiyama <tomoki.sekiyama@hds.com> + Tomoki Sekiyama <tomoki.sekiyama@hds.com> + Tomoki Sekiyama <tomoki.sekiyama@hds.com> Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/ChangeLog new/libvirt-python-1.2.11/ChangeLog --- old/libvirt-python-1.2.10/ChangeLog 2014-11-03 07:36:13.000000000 +0100 +++ new/libvirt-python-1.2.11/ChangeLog 2014-12-13 03:57:15.000000000 +0100 @@ -1,3 +1,78 @@ +2014-12-11 Richard W.M. Jones <rjones@redhat.com> + + Add c_pointer method to classes. + This returns the raw C pointer to the underlying object, eg: + + conn = libvirt.open(None) + print "0x%x" % conn.c_pointer() # returns virConnectPtr of the connection + dom = conn.lookupByName("test") + print "0x%x" % dom.c_pointer() # returns virDomainPtr of the domain + + The reason behind this is to allow us to transparently pass Python dom + objects through the libguestfs Python API. + + https://bugzilla.redhat.com/show_bug.cgi?id=1075164 + + +2014-12-02 Tomoki Sekiyama <tomoki.sekiyama@hds.com> + + override: iterate virDomainFSInfo.devAliases using ndevAliases + Currently devAliases in virDomainFSInfo struct are iterated as a + NULL-terminated list, but that is not guaranteed. It should use + ndevAliases which stores the number of the items in devAliases. + + + +2014-12-01 Pavel Hrdina <phrdina@redhat.com> + + fix examples + The dhcpleases example had an old usage of print function. The formating + of leases record was also wrong. + + The event-test example had an old usage of exceptions. + + It's mainly to make examples compatible with python3. + + + +2014-11-24 Peter Krempa <pkrempa@redhat.com> + + event: Add bindings for agent lifecycle event + Also add the example. + + +2014-11-24 Tomoki Sekiyama <tomoki.sekiyama@hds.com> + + override: Implement bindings for virDomainGetFSInfo as domain.fsInfo + Implement the function which returns a list of tuples, that contains members + of virDomainFSInfo struct. + + + +2014-11-11 Luyao Huang <lhuang@redhat.com> + + Add dict check for setTime and allow pass 'seconds' parameter + When pass None or a empty dictionary to time, it will report + error. This commit allows a one-element dictionary which contains + just 'seconds' field, which results in the same as passing 0 for + 'nseconds' field. Moreover, dict is checked for unknown fields. + + + +2014-11-06 Jiri Denemark <jdenemar@redhat.com> + + Check return value of libvirt_uintUnwrap + libvirt_virDomainSendKey didn't check whether libvirt_uintUnwrap + succeeded or not. + + https://bugzilla.redhat.com/show_bug.cgi?id=1161039 + + +2014-11-03 John Ferlan <jferlan@redhat.com> + + Bump version to 1.2.11 for new dev cycle + + 2014-10-28 Dmitry Guryanov <dguryanov@parallels.com> fix libvirt headers list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/PKG-INFO new/libvirt-python-1.2.11/PKG-INFO --- old/libvirt-python-1.2.10/PKG-INFO 2014-11-03 07:36:13.000000000 +0100 +++ new/libvirt-python-1.2.11/PKG-INFO 2014-12-13 03:57:15.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: libvirt-python -Version: 1.2.10 +Version: 1.2.11 Summary: The libvirt virtualization API Home-page: http://www.libvirt.org Author: Libvirt Maintainers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/examples/event-test.py new/libvirt-python-1.2.11/examples/event-test.py --- old/libvirt-python-1.2.10/examples/event-test.py 2014-10-01 11:16:02.000000000 +0200 +++ new/libvirt-python-1.2.11/examples/event-test.py 2014-12-13 03:42:57.000000000 +0100 @@ -220,7 +220,7 @@ t.set_last_fired(now) t.dispatch() - except (os.error, select.error), e: + except (os.error, select.error) as e: if e.args[0] != errno.EINTR: raise finally: @@ -464,6 +464,14 @@ blockJobStatus = ( "Completed", "Failed", "Canceled", "Ready", ) return blockJobStatus[status] +def agentLifecycleStateToString(state): + agentStates = ( "unknown", "connected", "disconnected", ) + return agentStates[state] + +def agentLifecycleReasonToString(reason): + agentReasons = ( "unknown", "domain started", "channel event", ) + return agentReasons[reason] + def myDomainEventCallback1 (conn, dom, event, detail, opaque): print("myDomainEventCallback1 EVENT: Domain %s(%s) %s %s" % (dom.name(), dom.ID(), domEventToString(event), @@ -517,6 +525,8 @@ print("myDomainEventBlockJob2Callback: Domain %s(%s) %s on disk %s %s" % (dom.name(), dom.ID(), blockJobTypeToString(type), disk, blockJobStatusToString(status))) def myDomainEventTunableCallback(conn, dom, params, opaque): print("myDomainEventTunableCallback: Domain %s(%s) %s" % (dom.name(), dom.ID(), params)) +def myDomainEventAgentLifecycleCallback(conn, dom, state, reason, opaque): + print("myDomainEventAgentLifecycleCallback: Domain %s(%s) %s %s" % (dom.name(), dom.ID(), agentLifecycleStateToString(state), agentLifecycleReasonToString(reason))) ########################################################################## # Network events @@ -566,7 +576,7 @@ def main(): try: opts, args = getopt.getopt(sys.argv[1:], "hdl", ["help", "debug", "loop"]) - except getopt.GetoptError, err: + except getopt.GetoptError as err: # print help information and exit: print(str(err)) # will print something like "option -a not recognized" usage() @@ -627,6 +637,7 @@ vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, myDomainEventDeviceRemovedCallback, None) vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2, myDomainEventBlockJob2Callback, None) vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_TUNABLE, myDomainEventTunableCallback, None) + vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE, myDomainEventAgentLifecycleCallback, None) vc.networkEventRegisterAny(None, libvirt.VIR_NETWORK_EVENT_ID_LIFECYCLE, myNetworkEventLifecycleCallback, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/generator.py new/libvirt-python-1.2.11/generator.py --- old/libvirt-python-1.2.10/generator.py 2014-11-03 07:35:28.000000000 +0100 +++ new/libvirt-python-1.2.11/generator.py 2014-12-13 03:42:57.000000000 +0100 @@ -476,6 +476,7 @@ 'virNetworkGetDHCPLeases', 'virDomainBlockCopy', 'virNodeAllocPages', + 'virDomainGetFSInfo', ) lxc_skip_impl = ( @@ -586,6 +587,7 @@ 'virNetworkDHCPLeaseFree', # only useful in C, python code uses list 'virDomainStatsRecordListFree', # only useful in C, python uses dict + 'virDomainFSInfoFree', # only useful in C, python code uses list ) lxc_skip_function = ( @@ -819,6 +821,27 @@ return 0 return 1 +def print_c_pointer(classname, output, export, include): + output.write("PyObject *\n") + output.write("libvirt_%s_pointer(PyObject *self ATTRIBUTE_UNUSED, PyObject *args)\n" % classname) + output.write("{\n") + output.write(" %sPtr ptr;\n" % classname) + output.write(" PyObject *pyptr;\n") + output.write(" PyObject *pylong;\n") + output.write("\n") + output.write(" if (!PyArg_ParseTuple(args, (char *) "O", &pyptr))\n") + output.write(" return NULL;\n") + output.write(" ptr = (%sPtr) Py%s_Get(pyptr);\n" % (classname, classname)) + output.write(" pylong = PyLong_FromVoidPtr(ptr);\n") + output.write(" return pylong;\n") + output.write("}\n") + output.write("\n") + + include.write("PyObject *libvirt_%s_pointer(PyObject *self, PyObject *args);\n" % classname) + + export.write(" { (char *)"%s_pointer", libvirt_%s_pointer, METH_VARARGS, NULL },\n" % + (classname, classname)) + def buildStubs(module, api_xml): global py_types global py_return_types @@ -915,6 +938,12 @@ del funcs[function] if ret == 1: nb_wrap = nb_wrap + 1 + + if module == "libvirt": + # Write C pointer conversion functions. + for classname in primary_classes: + print_c_pointer(classname, wrapper, export, include) + include.close() export.close() wrapper.close() @@ -1107,6 +1136,9 @@ elif name[0:20] == "virDomainGetCPUStats": func = name[9:] func = func[0:1].lower() + func[1:] + elif name[0:18] == "virDomainGetFSInfo": + func = name[12:] + func = func[0:2].lower() + func[2:] elif name[0:12] == "virDomainGet": func = name[12:] func = func[0:1].lower() + func[1:] @@ -1491,6 +1523,11 @@ classes.write(" def domain(self):\n") classes.write(" return self._dom\n\n") + classes.write(" def c_pointer(self):\n") + classes.write(" """Get C pointer to underlying object"""\n") + classes.write(" return libvirtmod.%s_pointer(self._o)\n\n" % + classname) + flist = function_classes[classname] flist.sort(key=functionSortKey) oldfile = "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/libvirt-override-api.xml new/libvirt-python-1.2.11/libvirt-override-api.xml --- old/libvirt-python-1.2.10/libvirt-override-api.xml 2014-10-01 11:16:02.000000000 +0200 +++ new/libvirt-python-1.2.11/libvirt-override-api.xml 2014-12-13 03:42:57.000000000 +0100 @@ -658,5 +658,11 @@ <arg name='flags' type='unsigned int' info='an OR'ed set of virNodeAllocPagesFlags'/> <return type='int' info='the number of nodes successfully adjusted or -1 in case of an error'/> </function> + <function name="virDomainGetFSInfo" file='python'> + <info>Get a list of mapping information for each mounted file systems within the specified guest and the disks.</info> + <arg name='domain' type='virDomainPtr' info='pointer to domain object'/> + <arg name='flags' type='unsigned int' info='unused, pass 0'/> + <return type='char *' info="list of mounted filesystems information"/> + </function> </symbols> </api> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/libvirt-override-virConnect.py new/libvirt-python-1.2.11/libvirt-override-virConnect.py --- old/libvirt-python-1.2.10/libvirt-override-virConnect.py 2014-10-01 11:16:02.000000000 +0200 +++ new/libvirt-python-1.2.11/libvirt-override-virConnect.py 2014-12-13 03:42:57.000000000 +0100 @@ -197,6 +197,16 @@ cb(self, virDomain(self, _obj=dom), params, opaque) return 0 + def _dispatchDomainEventAgentLifecycleCallback(self, dom, state, reason, cbData): + """Dispatches event to python user domain agent lifecycle event callback + """ + + cb = cbData["cb"] + opaque = cbData["opaque"] + + cb(self, virDomain(self, _obj=dom), state, reason, opaque) + return 0 + def domainEventDeregisterAny(self, callbackID): """Removes a Domain Event Callback. De-registering for a domain callback will disable delivery of this event type """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/libvirt-override-virDomain.py new/libvirt-python-1.2.11/libvirt-override-virDomain.py --- old/libvirt-python-1.2.10/libvirt-override-virDomain.py 2014-10-01 11:16:02.000000000 +0200 +++ new/libvirt-python-1.2.11/libvirt-override-virDomain.py 2014-12-13 03:42:57.000000000 +0100 @@ -67,8 +67,8 @@ return ret def setTime(self, time=None, flags=0): - """Set guest time to the given value. @time is a dict conatining - 'seconds' field for seconds and 'nseconds' field for nanosecons """ + """Set guest time to the given value. @time is a dict containing + 'seconds' field for seconds and 'nseconds' field for nanoseconds """ ret = libvirtmod.virDomainSetTime(self._o, time, flags) if ret == -1: raise libvirtError ('virDomainSetTime() failed', dom=self) return ret diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/libvirt-override.c new/libvirt-python-1.2.11/libvirt-override.c --- old/libvirt-python-1.2.10/libvirt-override.c 2014-10-27 17:38:00.000000000 +0100 +++ new/libvirt-python-1.2.11/libvirt-override.c 2014-12-13 03:42:57.000000000 +0100 @@ -6566,6 +6566,61 @@ } #endif /* LIBVIR_CHECK_VERSION(1, 2, 9) */ +#if LIBVIR_CHECK_VERSION(1, 2, 11) +static int +libvirt_virConnectDomainEventAgentLifecycleCallback(virConnectPtr conn ATTRIBUTE_UNUSED, + virDomainPtr dom, + int state, + int reason, + void *opaque) +{ + PyObject *pyobj_cbData = (PyObject*)opaque; + PyObject *pyobj_dom; + PyObject *pyobj_ret = NULL; + PyObject *pyobj_conn; + PyObject *dictKey; + int ret = -1; + + LIBVIRT_ENSURE_THREAD_STATE; + + if (!(dictKey = libvirt_constcharPtrWrap("conn"))) + goto cleanup; + pyobj_conn = PyDict_GetItem(pyobj_cbData, dictKey); + Py_DECREF(dictKey); + + /* Create a python instance of this virDomainPtr */ + virDomainRef(dom); + if (!(pyobj_dom = libvirt_virDomainPtrWrap(dom))) { + virDomainFree(dom); + goto cleanup; + } + Py_INCREF(pyobj_cbData); + + /* Call the Callback Dispatcher */ + pyobj_ret = PyObject_CallMethod(pyobj_conn, + (char*)"_dispatchDomainEventAgentLifecycleCallback", + (char*)"OiiO", + pyobj_dom, state, reason, pyobj_cbData); + + Py_DECREF(pyobj_cbData); + Py_DECREF(pyobj_dom); + + cleanup: + if (!pyobj_ret) { + DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret); + PyErr_Print(); + } else { + Py_DECREF(pyobj_ret); + ret = 0; + } + + LIBVIRT_RELEASE_THREAD_STATE; + return ret; + +} +#endif /* LIBVIR_CHECK_VERSION(1, 2, 11) */ + + static PyObject * libvirt_virConnectDomainEventRegisterAny(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) @@ -6658,6 +6713,11 @@ cb = VIR_DOMAIN_EVENT_CALLBACK(libvirt_virConnectDomainEventTunableCallback); break; #endif /* LIBVIR_CHECK_VERSION(1, 2, 9) */ +#if LIBVIR_CHECK_VERSION(1, 2, 11) + case VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE: + cb = VIR_DOMAIN_EVENT_CALLBACK(libvirt_virConnectDomainEventAgentLifecycleCallback); + break; +#endif /* LIBVIR_CHECK_VERSION(1, 2, 11) */ case VIR_DOMAIN_EVENT_ID_LAST: break; } @@ -7149,7 +7209,8 @@ } for (i = 0; i < nkeycodes; i++) { - libvirt_uintUnwrap(PyList_GetItem(pyobj_list, i), &(keycodes[i])); + if (libvirt_uintUnwrap(PyList_GetItem(pyobj_list, i), &keycodes[i]) < 0) + return NULL; } LIBVIRT_BEGIN_ALLOW_THREADS; @@ -7784,12 +7845,14 @@ libvirt_virDomainSetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval = NULL; PyObject *pyobj_domain; + PyObject *pyobj_seconds; + PyObject *pyobj_nseconds; PyObject *py_dict; virDomainPtr domain; long long seconds = 0; unsigned int nseconds = 0; unsigned int flags; - ssize_t py_dict_size; + ssize_t py_dict_size = 0; int c_retval; if (!PyArg_ParseTuple(args, (char*)"OOI:virDomainSetTime", @@ -7797,25 +7860,30 @@ return NULL; domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); - py_dict_size = PyDict_Size(py_dict); - - if (py_dict_size == 2) { - PyObject *pyobj_seconds, *pyobj_nseconds; - - if (!(pyobj_seconds = PyDict_GetItemString(py_dict, "seconds")) || - (libvirt_longlongUnwrap(pyobj_seconds, &seconds) < 0)) { - PyErr_Format(PyExc_LookupError, "malformed or missing 'seconds'"); + if (PyDict_Check(py_dict)) { + py_dict_size = PyDict_Size(py_dict); + if ((pyobj_seconds = PyDict_GetItemString(py_dict, "seconds"))) { + if (libvirt_longlongUnwrap(pyobj_seconds, &seconds) < 0) { + PyErr_Format(PyExc_LookupError, "malformed 'seconds'"); + goto cleanup; + } + } else { + PyErr_Format(PyExc_LookupError, "Dictionary must contains 'seconds'"); goto cleanup; } - if (!(pyobj_nseconds = PyDict_GetItemString(py_dict, "nseconds")) || - (libvirt_uintUnwrap(pyobj_nseconds, &nseconds) < 0)) { - PyErr_Format(PyExc_LookupError, "malformed or missing 'nseconds'"); + if ((pyobj_nseconds = PyDict_GetItemString(py_dict, "nseconds"))) { + if (libvirt_uintUnwrap(pyobj_nseconds, &nseconds) < 0) { + PyErr_Format(PyExc_LookupError, "malformed 'nseconds'"); + goto cleanup; + } + } else if (py_dict_size > 1) { + PyErr_Format(PyExc_LookupError, "Dictionary contains unknown key"); goto cleanup; } - } else if (py_dict_size > 0) { - PyErr_Format(PyExc_LookupError, "Dictionary must contain " - "'seconds' and 'nseconds'"); + } else if (py_dict != Py_None || !flags) { + PyErr_Format(PyExc_TypeError, "time must be a dictionary " + "or None with flags set"); goto cleanup; } @@ -8258,6 +8326,74 @@ } #endif /* LIBVIR_CHECK_VERSION(1, 2, 8) */ +#if LIBVIR_CHECK_VERSION(1, 2, 11) + +static PyObject * +libvirt_virDomainGetFSInfo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + virDomainPtr domain; + PyObject *pyobj_domain; + unsigned int flags; + virDomainFSInfoPtr *fsinfo = NULL; + int c_retval, i; + size_t j; + PyObject *py_retval = NULL; + + if (!PyArg_ParseTuple(args, (char *)"Oi:virDomainFSInfo", + &pyobj_domain, &flags)) + return NULL; + domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); + + LIBVIRT_BEGIN_ALLOW_THREADS; + c_retval = virDomainGetFSInfo(domain, &fsinfo, flags); + LIBVIRT_END_ALLOW_THREADS; + + if (c_retval < 0) + goto cleanup; + + /* convert to a Python list */ + if ((py_retval = PyList_New(c_retval)) == NULL) + goto cleanup; + + for (i = 0; i < c_retval; i++) { + virDomainFSInfoPtr fs = fsinfo[i]; + PyObject *info, *alias; + + if (fs == NULL) + goto cleanup; + info = PyTuple_New(4); + if (info == NULL) + goto cleanup; + PyList_SetItem(py_retval, i, info); + alias = PyList_New(0); + if (alias == NULL) + goto cleanup; + + PyTuple_SetItem(info, 0, libvirt_constcharPtrWrap(fs->mountpoint)); + PyTuple_SetItem(info, 1, libvirt_constcharPtrWrap(fs->name)); + PyTuple_SetItem(info, 2, libvirt_constcharPtrWrap(fs->fstype)); + PyTuple_SetItem(info, 3, alias); + + for (j = 0; j < fs->ndevAlias; j++) + if (PyList_Append(alias, + libvirt_constcharPtrWrap(fs->devAlias[j])) < 0) + goto cleanup; + } + + for (i = 0; i < c_retval; i++) + virDomainFSInfoFree(fsinfo[i]); + VIR_FREE(fsinfo); + return py_retval; + + cleanup: + for (i = 0; i < c_retval; i++) + virDomainFSInfoFree(fsinfo[i]); + VIR_FREE(fsinfo); + Py_XDECREF(py_retval); + return VIR_PY_NONE; +} + +#endif /* LIBVIR_CHECK_VERSION(1, 2, 11) */ + /************************************************************************ * * * The registration stuff * @@ -8451,6 +8587,9 @@ #if LIBVIR_CHECK_VERSION(1, 2, 9) {(char *) "virNodeAllocPages", libvirt_virNodeAllocPages, METH_VARARGS, NULL}, #endif /* LIBVIR_CHECK_VERSION(1, 2, 9) */ +#if LIBVIR_CHECK_VERSION(1, 2, 11) + {(char *) "virDomainGetFSInfo", libvirt_virDomainGetFSInfo, METH_VARARGS, NULL}, +#endif /* LIBVIR_CHECK_VERSION(1, 2, 11) */ {NULL, NULL, 0, NULL} }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/libvirt-python.spec new/libvirt-python-1.2.11/libvirt-python.spec --- old/libvirt-python-1.2.10/libvirt-python.spec 2014-11-03 07:36:12.000000000 +0100 +++ new/libvirt-python-1.2.11/libvirt-python.spec 2014-12-13 03:57:15.000000000 +0100 @@ -6,7 +6,7 @@ Summary: The libvirt virtualization API python2 binding Name: libvirt-python -Version: 1.2.10 +Version: 1.2.11 Release: 1%{?dist}%{?extra_release} Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz Url: http://libvirt.org diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/sanitytest.py new/libvirt-python-1.2.11/sanitytest.py --- old/libvirt-python-1.2.10/sanitytest.py 2014-10-27 17:38:00.000000000 +0100 +++ new/libvirt-python-1.2.11/sanitytest.py 2014-12-13 03:42:57.000000000 +0100 @@ -109,6 +109,8 @@ for name in dir(klassobj): if name[0] == '_': continue + if name == 'c_pointer': + continue thing = getattr(klassobj, name) if callable(thing): gotfunctions[klassname].append(name) @@ -137,6 +139,9 @@ if name[0:28] == "virDomainStatsRecordListFree": continue + if name[0:19] == "virDomainFSInfoFree": + continue + if name[0:21] == "virDomainListGetStats": name = "virConnectDomainListGetStats" @@ -269,7 +274,7 @@ func = func[0:1].lower() + func[1:] if func[0:8] == "nWFilter": func = "nwfilter" + func[8:] - if func[0:8] == "fSFreeze" or func[0:6] == "fSThaw": + if func[0:8] == "fSFreeze" or func[0:6] == "fSThaw" or func[0:6] == "fSInfo": func = "fs" + func[2:] if klass == "virNetwork": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libvirt-python-1.2.10/setup.py new/libvirt-python-1.2.11/setup.py --- old/libvirt-python-1.2.10/setup.py 2014-10-27 17:38:00.000000000 +0100 +++ new/libvirt-python-1.2.11/setup.py 2014-12-13 03:42:57.000000000 +0100 @@ -309,7 +309,7 @@ _c_modules, _py_modules = get_module_lists() setup(name = 'libvirt-python', - version = '1.2.10', + version = '1.2.11', url = 'http://www.libvirt.org', maintainer = 'Libvirt Maintainers', maintainer_email = 'libvir-list@redhat.com', -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org