[libvirt] [RFC PATCH 2/2] conf: Add VM Generation ID device

2018-03-20 Thread John Ferlan
Add VM Generation ID device XML schema, parse, format, and documentation. Signed-off-by: John Ferlan --- docs/formatdomain.html.in | 54 ++ docs/schemas/domaincommon.rng | 21 ++ src/conf/domain_conf.c| 112

[libvirt] [RFC PATCH 1/2] conf: Introduce VIR_DOMAIN_DEVICE_VMGENID

2018-03-20 Thread John Ferlan
Introduce a new domain device "vmgenid". This device will be used to provide a unique identifier for certain guest execution operations such as start after snapshot, start from backup, failover in disaster recovery, and start after import, copy, clone. Signed-off-by: John Ferlan

[libvirt] [RFC PATCH 0/2] Add vmgenid XML, schema, docs

2018-03-20 Thread John Ferlan
Could be a v1, but figured I'd get feedback first - I have a "working example" for QEMU (supported since 2.9.0), but it's not quite ready to be fully posted. Currently only needed for windows guests, but there is some work upstream (somewhere) to make a Linux implementation. Still have to work

Re: [libvirt] [PATCH 4/4] virt-aa-helper: generate rules for nvdimm memory

2018-03-20 Thread Jamie Strandboge
On Tue, 2018-03-20 at 13:08 +0100, Christian Ehrhardt wrote: > nvdimm memory is backed by a path on the host. This currently works > only via > hotplug where the AppArmor label is created via the domain label > callbacks. > > This adds the virt-aa-helper support for nvdimm memory devices to >

Re: [libvirt] [PATCH 3/4] virt-aa-helper: generate rules for passthrough input devices

2018-03-20 Thread Jamie Strandboge
On Tue, 2018-03-20 at 13:08 +0100, Christian Ehrhardt wrote: > Input devices can passthrough an event device. This currently works > only via > hotplug where the AppArmor label is created via the domain label > callbacks. > > This adds the virt-aa-helper support for passthrough input devices to >

Re: [libvirt] [PATCH 2/4] security, apparmor: add (Set|Restore)InputLabel

2018-03-20 Thread Jamie Strandboge
On Tue, 2018-03-20 at 13:08 +0100, Christian Ehrhardt wrote: > d8116b5a "security: Introduce functions for input device hot(un)plug" > implemented the code (Set|Restore)InputLabel for several security > modules, > this patch adds an AppArmor implementation for it as well. > > That fixes

Re: [libvirt] [PATCH 1/4] security, apparmor: add (Set|Restore)MemoryLabel

2018-03-20 Thread Jamie Strandboge
On Tue, 2018-03-20 at 13:08 +0100, Christian Ehrhardt wrote: > Recent changes have made implementing this mandatory to hot add any > memory. > Implementing this in apparmor fixes this as well as allows hot-add of > nvdimm > tpye memory with an nvdimmPath set generating a AppArmor rule for > that >

[libvirt] Wiki Write Access

2018-03-20 Thread Torsten Senf
Hi, I was in the irc #virt@OFTC last days and kashyap gave me a lot of helping. His wiki page https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit was very cool and I found some enhancements while testing. I would write this enhancements to the wiki page and would ask you

Re: [libvirt] [PATCH] rpm: fix incorrect expansion of %systemd_preun macro

2018-03-20 Thread Laine Stump
On 03/20/2018 02:13 PM, Andrea Bolognani wrote: > On Tue, 2018-03-20 at 13:54 -0400, Laine Stump wrote: >> On 03/20/2018 01:00 PM, Daniel P. Berrangé wrote: >>> Macros in RPMs are expanded before line continuations, so when we write >>> >>>%systemd_preun foo \ >>> bar >>> >>>

Re: [libvirt] [PATCH] rpm: fix incorrect expansion of %systemd_preun macro

2018-03-20 Thread Andrea Bolognani
On Tue, 2018-03-20 at 13:54 -0400, Laine Stump wrote: > On 03/20/2018 01:00 PM, Daniel P. Berrangé wrote: > > Macros in RPMs are expanded before line continuations, so when we write > > > >%systemd_preun foo \ > > bar > > > > What happens is that it expands to > > > >

Re: [libvirt] [PATCH] rpm: fix incorrect expansion of %systemd_preun macro

