[PATCH 3/3] virnetdev.c: Use g_auto*()

2020-04-19 Thread Michal Privoznik
While I'm at it, use more g_autofree and g_autoptr() in this file. This also fixes a possible mem-leak in virNetDevGetVirtualFunctions(). Signed-off-by: Michal Privoznik --- src/util/virnetdev.c | 384 --- 1 file changed, 139 insertions(+), 245 deletions(-

[PATCH 0/3] Enable net devices in node-dev driver again

2020-04-19 Thread Michal Privoznik
If the kernel doesn't have CONFIG_NET_DEVLINK then net devices are not listed in nodedev-list. See 2/3 for more info. Michal Prívozník (3): virNetDevGetFamilyId: Change signature virNetDevSwitchdevFeature: Make failure to get 'family_id' non-fatal virnetdev.c: Use g_auto*() src/util/virnet

[PATCH 2/3] virNetDevSwitchdevFeature: Make failure to get 'family_id' non-fatal

2020-04-19 Thread Michal Privoznik
I've just got a new machine and I'm still converging on the kernel config. Anyway, since I don't have enabled any of SRIO-V drivers, my kernel doesn't have NET_DEVLINK enabled (i.e. virNetDevGetFamilyId() returns 0). But this makes nodedev driver ignore all intefaces, because when enumerating all d

[PATCH 1/3] virNetDevGetFamilyId: Change signature

2020-04-19 Thread Michal Privoznik
Introduced in v3.8.0-rc1~96, the virNetDevGetFamilyId() gets netlink family ID for passed family name (even though it's used only for getting "devlink" ID). Nevertheless, the function returns 0 on an error or if no family ID was found. This makes it harder for a caller to distinguish these two. Cha

[PATCH libvirt-python] examples: Fix connection error handling

2020-04-19 Thread Philipp Hahn
libvirt.open*() does not return None but raises an exception Signed-off-by: Philipp Hahn --- examples/dominfo.py| 5 +++-- examples/domrestore.py | 5 +++-- examples/domsave.py| 5 +++-- examples/domstart.py | 5 +++-- examples/esxlist.py| 6 +++--- 5 files changed, 15 insertions(+

[PATCH] doc/python: Update to Python 3

2020-04-19 Thread Philipp Hahn
Convert the simple example to Python 3 syntax: - print() is a function - do not use bare except - libvirt.open*() does not return None but raises an exception The referenced source for the example was removed with 5bb2a245abbde4c0a407f631660e2f2c81bc4c02 --- docs/python.html.in | 18 +

Re: [python] WIP-FYI: mypy annotations for libvirt-python and cleanup for generator.py

2020-04-19 Thread Philipp Hahn
Hello, Am 08.11.18 um 11:11 schrieb Philipp Hahn: > Maybe you already have heard about mypy , which > "is an experimental optional static type checker for Python that aims to > combine the benefits of dynamic (or "duck") typing and static typing". > > I started to write a m

Re: [PATCH v5 0/4] introduction of migration_version attribute for VFIO live migration

2020-04-19 Thread Yan Zhao
On Fri, Apr 17, 2020 at 07:24:57PM +0800, Cornelia Huck wrote: > On Fri, 17 Apr 2020 05:52:02 -0400 > Yan Zhao wrote: > > > On Fri, Apr 17, 2020 at 04:44:50PM +0800, Cornelia Huck wrote: > > > On Mon, 13 Apr 2020 01:52:01 -0400 > > > Yan Zhao wrote: > > > > > > > This patchset introduces a mi