[libvirt] [PATCH 3/3] util: introduce virSocketAddrParseQuiet

2018-03-19 Thread Jim Fehlig
When preparing for migration, the libxl driver creates a new TCP listen socket for the incoming migration by calling virNetSocketNewListenTCP, passing the destination host name. virNetSocketNewListenTCP calls virSocketAddrParse to check if the host name is a wildcard address, in which case it

[libvirt] [PATCH 2/3] libxl: remove needless 'else' in libxlDomainMigrationPrepare

2018-03-19 Thread Jim Fehlig
Signed-off-by: Jim Fehlig --- src/libxl/libxl_migration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index c1c23dab3..f0001f9f7 100644 --- a/src/libxl/libxl_migration.c +++

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

2018-03-19 Thread Jim Fehlig
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. Jim Fehlig (3): libxl: dont dereference NULL

[libvirt] [PATCH 1/3] libxl: dont dereference NULL libxlDomainObjPrivatePtr

2018-03-19 Thread Jim Fehlig
In libxlDomainMigrationPrepare it is possible to dereference a NULL libxlDomainObjPrivatePtr in early error paths. Check for a valid 'priv' before using it. Signed-off-by: Jim Fehlig --- src/libxl/libxl_migration.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-)

[libvirt] [PATCH 1/3] libxl: lock virDomainObj after ListRemove

2018-03-19 Thread Jim Fehlig
Most libxl driver API use the pattern of lock and add a ref to virDomainObj, perform API, then decrement ref and unlock in virDomainEndAPI. In some cases the API may call virDomainObjListRemove, which unlocks the virDomainObj. Relock the object in such cases so EndAPI is called with a locked

[libvirt] [PATCH 0/3] libxl: finish use of {Begin, End}API pattern in APIs

2018-03-19 Thread Jim Fehlig
This is a follow-up to John and I's recent work to improve locking and ref counting of virDomainObj in the libxl driver. These patches change the remaining APIs to use the begin and end API pattern used throughout libxl and other drivers. Jim Fehlig (3): libxl: lock virDomainObj after

[libvirt] [PATCH 3/3] libxl: convert DefineXMLFlags to use begin/end API pattern

2018-03-19 Thread Jim Fehlig
Similar to other uses of virDomainObjListAdd, on success add a ref to the virDomainObj so that virDomainObjEndAPI can be called as usual. Signed-off-by: Jim Fehlig --- src/libxl/libxl_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[libvirt] [PATCH 2/3] libxl: call EndJob in error case

2018-03-19 Thread Jim Fehlig
If starting the domain fails in libxlDomainCreateXML, we mistakenly jumped to cleanup without calling libxlDomainObjEndJob. Remove the jump to 'cleanup'. Signed-off-by: Jim Fehlig --- src/libxl/libxl_driver.c | 1 - 1 file changed, 1 deletion(-) diff --git

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

2018-03-19 Thread Cole Robinson
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 a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_generator.py index

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

2018-03-19 Thread Jiri Denemark
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. The alias will be ignored when parsing the XML and it will disappear

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

2018-03-19 Thread Jiri Denemark
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. But we polkit to actually work, we need more. Thus we can end up enabling polkit even though it is not

[libvirt] [PATCH v2 3/7] tests: Add test cases for virtio-gpu-ccw

2018-03-19 Thread Farhan Ali
A test cases to test the virtio-gpu-ccw device. Signed-off-by: Farhan Ali Signed-off-by: Boris Fiuczynski --- .../qemuxml2argvdata/video-virtio-gpu-ccw-auto.xml | 18 ++ tests/qemuxml2argvdata/video-virtio-gpu-ccw.args | 25

[libvirt] [PATCH v2 5/7] qemu: Add support for virtio input ccw devices

2018-03-19 Thread Farhan Ali
QEMU on S390 (since v2.11) can support virtio input ccw devices. So build the qemu command line for ccw devices. Signed-off-by: Farhan Ali --- docs/formatdomain.html.in | 2 ++ src/qemu/qemu_command.c | 14 +++--- 2 files changed, 13 insertions(+), 3