2018-03-20 Thread Laine Stump
On 03/20/2018 01:00 PM, Daniel P. Berrangé wrote: > Macros in RPMs are expanded before line continuations, so when we write > >%systemd_preun foo \ > bar > > What happens is that it expands to > >if [ $1 -eq 0 ] ; then > # Package removal, not upgrade >

Re: [libvirt] [PATCH] rpm: fix incorrect expansion of %systemd_preun macro

2018-03-20 Thread Laine Stump
On 03/20/2018 01:00 PM, Daniel P. Berrangé wrote: > Macros in RPMs are expanded before line continuations, so when we write > >%systemd_preun foo \ > bar > > What happens is that it expands to > >if [ $1 -eq 0 ] ; then > # Package removal, not upgrade >

[libvirt] [PATCH] libxl: rename migration APIs to include Src or Dst in their name

2018-03-20 Thread Jim Fehlig
Inspired by commit ffb7954f to improve readability of the libxl migration APIs. Signed-off-by: Jim Fehlig --- Suggested by jferlan while reviewing other patches touch the libxl migration code https://www.redhat.com/archives/libvir-list/2018-March/msg00769.html

Re: [libvirt] [PATCH 7/8] qemu: Implement the HTM pSeries feature

2018-03-20 Thread Andrea Bolognani
On Fri, 2018-03-16 at 11:33 -0400, John Ferlan wrote: > This looks particularly useful for other commands, but... > [...] > > It's only generated/built for one - seems like a lot of work for little > gain unless of course there's a plan to add in all the others. Without > adding in others, one

[libvirt] [PATCH] rpm: fix incorrect expansion of %systemd_preun macro

2018-03-20 Thread Daniel P . Berrangé
Macros in RPMs are expanded before line continuations, so when we write %systemd_preun foo \ bar What happens is that it expands to if [ $1 -eq 0 ] ; then # Package removal, not upgrade systemctl --no-reload disable --now foo \ > /dev/null 2>&1 || : fi

Re: [libvirt] [jenkins-ci PATCH 3/3] guests: Configure ccache

2018-03-20 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 04:29:57PM +0100, Andrea Bolognani wrote: > Disk size for guests is somewhat limited, so we need to tell > ccache to only consume a reasonable chunk of it. > > Signed-off-by: Andrea Bolognani > --- > guests/files/ccache.conf | 1 + >

Re: [libvirt] [jenkins-ci PATCH 1/3] guests: Rename 'ci' flavor to 'jenkins'

2018-03-20 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 04:29:55PM +0100, Andrea Bolognani wrote: > Having the name of the user that can access the machine match > the name of the flavor, as is already the case for the 'test' > flavor, makes some things easier. > > We can change this safely because the CentOS CI is the only >

Re: [libvirt] [jenkins-ci PATCH 2/3] guests: Factor out user creation

2018-03-20 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 04:29:56PM +0100, Andrea Bolognani wrote: > Some steps involved in creating the user account are the same > regardless of flavor, and more common steps will be introduced > later on, so it makes sense to have them all in the same place > instead of duplicating them. > >

[libvirt] [jenkins-ci PATCH 3/3] guests: Don't expose 'base' pseudo-package

2018-03-20 Thread Andrea Bolognani
The 'base' pseudo-package is an implementation detail, and as such is better not exposed. Signed-off-by: Andrea Bolognani --- guests/host_vars/libvirt-centos-6/main.yml| 1 - guests/host_vars/libvirt-centos-7/main.yml| 1 -

[libvirt] [jenkins-ci PATCH 2/3] guests: Don't expose 'jenkins' pseudo-package

2018-03-20 Thread Andrea Bolognani
The 'jenkins' pseudo-package is an implementation detail, and as such is better not exposed. Moreover, with this change the JDK will only be installed when the 'jenkins' flavor is used, which means developers will have slightly smaller guests. Signed-off-by: Andrea Bolognani

[libvirt] [jenkins-ci PATCH 1/3] guests: Configure Jenkins agent based on secret availability

2018-03-20 Thread Andrea Bolognani
We're going to remove the 'jenkins' pseudo-project from the list of per-guest projects soon, so we need another way of deciding whether to install and configure the Jenkins agent. The availability of the Jenkins secret in the vault is a perfect candidate, and using it improves things in general

[libvirt] [jenkins-ci PATCH 0/3] guests: Various cleanups

2018-03-20 Thread Andrea Bolognani
Applies on top of https://www.redhat.com/archives/libvir-list/2018-March/msg01093.html Andrea Bolognani (3): guests: Configure Jenkins agent based on secret availability guests: Don't expose 'jenkins' pseudo-package guests: Don't expose 'base' pseudo-package