[libvirt] [PATCH v2 6/7] tests: Add test case for virtio input ccw devices

2018-03-19 Thread Farhan Ali
Test for virtio-{keyboard, mouse, tablet}-ccw. Signed-off-by: Farhan Ali Signed-off-by: Boris Fiuczynski --- tests/qemuxml2argvdata/input-virtio-ccw.args | 26 +++ tests/qemuxml2argvdata/input-virtio-ccw.xml | 29

[libvirt] [PATCH v2 7/7] news: Update for virtio-gpu-ccw and virtio input ccw devices

2018-03-19 Thread Farhan Ali
Document support for the virtio-gpu-ccw and virtio-{keyboard, mouse, tablet}-ccw devices. Signed-off-by: Farhan Ali Reviewed-by: Boris Fiuczynski --- docs/news.xml | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml

[libvirt] [PATCH v2 0/7] Add support for video and input devices on S390

2018-03-19 Thread Farhan Ali
Hi, This patch series adds Libvirt support for video and input devices for QEMU guests on S390. QEMU v2.11.0 added support for the virtio-gpu-ccw device [1] and virtio-{keyboard, mouse, tablet}-ccw devices [2], which can be used as video and input devices respectively. Thanks Farhan [1]

[libvirt] [PATCH v2 2/7] qemu: Add support for virtio-gpu-ccw video device on S390

2018-03-19 Thread Farhan Ali
QEMU on S390 (since v2.11) can support the virtio-gpu-ccw device, which can be used as a video device. Signed-off-by: Farhan Ali --- docs/formatdomain.html.in | 3 +++ src/qemu/qemu_command.c| 13 +++-- src/qemu/qemu_domain.c | 2 +-

[libvirt] [PATCH v2 4/7] qemu: Introduce capabilities for virtio input ccw devices

2018-03-19 Thread Farhan Ali
QEMU on S390 (since v2.11) can support virtio input ccw devices. Introduce qemu capabilities for these devices. Signed-off-by: Farhan Ali Signed-off-by: Boris Fiuczynski --- src/qemu/qemu_capabilities.c | 8

[libvirt] [PATCH v2 1/7] qemu: Introduce a new capability for virtio-gpu-ccw

2018-03-19 Thread Farhan Ali
QEMU on S390 (since v2.11) can support virtio-gpu-ccw device. Let's introduce a new qemu capability for the device. Signed-off-by: Farhan Ali Signed-off-by: Boris Fiuczynski --- src/qemu/qemu_capabilities.c | 5 ++

Re: [libvirt] [PATCH 09/22] apibuild: Simplify conditional statements

2018-03-19 Thread Radostin Stoyanov
On 19/03/18 10:52, Daniel P. Berrangé wrote: >> -o = ord(line[i]) >> -if (o >= 97 and o <= 122) or (o >= 65 and o <= 90) or \ >> - (o >= 48 and o <= 57): >> +if re.match(r"[a-zA-Z0-9]", line[i]): > Why not just use isalnum()

Re: [libvirt] [PATCH 07/22] esx_vi_generator: Simplify get_occurrence_comment

2018-03-19 Thread Radostin Stoyanov
On 19/03/18 11:40, Marc Hartmayer wrote: > On Sat, Mar 17, 2018 at 03:23 PM +0100, Radostin Stoyanov > wrote: >> 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

Re: [libvirt] [PATCH 05/22] esx_vi_generator: Simplify generate_helper_source

2018-03-19 Thread Radostin Stoyanov
On 19/03/18 10:42, Daniel P. Berrangé wrote: > On Sat, Mar 17, 2018 at 02:23:23PM +, Radostin Stoyanov wrote: >> The generate_helper_source() function returns a formatted string. >> This could be achieved without the use of a local variable "source" >> and string concatenation. >> >>

Re: [libvirt] [PATCH 00/22] Python tweaks