Re: [libvirt] [PATCH] travis: Test both python2 and python3

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 04:03:13PM +0100, Andrea Bolognani wrote: > Signed-off-by: Andrea Bolognani > --- > .travis.yml | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/.travis.yml b/.travis.yml > index d071c98634..01dffaa602 100644 > --- a/.travis.yml > +++

Re: [libvirt] [virt-tools-list] Project for profiles and defaults for libvirt domains

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 03:20:31PM +0100, Martin Kletzander wrote: > 1) Default devices/values > > Libvirt itself must default to whatever values there were before any > particular element was introduced due to the fact that it strives to > keep the guest ABI stable. That means, for example,

Re: [libvirt] [PATCH 0/3] libxl: misc fixes for migration

2018-03-20 Thread Olaf Hering
On Tue, Mar 20, Olaf Hering wrote: > Mär 20 09:35:52 macintyre-old libvirtd[4527]: 2018-03-20 08:35:52.521+: > 4531: error : virNetSocketNewListenTCP:389 : Unable to bind to port: Cannot > assign requested address After further debugging: 27672 16:04:46.774906 socket(PF_INET6,

[libvirt] [PATCH] travis: Test both python2 and python3

2018-03-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index d071c98634..01dffaa602 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,10 +7,12 @@ matrix: - compiler: gcc dist: trusty

[libvirt] Project for profiles and defaults for libvirt domains

2018-03-20 Thread Martin Kletzander
Hi everyone! First of all sorry for such wide distribution, but apparently that's the best way to make sure we cooperate nicely. So please be considerate as this is a cross-post between huge amount of mailing lists. After some discussions with developers from different projects that work with

Re: [libvirt] [PATCH 2/2] docs: update all GIT repo examples to use https:// protocol

2018-03-20 Thread Pavel Hrdina
On Tue, Mar 20, 2018 at 12:36:37PM +, Daniel P. Berrangé wrote: > The https:// protocol is much more reliably usable than git:// when > faced with unreasonably strict firewalls. The libvirt.org web server is > now setup to support the smart https:// protocol, which is just as fast > as git://,

Re: [libvirt] [PATCH 1/2] docs: remove obsolete docs about gitorious and cvs access

2018-03-20 Thread Pavel Hrdina
On Tue, Mar 20, 2018 at 12:36:36PM +, Daniel P. Berrangé wrote: > The gitorious.org service went away a long time ago now, and our main > download.html page tells people where all the official mirrors are > for every component. > > Meanwhile telling people about CVS is a bad joke in 2018, and

Re: [libvirt] [PATCH 2/4] spec: Use Python 3 for building on Fedora

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 01:46:43PM +0100, Andrea Bolognani wrote: > On Tue, 2018-03-20 at 12:40 +, Daniel P. Berrangé wrote: > > On Tue, Mar 20, 2018 at 01:38:50PM +0100, Andrea Bolognani wrote: > > > On Tue, 2018-03-20 at 11:12 +, Daniel P. Berrangé wrote: > > > > While current RHEL are

Re: [libvirt] [PATCH 2/4] spec: Use Python 3 for building on Fedora

2018-03-20 Thread Andrea Bolognani
On Tue, 2018-03-20 at 12:40 +, Daniel P. Berrangé wrote: > On Tue, Mar 20, 2018 at 01:38:50PM +0100, Andrea Bolognani wrote: > > On Tue, 2018-03-20 at 11:12 +, Daniel P. Berrangé wrote: > > > While current RHEL are py2, future RHEL should be expected to > > > use Python 3 too > > > [...] >

Re: [libvirt] [PATCH 2/4] spec: Use Python 3 for building on Fedora

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 01:38:50PM +0100, Andrea Bolognani wrote: > On Tue, 2018-03-20 at 11:12 +, Daniel P. Berrangé wrote: > > On Tue, Mar 20, 2018 at 11:53:53AM +0100, Andrea Bolognani wrote: > > > While RHEL / CentOS are still using Python 2 for the time being, > > > Fedora has already

Re: [libvirt] [PATCH 2/4] spec: Use Python 3 for building on Fedora

2018-03-20 Thread Andrea Bolognani
On Tue, 2018-03-20 at 11:12 +, Daniel P. Berrangé wrote: > On Tue, Mar 20, 2018 at 11:53:53AM +0100, Andrea Bolognani wrote: > > While RHEL / CentOS are still using Python 2 for the time being, > > Fedora has already switched to Python 3 as the default Python > > interpreter a while ago, so on

[libvirt] [PATCH 2/2] docs: update all GIT repo examples to use https:// protocol

2018-03-20 Thread Daniel P . Berrangé
The https:// protocol is much more reliably usable than git:// when faced with unreasonably strict firewalls. The libvirt.org web server is now setup to support the smart https:// protocol, which is just as fast as git://, so change all the docs to use https:// Signed-off-by: Daniel P. Berrangé

[libvirt] [PATCH 1/2] docs: remove obsolete docs about gitorious and cvs access

2018-03-20 Thread Daniel P . Berrangé
The gitorious.org service went away a long time ago now, and our main download.html page tells people where all the official mirrors are for every component. Meanwhile telling people about CVS is a bad joke in 2018, and the CVS server no longer exists on libvirt.org Signed-off-by: Daniel P.

[libvirt] [PATCH 0/2] Update docs for GIT repo access

2018-03-20 Thread Daniel P . Berrangé
Daniel P. Berrangé (2): docs: remove obsolete docs about gitorious and cvs access docs: update all GIT repo examples to use https:// protocol README-hacking | 2 +- docs/csharp.html.in | 2 +- docs/devguide.html.in| 6 +++--- docs/downloads.html.in | 9 +

[libvirt] [dbus PATCH v2 2/3] switch from sd-bus to GDBus implementation

2018-03-20 Thread Pavel Hrdina
This removes all the sd-bus code and uses GDBus instead. Signed-off-by: Pavel Hrdina --- README | 1 - configure.ac | 3 - data/Makefile.am | 4 +- data/org.libvirt.Connect.xml | 56 data/org.libvirt.Domain.xml |

[libvirt] [dbus PATCH v2 1/3] introduce support for GDBus implementation

2018-03-20 Thread Pavel Hrdina
We will switch to GDBus implementation of D-Bus protocol because sd-bus implementation is not thread safe. Processing messages in threads is essential since Libvirt API can take some significant amount of time to return and that would block the whole libvirt-dbus daemon. Signed-off-by: Pavel

[libvirt] [dbus PATCH v2 3/3] main: introduce thread pool to process D-Bus messages

2018-03-20 Thread Pavel Hrdina
The default thread count is currently 4 and it is also configurable via --threads/-t paramter for the libvirt-dbus daemon. Signed-off-by: Pavel Hrdina --- src/connect.c | 4 +++ src/connect.h | 1 + src/gdbus.c | 97

[libvirt] [dbus PATCH v2 0/3] rewrite to GDBus

2018-03-20 Thread Pavel Hrdina
Changes in v2: - removed patch that set the required libvirt version to libvirt-dbus version Pavel Hrdina (3): introduce support for GDBus implementation switch from sd-bus to GDBus implementation main: introduce thread pool to process D-Bus messages README

Re: [libvirt] [PATCHv2 00/25] Python tweaks

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 06:48:43AM +, Radostin Stoyanov wrote: > Changes since v1 > (https://www.redhat.com/archives/libvir-list/2018-March/msg01001.html) > > 01 - Fixed typo. > 03 - Added whitespace after comma in: value = value + > re.sub("^(\d+)U$","\\1", token[1]) > 05 and 06 - Use

[libvirt] [PATCH 4/4] virt-aa-helper: generate rules for nvdimm memory

2018-03-20 Thread Christian Ehrhardt
nvdimm memory is backed by a path on the host. This currently works only via hotplug where the AppArmor label is created via the domain label callbacks. This adds the virt-aa-helper support for nvdimm memory devices to generate rules for the needed paths from the initial guest definition as well.

[libvirt] [PATCH 0/4] Apparmor support for less common devices

2018-03-20 Thread Christian Ehrhardt
So far users added manual rules for most of these uncommon devices, but recent changes made some of the callbacks mandatory for hotplug so we should take shot at implementing them as those callbacks as well as for the initial start of a guest via virt-aa-helper. Christian Ehrhardt (4):

[libvirt] [PATCH 2/4] security, apparmor: add (Set|Restore)InputLabel

2018-03-20 Thread Christian Ehrhardt
d8116b5a "security: Introduce functions for input device hot(un)plug" implemented the code (Set|Restore)InputLabel for several security modules, this patch adds an AppArmor implementation for it as well. That fixes hot-plugging event input devices by generating a rule for the path that needs to

[libvirt] [PATCH 1/4] security, apparmor: add (Set|Restore)MemoryLabel

2018-03-20 Thread Christian Ehrhardt
Recent changes have made implementing this mandatory to hot add any memory. Implementing this in apparmor fixes this as well as allows hot-add of nvdimm tpye memory with an nvdimmPath set generating a AppArmor rule for that path. Example hot adding: /tmp/nvdimm-test

[libvirt] [PATCH 3/4] virt-aa-helper: generate rules for passthrough input devices

2018-03-20 Thread Christian Ehrhardt
Input devices can passthrough an event device. This currently works only via hotplug where the AppArmor label is created via the domain label callbacks. This adds the virt-aa-helper support for passthrough input devices to generate rules for the needed paths from the initial guest definition as

Re: [libvirt] [PATCH 3/3] Do not check for pkcheck

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 12:27:17PM +0100, Ján Tomko wrote: > On Mon, Mar 19, 2018 at 07:47:54PM +0100, Jiri Denemark wrote: > > On Wed, Mar 07, 2018 at 10:29:32 +0100, Ján Tomko wrote: > > > All we need is DBus. > > > > Unfortunately, this is wrong. From a compilation/linking POV we really > >

Re: [libvirt] [PATCH 3/3] Do not check for pkcheck

2018-03-20 Thread Ján Tomko
On Mon, Mar 19, 2018 at 07:47:54PM +0100, Jiri Denemark wrote: On Wed, Mar 07, 2018 at 10:29:32 +0100, Ján Tomko wrote: All we need is DBus. Unfortunately, this is wrong. From a compilation/linking POV we really don't need anything more than D-Bus. Good, we should compile as much code as we

Re: [libvirt] [PATCH] mingw: Require Fedora

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 11:42:38AM +0100, Andrea Bolognani wrote: > Although it was never formally specified, it was always expected > that the mingw RPM build would happen on Fedora, if anything > because RHEL / CentOS don't ship the necessary mingw dependencies. > > Make this fact explicit by

Re: [libvirt] [PATCH 3/4] mingw: Use Python 3 for building

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 11:53:54AM +0100, Andrea Bolognani wrote: > While RHEL / CentOS are still using Python 2 for the time being, > Fedora has already switched to Python 3 as the default Python > interpreter a while ago, so on that OS it doesn't make sense to > drag in Python 2 anymore. > >

Re: [libvirt] [PATCH 2/4] spec: Use Python 3 for building on Fedora

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 11:53:53AM +0100, Andrea Bolognani wrote: > While RHEL / CentOS are still using Python 2 for the time being, > Fedora has already switched to Python 3 as the default Python > interpreter a while ago, so on that OS it doesn't make sense to > drag in Python 2 anymore. While

Re: [libvirt] [PATCH 4/4] news: Update for Python 3 compatibility

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 11:53:55AM +0100, Andrea Bolognani wrote: > Signed-off-by: Andrea Bolognani > --- > docs/news.xml | 11 +++ > 1 file changed, 11 insertions(+) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |: https://berrange.com

Re: [libvirt] [PATCH 1/4] configure: Allow (and prefer) Python 3

2018-03-20 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 11:53:52AM +0100, Andrea Bolognani wrote: > Our build process no longer depends on Python 2, so we can > finally allow Python 3 to satisfy our requirement for a Python > interpreter. > > Since several distributions have now switched to installing > Python 3 by default and

Re: [libvirt] [PATCH] virDomainDeviceDefValidateAliasesIterator: Ignore some hostdevs

2018-03-20 Thread Jiri Denemark
On Fri, Mar 16, 2018 at 12:39:59 +0100, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1556828 > > When defining a domain that has our > parser creates two entries in virDomainDef: one for > and one for . However, some info is shared between the > two which makes user

[libvirt] [PATCH 4/4] news: Update for Python 3 compatibility

2018-03-20 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- docs/news.xml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 6d729d5085..75a0543084 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -35,6 +35,17 @@ + + +

[libvirt] [PATCH 2/4] spec: Use Python 3 for building on Fedora

2018-03-20 Thread Andrea Bolognani
While RHEL / CentOS are still using Python 2 for the time being, Fedora has already switched to Python 3 as the default Python interpreter a while ago, so on that OS it doesn't make sense to drag in Python 2 anymore. Signed-off-by: Andrea Bolognani --- libvirt.spec.in | 9

[libvirt] [PATCH 0/4] python3: Finishing touches

2018-03-20 Thread Andrea Bolognani
>>> import blurb Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'blurb' >>> Andrea Bolognani (4): configure: Allow (and prefer) Python 3 spec: Use Python 3 for building on Fedora mingw: Use Python 3 for building news: Update for Python 3

[libvirt] [PATCH 3/4] mingw: Use Python 3 for building

2018-03-20 Thread Andrea Bolognani
While RHEL / CentOS are still using Python 2 for the time being, Fedora has already switched to Python 3 as the default Python interpreter a while ago, so on that OS it doesn't make sense to drag in Python 2 anymore. Signed-off-by: Andrea Bolognani --- mingw-libvirt.spec.in

[libvirt] [PATCH 1/4] configure: Allow (and prefer) Python 3

2018-03-20 Thread Andrea Bolognani
Our build process no longer depends on Python 2, so we can finally allow Python 3 to satisfy our requirement for a Python interpreter. Since several distributions have now switched to installing Python 3 by default and Python 2 is on its way out, prefer the former when both are available.

[libvirt] [PATCH] mingw: Require Fedora

2018-03-20 Thread Andrea Bolognani
Although it was never formally specified, it was always expected that the mingw RPM build would happen on Fedora, if anything because RHEL / CentOS don't ship the necessary mingw dependencies. Make this fact explicit by erroring out if that's not the case, the same way we already do in the main

[libvirt] Race condition between qemuDomainCreate and qemuDomainDestroy

2018-03-20 Thread Marc Hartmayer
Hi, there is a race condition between 'qemuDomainCreate' and 'qemuDomainDestroy' causing a NULL pointer segmentation fault when accessing priv->monConfig. The race condition can be easily reproduced using gdb. (gdb) set non-stop on # set breakpoint on line 'mon = qemuMonitorOpen(vm, …)' (gdb) b

Re: [libvirt] Emacs tip for easily adding Reviewed-by tags & friends

2018-03-20 Thread Bjoern Walk
Daniel P. Berrangé [2018-03-15, 11:36AM +]: > It is nice that git has the short-hand for adding Signed-off-by, but > adding other tags during reviews is kind of tedious and long winded. > eg "ACK" is much shorter than typing "Reviewed-by: ...blah blah blah.." > > Good

Re: [libvirt] [PATCH] hyperv: Sync generator output between python versions

2018-03-20 Thread Andrea Bolognani
On Mon, 2018-03-19 at 15:38 -0400, Cole Robinson wrote: > Yet another dependency on dict() hash ordering > > Signed-off-by: Cole Robinson > --- > src/hyperv/hyperv_wmi_generator.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [libvirt] [PATCH] hyperv: Sync generator output between python versions

2018-03-20 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 03:38:04PM -0400, Cole Robinson wrote: > Yet another dependency on dict() hash ordering > > Signed-off-by: Cole Robinson > --- > src/hyperv/hyperv_wmi_generator.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Daniel P.

Re: [libvirt] [PATCH 0/3] libxl: misc fixes for migration

2018-03-20 Thread Olaf Hering
On Mon, Mar 19, Jim Fehlig wrote: > While working on the {Begin,End}API improvements I noticed a few problems > in the migration code. The first two are trival, but the third describes > a problem I encountered while testing, and provides a potential fix. See > the patch for more details. I

[libvirt] [snmp PATCH 2/2] Replace placeholder org OID with libvirt OID

2018-03-20 Thread Michael Corcoran
An OID of 36957 was assigned to libvirt by IANA, but the placeholder OID of 12345 was never replaced. IANA lists the libvirt registration as: 36957 libvirt Daniel Veillard daniel https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers Signed-off-by: Michael Corcoran

[libvirt] [snmp PATCH 1/2] Replace U64 with struct counter64 to fix build

2018-03-20 Thread Michael Corcoran
Upstream net-snmp removed the U64 typedef in 2016 as it clashed with a name in Perl, thus all usages of U64 must be replaced by struct counter64 to compile against recent versions of net-snmp. The replacements were made by hand, while referencing diff with new source generated by the mib2c tool.

[libvirt] [snmp PATCH 0/2] Fix build and use proper OID

2018-03-20 Thread Michael Corcoran
The first patch fixes the build against net-snmp newer than 2016ish, where they removed their U64 typedef from headers to avoid a Perl incompability. Second patch replaces the placeholder organisation OID (12345) with the IANA registered libvirt OID (36957). I have tested these patches lightly

Re: [libvirt] [PATCH] qemu: Don't assign alias to disabled balloon device

2018-03-20 Thread Peter Krempa
On Mon, Mar 19, 2018 at 20:20:23 +0100, Jiri Denemark wrote: > is the only way to disable balloon driver > since libvirt will add one automatically if the memballoon element is > missing. In other words, there's no balloon device if model is 'none' > and generating an alias for it makes no sense.

[libvirt] [PATCH] libvirt: Fix comments for two public APIs.

2018-03-20 Thread Han Han
Fix comments for virConnectListAllNodeDevices and virConnectListAllSecrets. Signed-off-by: Han Han --- src/libvirt-nodedev.c | 2 +- src/libvirt-secret.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c index

[libvirt] [PATCHv2 10/25] apibuild: Simplify conditional statements

2018-03-20 Thread Radostin Stoyanov
Improve readability by reducing the complexity and length of conditional statements. Example: The following condition: if (o >= 97 and o <= 122) or (o >= 65 and o <= 90) or (o >= 48 and o <= 57) or (" \t(){}:;,+-*/%&!|[]=><".find(line[i]) == -1): Will be

[libvirt] [PATCHv2 20/25] apibuild: Simplify type checking of literals

2018-03-20 Thread Radostin Stoyanov
Reduce the number of if-statements used to assign a literals to corresponding class variables. Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/docs/apibuild.py

[libvirt] [PATCHv2 16/25] apibuild: Drop backslash between brackets

2018-03-20 Thread Radostin Stoyanov
Backslash between brackets in Python is redundant. [1] 1: https://lintlyci.github.io/Flake8Rules/rules/E502.html Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git

[libvirt] [PATCHv2 15/25] python3: cpu-reformat: Use the print() function

2018-03-20 Thread Radostin Stoyanov
Replace the print statement, that is only available in Py2, with a print function that is available in both Py2 and Py3 and drop the explicit python version in the shebang. Signed-off-by: Radostin Stoyanov --- tests/cputestdata/cpu-reformat.py | 4 ++-- 1 file changed, 2

[libvirt] [PATCHv2 18/25] apibuild: Simplify strip_lead_star()

2018-03-20 Thread Radostin Stoyanov
The method strip_lead_star() removes a single leading asterisk character from a string by ignoring leading whitespace, otherwise it returns the original string. This could be achieved with a single if-statement followed by replace. Signed-off-by: Radostin Stoyanov ---

[libvirt] [PATCHv2 24/25] apibuild: Remove redundant parentheses

2018-03-20 Thread Radostin Stoyanov
http://pylint-messages.wikidot.com/messages:c0325 Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 74 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index

[libvirt] [PATCHv2 04/25] python: Add whitespace around = and % operators

2018-03-20 Thread Radostin Stoyanov
Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 18 +- docs/index.py | 6 +++--- tests/cputestdata/cpu-cpuid.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/apibuild.py

[libvirt] [PATCHv2 06/25] esx_vi_generator: Simplify generate_helper_header

2018-03-20 Thread Radostin Stoyanov
The function generate_helper_header() only returns a formatted string. This could be achieved without performing string concatenation. Signed-off-by: Radostin Stoyanov --- src/esx/esx_vi_generator.py | 22 +- 1 file changed, 9 insertions(+), 13

[libvirt] [PATCHv2 05/25] esx_vi_generator: Simplify generate_helper_source

2018-03-20 Thread Radostin Stoyanov
The generate_helper_source() function returns a formatted string. This could be achieved without the use of a local variable "source" and string concatenation. Signed-off-by: Radostin Stoyanov --- src/esx/esx_vi_generator.py | 31 --- 1 file

[libvirt] [PATCHv2 03/25] apibuild: Remove whitespace before ', ' and ':'

2018-03-20 Thread Radostin Stoyanov
PEP8 recommends removing whitespace immediately before a comma, semicolon, or colon [1]. In addition remove multiple spaces after keyword (PEP8 - E271). 1: https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements Signed-off-by: Radostin Stoyanov

[libvirt] [PATCHv2 11/25] python: Remove space around = in keyword args

2018-03-20 Thread Radostin Stoyanov
PEP8 recommends not having spaces around = in a keyword argument or a default parameter value. https://www.python.org/dev/peps/pep-0008/#other-recommendations Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 24

[libvirt] [PATCHv2 25/25] apibuild: Simplify getline()

2018-03-20 Thread Radostin Stoyanov
Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 1f9c8f12c..5e218a9ad 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -432,21 +432,17 @@

[libvirt] [PATCHv2 22/25] apibuild: Simplify merging of preproc tokens

2018-03-20 Thread Radostin Stoyanov
Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 98224c7e7..4c8fa5740 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -478,8 +478,8 @@ class

[libvirt] [PATCHv2 17/25] apibuild: Fix indentation not multiple of 4

2018-03-20 Thread Radostin Stoyanov
PEP8 recommends that the number of spaces used for indentation of Python code to be a multiple of four [1] [2]. 1: https://lintlyci.github.io/Flake8Rules/rules/E111.html 2: https://lintlyci.github.io/Flake8Rules/rules/E114.html Signed-off-by: Radostin Stoyanov ---

[libvirt] [PATCHv2 23/25] apibuild: Simplify parsing string tokens

2018-03-20 Thread Radostin Stoyanov
Improve readability and reduce the complexity of the code that is searching for string tokens (i.e. characters surrounded by a single or double quote). Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 32 ++-- 1 file changed, 10

[libvirt] [PATCHv2 21/25] apibuild: Use list comprehension insteand of map

2018-03-20 Thread Radostin Stoyanov
Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index f073b36c7..98224c7e7 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -471,8 +471,7 @@ class CLexer:

[libvirt] [PATCHv2 19/25] apibuild: Simplify parseTypeComment()

2018-03-20 Thread Radostin Stoyanov
Improve readability and reduce complexity the method parseTypeComment(). Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 42 -- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/docs/apibuild.py

[libvirt] [PATCHv2 14/25] apibuild: Avoid double sorting of ids

2018-03-20 Thread Radostin Stoyanov
The uniq() function returns a sorted list, there is no need to sort this list again. Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index

[libvirt] [PATCHv2 13/25] apibuild: Simplify uniq function

2018-03-20 Thread Radostin Stoyanov
Use a set (unordered collections of unique elements) [1] to remove repeated elements in a list. 1: https://docs.python.org/3/tutorial/datastructures.html#sets Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-)

[libvirt] [PATCHv2 09/25] cfg.mk: check ctype_macros only on *.[c|h] files

2018-03-20 Thread Radostin Stoyanov
The functions like isalnum(), isalpha(), isdigit(), etc. are also available in Python, however `make syntax-check` do not intend to prohibit them. Signed-off-by: Radostin Stoyanov --- cfg.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/cfg.mk b/cfg.mk index

[libvirt] [PATCHv2 12/25] WmiClass: Don't share "versions" between instances

2018-03-20 Thread Radostin Stoyanov
Lists in Python are mutable and when used as a default value of a parameter for class constructor, its value will be shared between all class instances. Example: class Test: def __init__(self, mylist=[]): self.mylist = mylist A = Test() B =

[libvirt] [PATCHv2 07/25] esx_vi_generator: Simplify get_occurrence_comment

2018-03-20 Thread Radostin Stoyanov
Reduce the number of if-statements and use a single return. Utilise a dictionary to map between occurrences and values. Signed-off-by: Radostin Stoyanov --- src/esx/esx_vi_generator.py | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git

[libvirt] [PATCHv2 08/25] esx_vi_generator: Simplify alignment function

2018-03-20 Thread Radostin Stoyanov
Generate whitespace using the standard function ljust() that is available in both Py3 [1] and Py2 [2]. 1: https://docs.python.org/3/library/stdtypes.html?highlight=strip#str.ljust 2: https://docs.python.org/2.7/library/string.html#string.ljust Signed-off-by: Radostin Stoyanov

[libvirt] [PATCHv2 01/25] apibuild: Use isinstance for type checking

2018-03-20 Thread Radostin Stoyanov
The isinstance() function [1] returns true if an object argument is an instance of a classinfo argument or of a direct, indirect subclass thereof. 1: https://docs.python.org/3/library/functions.html#isinstance Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 7

[libvirt] [PATCHv2 00/25] Python tweaks

2018-03-20 Thread Radostin Stoyanov
Changes since v1 (https://www.redhat.com/archives/libvir-list/2018-March/msg01001.html) 01 - Fixed typo. 03 - Added whitespace after comma in: value = value + re.sub("^(\d+)U$","\\1", token[1]) 05 and 06 - Use printf style format and break strings everywhere there is a newline. 07 - Use

[libvirt] [PATCHv2 02/25] apibuild: Split imports on separate lines

2018-03-20 Thread Radostin Stoyanov
PEP8 recommends imports to be on separate lines. [1] 1: https://www.python.org/dev/peps/pep-0008/#imports Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index