2018-03-19 Thread Radostin Stoyanov
On 19/03/18 11:03, Daniel P. Berrangé wrote: > On Mon, Mar 19, 2018 at 10:36:28AM +, Daniel P. Berrangé wrote: >> On Sat, Mar 17, 2018 at 02:23:18PM +, Radostin Stoyanov wrote: >>> These patches improve the code style of python code >>> by applying some PEP8 recommendations and

Re: [libvirt] [PATCH v5 7/9] tests: check CPU features handling in libxl driver

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 04:14:20PM +0100, Marek Marczykowski-Górecki wrote: > On Mon, Mar 19, 2018 at 02:11:02PM +, Daniel P. Berrangé wrote: > > On Fri, Mar 16, 2018 at 08:54:42PM +0100, Marek Marczykowski-Górecki wrote: > > > On Fri, Mar 16, 2018 at 05:44:28PM +, Daniel P. Berrangé

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

2018-03-19 Thread Andrea Bolognani
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. Signed-off-by: Andrea Bolognani --- guests/site.yml

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

2018-03-19 Thread Andrea Bolognani
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 + guests/tasks/user.yml| 10 ++ 2 files changed, 11 insertions(+) create mode 100644

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

2018-03-19 Thread Andrea Bolognani
See patch 3/3 for the rationale. Andrea Bolognani (3): guests: Rename 'ci' flavor to 'jenkins' guests: Factor out user creation guests: Configure ccache guests/README.markdown | 9 + guests/files/ccache.conf | 1 + guests/lcitool | 12 ++-- guests/site.yml

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

2018-03-19 Thread Andrea Bolognani
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 user of the 'ci' flavor, and we can easily coordinate a configuration change to

Re: [libvirt] [dbus PATCH 5/8] maint: set the first minimal version that will be released

2018-03-19 Thread Pavel Hrdina
On Mon, Mar 19, 2018 at 02:16:15PM +, Daniel P. Berrangé wrote: > On Mon, Mar 19, 2018 at 02:56:49PM +0100, Pavel Hrdina wrote: > > On Mon, Mar 19, 2018 at 01:42:11PM +, Daniel P. Berrangé wrote: > > > On Mon, Mar 19, 2018 at 10:30:49AM +0100, Pavel Hrdina wrote: > > > > We will require

Re: [libvirt] [PATCH v5 7/9] tests: check CPU features handling in libxl driver

2018-03-19 Thread Marek Marczykowski-Górecki
On Mon, Mar 19, 2018 at 02:11:02PM +, Daniel P. Berrangé wrote: > On Fri, Mar 16, 2018 at 08:54:42PM +0100, Marek Marczykowski-Górecki wrote: > > On Fri, Mar 16, 2018 at 05:44:28PM +, Daniel P. Berrangé wrote: > > > Since Xen lets you specify raw "cpuid" register values here, surely > > >

Re: [libvirt] [PATCH 04/20] test: Implement virConnectSupportsFeature

2018-03-19 Thread Daniel P . Berrangé
On Wed, Mar 14, 2018 at 06:35:59PM -0400, John Ferlan wrote: > > > On 03/08/2018 07:20 AM, Marc Hartmayer wrote: > > Implement virConnectSupportsFeature for the test driver as this API is > > used by various API functions (the functions usually use the macro > > VIR_DRV_SUPPORTS_FEATURE for

Re: [libvirt] [PATCH 02/20] remote: Don't hard code the feature VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK as available

2018-03-19 Thread Daniel P . Berrangé
On Thu, Mar 08, 2018 at 01:20:25PM +0100, Marc Hartmayer wrote: > Don't assume that the feature VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK is > available for every driver used for the connection. The very definition of the virConnectRegisterCloseCallback() API is that it will always succeed. What

Re: [libvirt] [PATCH 03/20] virConnect(Un)RegisterCloseCallback: Throw an error in case the API is not supported

2018-03-19 Thread Daniel P . Berrangé
On Thu, Mar 08, 2018 at 01:20:26PM +0100, Marc Hartmayer wrote: > Report an error in case the driver does not support > connect(Un)registerCloseCallback. The commit 'close callback: move it > to driver' (88f09b75eb99) moved the responsibility for the close > callback to the driver. But if the

Re: [libvirt] [PATCH 05/20] test: Implement virConnect(Un)RegisterCloseCallback

2018-03-19 Thread Daniel P . Berrangé
On Thu, Mar 08, 2018 at 01:20:28PM +0100, Marc Hartmayer wrote: > Implement the hypervisor APIs virConnectRegisterCloseCallback and > virConnectUnregisterCloseCallbacks and mark this feature as supported > in testConnectSupportsFeature. This increases test test coverage of > the test suite as then

Re: [libvirt] [PATCH] pci: Ignore 32-bit PCIe domains

2018-03-19 Thread Keith Busch
On Mon, Mar 19, 2018 at 12:21:35PM +, Daniel P. Berrangé wrote: > On Fri, Mar 16, 2018 at 11:39:36AM -0600, Keith Busch wrote: > > Intel VMD creates secondary PCIe domain, where child devices in this > > domain are aggregated behind a single end point. Linux exposes these > > as special 32-bit

Re: [libvirt] [dbus PATCH 6/8] introduce support for GDBus implementation

2018-03-19 Thread Pavel Hrdina
On Mon, Mar 19, 2018 at 01:47:20PM +, Daniel P. Berrangé wrote: > On Mon, Mar 19, 2018 at 10:30:50AM +0100, Pavel Hrdina wrote: > > We will switch to GDBus implementation of D-Bus protocol because > > sd-bus implementation is not thread safe. > > > > Processing messages in threads is

Re: [libvirt] [dbus PATCH 5/8] maint: set the first minimal version that will be released

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 02:56:49PM +0100, Pavel Hrdina wrote: > On Mon, Mar 19, 2018 at 01:42:11PM +, Daniel P. Berrangé wrote: > > On Mon, Mar 19, 2018 at 10:30:49AM +0100, Pavel Hrdina wrote: > > > We will require libvirt to have at least the same version as > > > libvirt-dbus. The 1.2.12

Re: [libvirt] [PATCH v5 7/9] tests: check CPU features handling in libxl driver

2018-03-19 Thread Daniel P . Berrangé
On Fri, Mar 16, 2018 at 08:54:42PM +0100, Marek Marczykowski-Górecki wrote: > On Fri, Mar 16, 2018 at 05:44:28PM +, Daniel P. Berrangé wrote: > > Since Xen lets you specify raw "cpuid" register values here, surely > > this is flexible enough to allow us to support the mode=custom CPU > >

Re: [libvirt] [dbus PATCH 5/8] maint: set the first minimal version that will be released

2018-03-19 Thread Pavel Hrdina
On Mon, Mar 19, 2018 at 01:42:11PM +, Daniel P. Berrangé wrote: > On Mon, Mar 19, 2018 at 10:30:49AM +0100, Pavel Hrdina wrote: > > We will require libvirt to have at least the same version as > > libvirt-dbus. The 1.2.12 version is the lowest one which we will > > support since it introduced

Re: [libvirt] [dbus PATCH 6/8] introduce support for GDBus implementation

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 10:30:50AM +0100, Pavel Hrdina wrote: > 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

Re: [libvirt] [dbus PATCH 4/8] m4: remove gnulib compile warning exceptions

2018-03-19 Thread Pavel Hrdina
On Mon, Mar 19, 2018 at 01:39:38PM +, Daniel P. Berrangé wrote: > On Mon, Mar 19, 2018 at 10:30:48AM +0100, Pavel Hrdina wrote: > > We don't use gnulib so there is no need to have them. > > > > Signed-off-by: Pavel Hrdina > > --- > > m4/virt-compile-warnings.m4 | 37

Re: [libvirt] [dbus PATCH 5/8] maint: set the first minimal version that will be released

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 10:30:49AM +0100, Pavel Hrdina wrote: > We will require libvirt to have at least the same version as > libvirt-dbus. The 1.2.12 version is the lowest one which we will > support since it introduced virDomainDefineXMLFlags() and we don't > have to support the non-flags

Re: [libvirt] [dbus PATCH 4/8] m4: remove gnulib compile warning exceptions

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 10:30:48AM +0100, Pavel Hrdina wrote: > We don't use gnulib so there is no need to have them. > > Signed-off-by: Pavel Hrdina > --- > m4/virt-compile-warnings.m4 | 37 - > 1 file changed, 37 deletions(-)

Re: [libvirt] [dbus PATCH 3/8] spec: explicitly require gcc

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 10:30:47AM +0100, Pavel Hrdina wrote: > Based on discussion on fedora devel list gcc will be removed from > default buildroot. > > Signed-off-by: Pavel Hrdina > --- > libvirt-dbus.spec.in | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Daniel P.

Re: [libvirt] [dbus PATCH 2/8] configure: use LIBVIRT_ARG_WITH macro

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 10:30:46AM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > configure.ac | 33 + > 1 file changed, 9 insertions(+), 24 deletions(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel

Re: [libvirt] [dbus PATCH 1/8] configure: call AC_PROG_CC_STDC to enable C99 if necessary

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 10:30:45AM +0100, Pavel Hrdina wrote: > This is required to enable C99 on older systems, CentOS 7 for example. > > Signed-off-by: Pavel Hrdina > --- > configure.ac | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Daniel P. Berrangé

Re: [libvirt] [PATCH 01/22] apibuild: Use isinctance for type checking

2018-03-19 Thread Andrea Bolognani
On Sat, 2018-03-17 at 14:23 +, Radostin Stoyanov wrote: > 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 > >

Re: [libvirt] [PATCH] pci: Ignore 32-bit PCIe domains

2018-03-19 Thread Daniel P . Berrangé
On Fri, Mar 16, 2018 at 11:39:36AM -0600, Keith Busch wrote: > Intel VMD creates secondary PCIe domain, where child devices in this > domain are aggregated behind a single end point. Linux exposes these > as special 32-bit domains, and devices in them are not individually > assignable. IIUC, your

[libvirt] [PATCH] pci: Ignore 32-bit PCIe domains

2018-03-19 Thread Keith Busch
Intel VMD creates secondary PCIe domain, where child devices in this domain are aggregated behind a single end point. Linux exposes these as special 32-bit domains, and devices in them are not individually assignable. This patch ignores devices in such domains as desired, and prevents logging

Re: [libvirt] [Libguestfs] [PATCH tck] Relabel SELinux when customizing virt-builder image

2018-03-19 Thread Richard W.M. Jones
On Wed, Feb 07, 2018 at 11:10:25AM +, Richard W.M. Jones wrote: > Yes, in fact I think it could go further and just call > SELinux_relabel.relabel on every guest, since that code just ignores > non-SELinux guests. > > Basically the reasons it doesn't do this are historical and possibly a >

Re: [libvirt] [PATCH] tools: fix variable scope in in check_guests_shutdown

2018-03-19 Thread Michal Privoznik
On 03/19/2018 12:44 PM, Christian Ehrhardt wrote: > libvirt-guests.sh when run with more active guests than requested to > shut down in parallel will run until it times out only shutting down > the first set of guests. > > This patch fixes parallel shutdown by fixing a variable scope issue >

Re: [libvirt] [PATCH] virt-aa-helper: resolve file symlinks

2018-03-19 Thread Michal Privoznik
On 03/19/2018 11:10 AM, Christian Ehrhardt wrote: > In a recent change b932ed69: "virt-aa-helper: resolve yet to be created > paths" several cases with symlinks in paths were fixed, but it regressed > cases where the file being last element of the path was the actual link. > > In the case of the

[libvirt] [PATCH] tools: fix variable scope in in check_guests_shutdown

2018-03-19 Thread Christian Ehrhardt
libvirt-guests.sh when run with more active guests than requested to shut down in parallel will run until it times out only shutting down the first set of guests. This patch fixes parallel shutdown by fixing a variable scope issue where check_guests_shutdown unintentionally reset $guests which

Re: [libvirt] [PATCH 07/22] esx_vi_generator: Simplify get_occurrence_comment

2018-03-19 Thread Marc Hartmayer
On Sat, Mar 17, 2018 at 03:23 PM +0100, Radostin Stoyanov wrote: > 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 > --- >

Re: [libvirt] [PATCH 00/22] Python tweaks

2018-03-19 Thread Daniel P . Berrangé
On Mon, Mar 19, 2018 at 10:36:28AM +, Daniel P. Berrangé wrote: > On Sat, Mar 17, 2018 at 02:23:18PM +, Radostin Stoyanov wrote: > > These patches improve the code style of python code > > by applying some PEP8 recommendations and simplifying > > some functions. > > How did you identify

Re: [libvirt] [PATCH 22/22] apibuild: Simplify parsing string tokens

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:40PM +, Radostin Stoyanov wrote: > 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 > --- >

Re: [libvirt] [PATCH 21/22] apibuild: Simplify merging of preproc tokens

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:39PM +, Radostin Stoyanov wrote: > Signed-off-by: Radostin Stoyanov > --- > docs/apibuild.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |:

Re: [libvirt] [PATCH 20/22] apibuild: Use list comprehension insteand of map

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:38PM +, Radostin Stoyanov wrote: > Signed-off-by: Radostin Stoyanov > --- > docs/apibuild.py | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |:

Re: [libvirt] [PATCH 19/22] apibuild: Simplify type checking of literals

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:37PM +, Radostin Stoyanov wrote: > 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

Re: [libvirt] [PATCH 18/22] apibuild: Simplify parseTypeComment()

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:36PM +, Radostin Stoyanov wrote: > Improve readability and reduce complexity the method > parseTypeComment(). > > Signed-off-by: Radostin Stoyanov > --- > docs/apibuild.py | 42 -- > 1 file changed,

Re: [libvirt] [PATCH 17/22] apibuild: Simplify strip_lead_star()

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:35PM +, Radostin Stoyanov wrote: > 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

Re: [libvirt] [PATCH 16/22] apibuild: Fix indentation not multiple of 4

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:34PM +, Radostin Stoyanov wrote: > 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:

Re: [libvirt] [PATCH 15/22] apibuild: Drop backslash between brackets

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:33PM +, Radostin Stoyanov wrote: > 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

Re: [libvirt] [PATCH 14/22] python3: cpu-reformat: Use the print() function

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:32PM +, Radostin Stoyanov wrote: > 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

Re: [libvirt] [PATCH 13/22] apibuild: Avoid double sorting of ids

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:31PM +, Radostin Stoyanov wrote: > 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

Re: [libvirt] [PATCH 12/22] apibuild: Simplify uniq function

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:30PM +, Radostin Stoyanov wrote: > 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 >

Re: [libvirt] [PATCH 09/22] apibuild: Simplify conditional statements

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:27PM +, Radostin Stoyanov wrote: > 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

Re: [libvirt] [PATCH 10/22] python: Remove space around = in keyword args

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:28PM +, Radostin Stoyanov wrote: > 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 >

Re: [libvirt] [PATCH 11/22] WmiClass: Don't share "versions" between instances

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:29PM +, Radostin Stoyanov wrote: > 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,

Re: [libvirt] [PATCH 08/22] esx_vi_generator: Simplify alignment function

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:26PM +, Radostin Stoyanov wrote: > 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:

Re: [libvirt] [PATCH 07/22] esx_vi_generator: Simplify get_occurrence_comment

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:25PM +, Radostin Stoyanov wrote: > 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 | 20

Re: [libvirt] [PATCH 06/22] esx_vi_generator: Simplify generate_helper_header

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:24PM +, Radostin Stoyanov wrote: > The function generate_helper_header() only returns a formatted string. > This could be achieved without performing string concatenation. > > Signed-off-by: Radostin Stoyanov > --- >

Re: [libvirt] [PATCH 05/22] esx_vi_generator: Simplify generate_helper_source

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:23PM +, Radostin Stoyanov wrote: > 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 >

Re: [libvirt] [PATCH 00/22] Python tweaks

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:18PM +, Radostin Stoyanov wrote: > These patches improve the code style of python code > by applying some PEP8 recommendations and simplifying > some functions. How did you identify all the places that needed fixing ? I'm assuming you were running via some

Re: [libvirt] [PATCH 04/22] python: Add whitespace around = and % operators

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:22PM +, Radostin Stoyanov wrote: > Signed-off-by: Radostin Stoyanov > --- > docs/apibuild.py | 18 +- > docs/index.py | 6 +++--- > tests/cputestdata/cpu-cpuid.py | 2 +- > 3 files changed,

Re: [libvirt] [PATCH 03/22] apibuild: Remove whitespace before ', ' and ':'

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:21PM +, Radostin Stoyanov wrote: > PEP8 recommends removing whitespace immediately before a comma, > semicolon, or colon [1]. In addition remove multiple spaces after > keyword (PEP8 - E271). > > 1: >

Re: [libvirt] [PATCH 02/22] apibuild: Split imports on separate lines

2018-03-19 Thread Daniel P . Berrangé
On Sat, Mar 17, 2018 at 02:23:20PM +, Radostin Stoyanov wrote: > 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

Re: [libvirt] [PATCH 01/22] apibuild: Use isinctance for type checking

2018-03-19 Thread Daniel P . Berrangé
s/isinctance/isinstance/ in the $subject On Sat, Mar 17, 2018 at 02:23:19PM +, Radostin Stoyanov wrote: > 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:

Re: [libvirt] [PATCH 2/2] python: Drop explicit version where possible

2018-03-19 Thread Andrea Bolognani
On Thu, 2018-03-15 at 17:07 +, Daniel P. Berrangé wrote: > On Thu, Mar 15, 2018 at 06:00:38PM +0100, Andrea Bolognani wrote: > > Some of our scripts are known to work both with Python 2 and > > Python 3, so for them we shouldn't be forcing any specific > > version of the interpreter when

Re: [libvirt] [PATCH v2 2/2] qemu: hostdev: Fix the error on VM start with an mdev when IOMMU is off

2018-03-19 Thread Erik Skultety
On Fri, Mar 16, 2018 at 06:14:56PM +0100, Peter Krempa wrote: > On Fri, Mar 16, 2018 at 13:37:54 +0100, Erik Skultety wrote: > > Commit b4c2ac8d56 made a false assumption that IOMMU support necessary > > for an mdev device to be assigned to a VM. Unlike direct PCI assignment, > > IOMMU support is

[libvirt] [PATCH] virt-aa-helper: resolve file symlinks

2018-03-19 Thread Christian Ehrhardt
In a recent change b932ed69: "virt-aa-helper: resolve yet to be created paths" several cases with symlinks in paths were fixed, but it regressed cases where the file being last element of the path was the actual link. In the case of the last element being the symlink realpath can (and shall) be

Re: [libvirt] [PATCH] virNetlinkDumpCommand: Don't leak response buffer

2018-03-19 Thread Michal Privoznik
On 03/19/2018 10:13 AM, Erik Skultety wrote: > On Mon, Mar 19, 2018 at 07:47:08AM +0100, Michal Privoznik wrote: >> ==16451== 32,768 bytes in 2 blocks are definitely lost in loss record 1,007 >> of 1,013 >> ==16451==at 0x4C2AF0F: malloc (vg_replace_malloc.c:299) >> ==16451==by 0x7CADB40:

[libvirt] [dbus PATCH 4/8] m4: remove gnulib compile warning exceptions

2018-03-19 Thread Pavel Hrdina
We don't use gnulib so there is no need to have them. Signed-off-by: Pavel Hrdina --- m4/virt-compile-warnings.m4 | 37 - 1 file changed, 37 deletions(-) diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index

[libvirt] [dbus PATCH 0/8] some improvements and rewrite to GDBus

2018-03-19 Thread Pavel Hrdina
Pavel Hrdina (8): configure: call AC_PROG_CC_STDC to enable C99 if necessary configure: use LIBVIRT_ARG_WITH macro spec: explicitly require gcc m4: remove gnulib compile warning exceptions maint: set the first minimal version that will be released introduce support for GDBus

[libvirt] [dbus PATCH 6/8] introduce support for GDBus implementation

2018-03-19 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 5/8] maint: set the first minimal version that will be released

2018-03-19 Thread Pavel Hrdina
We will require libvirt to have at least the same version as libvirt-dbus. The 1.2.12 version is the lowest one which we will support since it introduced virDomainDefineXMLFlags() and we don't have to support the non-flags APIs. Signed-off-by: Pavel Hrdina --- configure.ac

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

2018-03-19 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 3/8] spec: explicitly require gcc

2018-03-19 Thread Pavel Hrdina
Based on discussion on fedora devel list gcc will be removed from default buildroot. Signed-off-by: Pavel Hrdina --- libvirt-dbus.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/libvirt-dbus.spec.in b/libvirt-dbus.spec.in index 87f20d4..ce5cecf 100644 ---

[libvirt] [dbus PATCH 2/8] configure: use LIBVIRT_ARG_WITH macro

2018-03-19 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- configure.ac | 33 + 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/configure.ac b/configure.ac index 6715960..df1a375 100644 --- a/configure.ac +++ b/configure.ac @@ -41,34 +41,19 @@

[libvirt] [dbus PATCH 1/8] configure: call AC_PROG_CC_STDC to enable C99 if necessary

2018-03-19 Thread Pavel Hrdina
This is required to enable C99 on older systems, CentOS 7 for example. Signed-off-by: Pavel Hrdina --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index aef3d37..6715960 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6

Re: [libvirt] [PATCH] virNetlinkDumpCommand: Don't leak response buffer

2018-03-19 Thread Erik Skultety
On Mon, Mar 19, 2018 at 07:47:08AM +0100, Michal Privoznik wrote: > ==16451== 32,768 bytes in 2 blocks are definitely lost in loss record 1,007 > of 1,013 > ==16451==at 0x4C2AF0F: malloc (vg_replace_malloc.c:299) > ==16451==by 0x7CADB40: nl_recv (in /usr/lib64/libnl-3.so.200.23.0) >

Re: [libvirt] [PATCH] gnulib: switch to use https:// instead of git:// protocol

2018-03-19 Thread Erik Skultety
On Fri, Mar 16, 2018 at 05:30:20PM +, Daniel P. Berrangé wrote: > Some contributors are behind obnoxious firewalls that block everything > except http(s) traffic, preventing checkout of modules using the git:// > protocol. Since git.savannah.gnu.org is using the modern, fast HTTP > transport,

Re: [libvirt] [GSoC] Pointers for project idea

2018-03-19 Thread Cedric Bosdonnat
Hi Sukrit, On Sat, 2018-03-17 at 19:42 +0530, Sukrit Bhatnagar wrote: > Can anyone provide me with some pointers for the project "Conversion to and > from OCI formatted containers"? > > I have referred to the relevant source files listed on the ideas page and > would like to read more about

[libvirt] [PATCH] virNetlinkDumpCommand: Don't leak response buffer

2018-03-19 Thread Michal Privoznik
==16451== 32,768 bytes in 2 blocks are definitely lost in loss record 1,007 of 1,013 ==16451==at 0x4C2AF0F: malloc (vg_replace_malloc.c:299) ==16451==by 0x7CADB40: nl_recv (in /usr/lib64/libnl-3.so.200.23.0) ==16451==by 0x532DFAC: virNetlinkDumpCommand (virnetlink.c:363) ==16451==