Re: [libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

2018-03-13 Thread Jonathan Davies
On 13/03/18 14:23, Daniel P. Berrangé wrote: On Tue, Mar 13, 2018 at 02:07:08PM +, Jonathan Davies wrote: qemuDomainDetachNetDevice should not treat a timeout in a call to qemuDomainWaitForDeviceRemoval as success. Instead, it should treat it as failure -- this is the intention behind

[libvirt] [RFC PATCH 5/5] docs: Port apibuild.py to Python 3

2018-03-13 Thread Andrea Bolognani
A lot of tweaks needed. The generated files are bit by bit identical to those produced before when the script is invoked using Python 2, but using Python 3 results in some errors being reported and the build step to be considered failed. The output files are mostly the same, except , and are

[libvirt] [PATCH 0/5] Partially successful attempt at Python 3 compatibility

2018-03-13 Thread Andrea Bolognani
We use Python in out build system: more specifically, we're stuck with Python 2 even though Python 3's been out for a decade and some major Linux distributions have gone Python 3-only recently. This series tries to solve the issue, but falls quite short. Maybe someone who actually knows Python

[libvirt] [RFC PATCH 3/5] esx: Port esx_vi_generator.py to Python 3

2018-03-13 Thread Andrea Bolognani
Very few tweaks needed. The generated files are bit by bit identical to those produced before, regardless of whether the script is invoked using Python 2 or Python 3. Signed-off-by: Andrea Bolognani --- src/esx/esx_vi_generator.py | 30 +- 1

[libvirt] [PATCH 2/5] docs: Call reformat-news.py with $(PYTHON)

2018-03-13 Thread Andrea Bolognani
This is the only Python script which we invoke directly, which works pretty fine in general but becomes a problem if the user has explicitly overridden Python binary detection at configure time. Signed-off-by: Andrea Bolognani --- docs/Makefile.am | 2 +- 1 file changed, 1

Re: [libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

2018-03-13 Thread Daniel P . Berrangé
On Tue, Mar 13, 2018 at 06:13:46PM +, Jonathan Davies wrote: > On 13/03/18 14:23, Daniel P. Berrangé wrote: > > On Tue, Mar 13, 2018 at 02:07:08PM +, Jonathan Davies wrote: > > > qemuDomainDetachNetDevice should not treat a timeout in a call to > > > qemuDomainWaitForDeviceRemoval as

[libvirt] [PATCH 1/5] NEWS: Move generation to the docs/ directory

2018-03-13 Thread Andrea Bolognani
All the input files and scripts used to generate the release notes live in the docs/ directory, so it makes sense for the output file to be created there as well. A symbolic link is created in the top-level source directory to comply with GNU standards as well as user expectations. Signed-off-by:

[libvirt] [RFC PATCH 4/5] hyperv: Port hyperv_wmi_generator.py to Python 3

2018-03-13 Thread Andrea Bolognani
A few tweaks needed. The generated files are bit by bit identical to those produced before when the script is invoked using Python 2, but not when Python 3 is used, in which case members of the various structs are shuffled around. Signed-off-by: Andrea Bolognani ---

Re: [libvirt] [PATCH 01/20] bhyve: Use virDomainObjListFindBy{UUID|ID}Ref

2018-03-13 Thread Marc Hartmayer
On Fri, Mar 09, 2018 at 05:47 PM +0100, John Ferlan wrote: > For bhyveDomObjFromDomain, bhyveDomainLookupByUUID, and > bhyveDomainLookupByID let's return a locked and referenced > @vm object so that callers can then use the common and more > consistent virDomainObjEndAPI in

Re: [libvirt] [PATCH 05/20] openvz: Cleanup indention

2018-03-13 Thread Marc Hartmayer
On Fri, Mar 09, 2018 at 05:48 PM +0100, John Ferlan wrote: > Some of the indents were only 2 spaces, make consistent w/ 4 spaces > > Signed-off-by: John Ferlan > --- > src/openvz/openvz_driver.c | 64 > +++--- > 1

Re: [libvirt] [dbus PATCH 13/18] domain: ensure connection to libvirt

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:43PM +0100, Pavel Hrdina wrote: > Fixes an bug that was introduced by <8e24f602>. > > Signed-off-by: Pavel Hrdina > --- > src/connect.c | 2 +- > src/connect.h | 4 > src/domain.c | 51 +++

Re: [libvirt] [dbus PATCH 14/18] connect: parse message arguments as first thing

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:44PM +0100, Pavel Hrdina wrote: > There is no need to open connection if parsing arguments fails. > > Signed-off-by: Pavel Hrdina > --- > src/connect.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) Reviewed-by: Daniel P.

[libvirt] [PATCH 0/2] [pushed] Trivial followup fixes for a trivial patch

2018-03-13 Thread Ján Tomko
I managed to push commit 1cdc9ece without incorporating Andrea's review feedback. These are the follow-up fixes I pushed as trivial before the commit police gets me. Ján Tomko (2): Adjust whitespace in virDomainDefHasUSB prototype qemuDomainUSBAddressAddHubs: use numeric comparison

[libvirt] [PATCH 2/2] qemuDomainUSBAddressAddHubs: use numeric comparison

2018-03-13 Thread Ján Tomko
Since data.count is not a pointer, but an integer, compare it against an integer value instead of using the implicit "boolean" conversion that is customarily used for pointers. Signed-off-by: Ján Tomko --- src/qemu/qemu_domain_address.c | 2 +- 1 file changed, 1 insertion(+),

[libvirt] [PATCH 1/2] Adjust whitespace in virDomainDefHasUSB prototype

2018-03-13 Thread Ján Tomko
To match the rest of the file. Signed-off-by: Ján Tomko --- src/conf/domain_conf.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 5859c8f4b..337ce7942 100644 --- a/src/conf/domain_conf.h +++

Re: [libvirt] [dbus PATCH 05/18] domain: introduce VIRT_DBUS_DOMAIN_INTERFACE

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:35PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/domain.c | 2 +- > src/domain.h | 2 ++ > src/events.c | 8 > 3 files changed, 7 insertions(+), 5 deletions(-) Reviewed-by: Daniel P. Berrangé

Re: [libvirt] [dbus PATCH 07/18] events: fix function names for TrayChange and DiskChange events

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:37PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/events.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |:

Re: [libvirt] [dbus PATCH 06/18] events: fix signal message for TrayChange event

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:36PM +0100, Pavel Hrdina wrote: > The reply contains only two strings. > > Signed-off-by: Pavel Hrdina > --- > src/events.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Daniel P. Berrangé Regards,

Re: [libvirt] [dbus PATCH 08/18] main: error out if signal handler is not registered

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:38PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/main.c | 4 > 1 file changed, 4 insertions(+) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |: https://berrange.com -o-

Re: [libvirt] [dbus PATCH 04/18] connect: introduce VIRT_DBUS_CONNECT_INTERFACE

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:34PM +0100, Pavel Hrdina wrote: > This also fixes the one wrong interface name in events.c. > > Signed-off-by: Pavel Hrdina > --- > src/connect.c | 2 +- > src/connect.h | 2 ++ > src/events.c | 2 +- > 3 files changed, 4 insertions(+), 2

Re: [libvirt] [dbus PATCH 03/18] util: introduce VIRT_DBUS_ERROR_INTERFACE

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:33PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/util.c | 4 ++-- > src/util.h | 2 ++ > 2 files changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |:

Re: [libvirt] [GSoC]: Help in setup

2018-03-13 Thread Sukrit Bhatnagar
Here is the output: skrtbhtngr@ubuntu:~/libvirt$ ./autogen.sh --system Updating submodules... Submodule 'gnulib' (git://git.sv.gnu.org/gnulib.git) registered for path '.gnulib' Submodule 'keycodemapdb' (https://gitlab.com/keycodemap/keycodemapdb.git) registered for path 'src/keycodemapdb'

Re: [libvirt] [dbus PATCH 12/18] maint: cleanup includes

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:42PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/connect.c | 1 - > src/domain.c | 1 + > src/domain.h | 1 - > src/events.c | 1 + > src/events.h | 3 --- > src/main.c| 2 ++ > src/util.c| 2 ++ > src/util.h

Re: [libvirt] [dbus PATCH 11/18] maint: fix coding style

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:41PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/connect.h | 21 ++--- > src/domain.c | 1 + > src/util.c| 42 +- > 3 files changed, 36 insertions(+), 28

Re: [libvirt] [dbus PATCH 10/18] spec: don't use hard-coded system_user

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:40PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > libvirt-dbus.spec.in | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |:

Re: [libvirt] [dbus PATCH 09/18] main: fix error message

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:39PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |: https://berrange.com -o-

[libvirt] [PATCH] build: Add srpm make target

2018-03-13 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.am b/Makefile.am index 0d46c16c22..81c7f52d9c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,6 +69,9 @@ EXTRA_DIST += \ rpm: clean @(unset CDPATH ;

Re: [libvirt] [dbus PATCH 16/18] introduce support for libdbus library

2018-03-13 Thread Pavel Hrdina
On Mon, Mar 12, 2018 at 04:30:30PM +, Daniel P. Berrangé wrote: > On Mon, Mar 12, 2018 at 05:21:46PM +0100, Pavel Hrdina wrote: > > We will switch to libdbus library because the systemd sd-bus > > implementation is not thread safe. > > Hmmm, libdbus.so isn't all that great with threads

Re: [libvirt] [dbus PATCH 15/18] domain: create a helper function to get a domain object

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:45PM +0100, Pavel Hrdina wrote: > This is called for every API, create a function for it. > > Signed-off-by: Pavel Hrdina > --- > src/domain.c | 220 > --- > 1 file changed, 75

Re: [libvirt] [GSoC]: Help in setup

2018-03-13 Thread Erik Skultety
On Tue, Mar 13, 2018 at 02:09:30AM +0530, Sukrit Bhatnagar wrote: > Hi, > > I am Sukrit, currently pursuing Masters in Computer Science and Engineering > from Indian Institute of Technology Bombay, India. > > I am interested in applying for a few projects listed on the ideas page. > > But, I am

Re: [libvirt] [dbus PATCH 02/18] util: there is no need to mark cleanup functions as inline

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:32PM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > src/util.c | 34 ++ > src/util.h | 38 -- > 2 files changed, 42 insertions(+), 30 deletions(-) Reviewed-by:

Re: [libvirt] [dbus PATCH 16/18] introduce support for libdbus library

2018-03-13 Thread Daniel P . Berrangé
On Tue, Mar 13, 2018 at 09:39:13AM +0100, Pavel Hrdina wrote: > On Mon, Mar 12, 2018 at 04:30:30PM +, Daniel P. Berrangé wrote: > > On Mon, Mar 12, 2018 at 05:21:46PM +0100, Pavel Hrdina wrote: > > > We will switch to libdbus library because the systemd sd-bus > > > implementation is not

Re: [libvirt] [dbus PATCH 01/18] util: rename VIR_ATTR_UNUSED

2018-03-13 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 05:21:31PM +0100, Pavel Hrdina wrote: > The correct prefix is VIRT. > > Signed-off-by: Pavel Hrdina > --- > src/connect.c | 8 +++--- > src/domain.c | 78 > +-- > src/events.c | 12 -

Re: [libvirt] [PATCH v2 04/10] tests: domainsnapshotxml2xml: Remove testing with allowed format detection

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:30 +0100, Peter Krempa wrote: > We have a test of the domain XML that allows format detection, so > there's no need to do it for snapshot XMLs where the parameter would > influence the domain XML portion. > --- >

[libvirt] [PATCH 2/2] virSecurityDACChownListFree: Don't leak list->items array

2018-03-13 Thread Michal Privoznik
We're freeing individual items in it but not the array itself. ==19200== 40 bytes in 1 blocks are definitely lost in loss record 847 of 1,059 ==19200==at 0x4C2D12F: realloc (vg_replace_malloc.c:785) ==19200==by 0x52C5532: virReallocN (viralloc.c:245) ==19200==by 0x52C5628: virExpandN

[libvirt] [PATCH 0/2] Two small memleak fixes

2018-03-13 Thread Michal Privoznik
*** BLURB HERE *** Michal Privoznik (2): virSysinfoParseX86Chassis: Store asset tag into correct pointer virSecurityDACChownListFree: Don't leak list->items array src/security/security_dac.c | 1 + src/util/virsysinfo.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) --

[libvirt] [PATCH] qemuAssignDeviceInputAlias: Be tolerant to pre-existent alias

2018-03-13 Thread Michal Privoznik
This is missing in 6bc4a371cf and therefore we are effectively overwriting user provided aliases for devices. Signed-off-by: Michal Privoznik --- src/qemu/qemu_alias.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c

[libvirt] [PATCH 1/2] virSysinfoParseX86Chassis: Store asset tag into correct pointer

2018-03-13 Thread Michal Privoznik
Probably due to copy-paste error we're storing asset tag into def->sku which we even use in the next step to store SKU number and thus the asset tag leaks. ==19200== 41 bytes in 1 blocks are definitely lost in loss record 849 of 1,059 ==19200==at 0x4C2AF0F: malloc (vg_replace_malloc.c:299)

Re: [libvirt] [PATCH v2 07/10] tests: qemuxml2xml: Remove fake status XML testing

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:33 +0100, Peter Krempa wrote: > Now that the better approach is in place we can remove the old functions > doing the fake formatting. > > Signed-off-by: Peter Krempa > --- > tests/qemuxml2xmltest.c | 218 >

Re: [libvirt] [GSoC]: Help in setup

2018-03-13 Thread Daniel P . Berrangé
On Tue, Mar 13, 2018 at 01:37:25PM +0100, Cedric Bosdonnat wrote: > On Tue, 2018-03-13 at 16:45 +0530, Sukrit Bhatnagar wrote: > > Here is the output: > > > > skrtbhtngr@ubuntu:~/libvirt$ ./autogen.sh --system > > > > Updating submodules... > > Submodule 'gnulib'

[libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

2018-03-13 Thread Jonathan Davies
qemuDomainDetachNetDevice should not treat a timeout in a call to qemuDomainWaitForDeviceRemoval as success. Instead, it should treat it as failure -- this is the intention behind having a timeout. If qemuDomainWaitForDeviceRemoval times out, it returns 0. In this instance, if

Re: [libvirt] [PATCH] conf: allow more user friendly names for disk formats

2018-03-13 Thread Kashyap Chamarthy
On Mon, Mar 12, 2018 at 01:57:36PM +, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > src/conf/domain_conf.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > index

Re: [libvirt] [PATCH 1/2] virSysinfoParseX86Chassis: Store asset tag into correct pointer

2018-03-13 Thread Peter Krempa
On Tue, Mar 13, 2018 at 14:37:04 +0100, Michal Privoznik wrote: > Probably due to copy-paste error we're storing asset tag into > def->sku which we even use in the next step to store SKU number > and thus the asset tag leaks. > > ==19200== 41 bytes in 1 blocks are definitely lost in loss record

Re: [libvirt] [PATCH v2 09/10] tests: qemuxml2xml: Add modern example of status XML to the test

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:35 +0100, Peter Krempa wrote: > Signed-off-by: Peter Krempa > --- > tests/qemustatusxml2xmldata/modern-in.xml | 448 > + > tests/qemustatusxml2xmldata/modern-out.xml | 1 + > tests/qemuxml2xmltest.c

Re: [libvirt] [PATCH v2 01/10] tests: qemuxml2xml: Rename testInfoFree to testInfoClear

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:27 +0100, Peter Krempa wrote: > Signed-off-by: Peter Krempa > --- > tests/qemuxml2xmltest.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) ACK Jirka -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH v2 05/10] tests: qemuxml2xml: Add proper domain status XML testing

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:31 +0100, Peter Krempa wrote: > Add new approach to properly test status XML files by supplying a full > XML file rather than generating synthetic test cases by prepending the > status header. The two tests introduced here are copies of existing > cases using the

Re: [libvirt] [PATCH v2 06/10] tests: qemuxml2xml: Add synthetic test for in status XML

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:32 +0100, Peter Krempa wrote: > Add a random lockstate string to the status XML2XML test. > > Signed-off-by: Peter Krempa > --- > tests/qemustatusxml2xmldata/blockjob-mirror-in.xml | 1 + > 1 file changed, 1 insertion(+) ACK Jirka --

Re: [libvirt] [GSoC]: Help in setup

2018-03-13 Thread Cedric Bosdonnat
On Tue, 2018-03-13 at 16:45 +0530, Sukrit Bhatnagar wrote: > Here is the output: > > skrtbhtngr@ubuntu:~/libvirt$ ./autogen.sh --system > > Updating submodules... > Submodule 'gnulib' (git://git.sv.gnu.org/gnulib.git) registered for path > '.gnulib' > Submodule 'keycodemapdb'

Re: [libvirt] [dbus PATCH 16/18] introduce support for libdbus library

2018-03-13 Thread Daniel P . Berrangé
On Tue, Mar 13, 2018 at 10:07:58AM +, Daniel P. Berrangé wrote: > On Tue, Mar 13, 2018 at 09:39:13AM +0100, Pavel Hrdina wrote: > > On Mon, Mar 12, 2018 at 04:30:30PM +, Daniel P. Berrangé wrote: > > > On Mon, Mar 12, 2018 at 05:21:46PM +0100, Pavel Hrdina wrote: > > > > We will switch to

Re: [libvirt] [PATCH 05/20] openvz: Cleanup indention

2018-03-13 Thread John Ferlan
On 03/13/2018 03:58 AM, Marc Hartmayer wrote: > On Fri, Mar 09, 2018 at 05:48 PM +0100, John Ferlan > wrote: >> Some of the indents were only 2 spaces, make consistent w/ 4 spaces >> >> Signed-off-by: John Ferlan >> --- >> src/openvz/openvz_driver.c |

Re: [libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

2018-03-13 Thread Peter Krempa
On Tue, Mar 13, 2018 at 14:07:08 +, Jonathan Davies wrote: > qemuDomainDetachNetDevice should not treat a timeout in a call to > qemuDomainWaitForDeviceRemoval as success. Instead, it should treat it > as failure -- this is the intention behind having a timeout. > > If

Re: [libvirt] [PATCH v2 08/10] tests: util: Remove callback from testCompareDomXML2XMLFiles

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:34 +0100, Peter Krempa wrote: > The testCompareDomXML2XMLPreFormatCallback is no longer used and thus > can be removed. > > Signed-off-by: Peter Krempa > --- > tests/genericxml2xmltest.c | 2 +- > tests/lxcxml2xmltest.c | 2 +- >

Re: [libvirt] [GSoC]: Help in setup

2018-03-13 Thread Radostin Stoyanov
On 13/03/18 12:41, Daniel P. Berrangé wrote: > On Tue, Mar 13, 2018 at 01:37:25PM +0100, Cedric Bosdonnat wrote: >> On Tue, 2018-03-13 at 16:45 +0530, Sukrit Bhatnagar wrote: >>> Here is the output: >>> >>> skrtbhtngr@ubuntu:~/libvirt$ ./autogen.sh --system >>> >>> Updating submodules... >>>

Re: [libvirt] [PATCH] qemuAssignDeviceInputAlias: Be tolerant to pre-existent alias

2018-03-13 Thread Ján Tomko
On Tue, Mar 13, 2018 at 02:37:30PM +0100, Michal Privoznik wrote: This is missing in 6bc4a371cf and therefore we are effectively overwriting user provided aliases for devices. Signed-off-by: Michal Privoznik --- src/qemu/qemu_alias.c | 3 +++ 1 file changed, 3

Re: [libvirt] [PATCH v2 03/10] tests: qemuxml2xml: Remove testing with allowed format detection

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:29 +0100, Peter Krempa wrote: > Nobody should use format detection due to security implications. The > result of the change is that 'raw' format will be printed unless > specified explicitly. > > Signed-off-by: Peter Krempa > --- ACK Jirka --

Re: [libvirt] [PATCH v2 02/10] tests: qemu: Explicitly add tests with format probing allowed

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:28 +0100, Peter Krempa wrote: > Add a single testcase for the case where format probing is allowed. > > Signed-off-by: Peter Krempa > --- > .../qemuxml2argvdata/disk-many-format-probing.args | 29 >

Re: [libvirt] [PATCH v2 10/10] tests: qemuxml2xml: Add status XML with outgoing migration with NBD

2018-03-13 Thread Jiri Denemark
On Wed, Mar 07, 2018 at 15:42:36 +0100, Peter Krempa wrote: > Signed-off-by: Peter Krempa > --- > .../qemustatusxml2xmldata/migration-out-nbd-in.xml | 449 > + > .../migration-out-nbd-out.xml | 1 + > tests/qemuxml2xmltest.c

Re: [libvirt] [PATCH 01/20] bhyve: Use virDomainObjListFindBy{UUID|ID}Ref

2018-03-13 Thread John Ferlan
On 03/13/2018 03:44 AM, Marc Hartmayer wrote: > On Fri, Mar 09, 2018 at 05:47 PM +0100, John Ferlan > wrote: >> For bhyveDomObjFromDomain, bhyveDomainLookupByUUID, and >> bhyveDomainLookupByID let's return a locked and referenced >> @vm object so that callers can then use

[libvirt] [PATCH 01/10] conf: Remove unnecessary condition from virDomainDiskSourceFormatInternal

2018-03-13 Thread Peter Krempa
Now that the function is using virXMLFormatElement we don't need to conditionally format anything, since we'll format the element according to the presence of content. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 126

[libvirt] [PATCH 04/10] conf: Refactor formatting of startupPolicy in virDomainDiskSourceFormatInternal

2018-03-13 Thread Peter Krempa
Move it to a single location which also allows to get rid of the temporrary variable. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[libvirt] [PATCH 02/10] conf: Refactor seclabel formatting in virDomainDiskSourceFormatInternal

2018-03-13 Thread Peter Krempa
Call the formatter function only once. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ddabc77a9b..ebe1172fd2 100644 ---

[libvirt] [PATCH 00/10] conf: Make disk source parsing cleaner and reusable

2018-03-13 Thread Peter Krempa
Fixup and cleanup the disk source parsing code and make it usable in other parts of the code by exporting it. Peter Krempa (10): conf: Remove unnecessary condition from virDomainDiskSourceFormatInternal conf: Refactor seclabel formatting in virDomainDiskSourceFormatInternal conf:

[libvirt] [PATCH 10/10] conf: Add and export wrapper for parsing storage source XML

2018-03-13 Thread Peter Krempa
Add a helper that parses a storage source XML node into a new virStorageSource object. Since there are multiple approaches to store the 'type' and 'format' attributes, they need to be parsed manually prior to calling the function. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 07/10] conf: Separate seclabel validation from parsing

2018-03-13 Thread Peter Krempa
Rather than checking that the security label is legal when parsing it move the code into a separate function. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 68 -- 1 file changed, 44 insertions(+), 24 deletions(-)

[libvirt] [PATCH 09/10] conf: Extract parsing of storage source related data

2018-03-13 Thread Peter Krempa
Split out the parser and separate it from the private data part so that it can be later reused in other parts of the code. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 43 +-- 1 file changed, 29 insertions(+), 14

Re: [libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

2018-03-13 Thread Daniel P . Berrangé
On Tue, Mar 13, 2018 at 03:42:10PM +0100, Jiri Denemark wrote: > On Tue, Mar 13, 2018 at 14:23:22 +, Daniel P. Berrangé wrote: > > On Tue, Mar 13, 2018 at 02:07:08PM +, Jonathan Davies wrote: > > > If qemuDomainWaitForDeviceRemoval times out, it returns 0. In this > > > instance, if

Re: [libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

2018-03-13 Thread Jiri Denemark
On Tue, Mar 13, 2018 at 14:23:22 +, Daniel P. Berrangé wrote: > On Tue, Mar 13, 2018 at 02:07:08PM +, Jonathan Davies wrote: > > If qemuDomainWaitForDeviceRemoval times out, it returns 0. In this > > instance, if qemuDomainDetachNetDevice returns 0, virsh detach-interface > > reports: > >

[libvirt] [PATCH] tests: Fix path to status XML test directory in makefile

2018-03-13 Thread Peter Krempa
Commit 99e30acfdce added 'qemustatusxml2xmloutdata' to EXTRA_DIST but the directory added in the commit is called 'qemustatusxml2xmldata' Signed-off-by: Peter Krempa --- Pushed under the I-didn't-run-distcheck-when-messing-with-files-in-the-tree-and-broke-the-build-rule.

Re: [libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

2018-03-13 Thread Daniel P . Berrangé
On Tue, Mar 13, 2018 at 02:07:08PM +, Jonathan Davies wrote: > qemuDomainDetachNetDevice should not treat a timeout in a call to > qemuDomainWaitForDeviceRemoval as success. Instead, it should treat it > as failure -- this is the intention behind having a timeout. Actually this is intentional

[libvirt] [PATCH] tests: bhyvexml2xml: Fix call to testCompareDomXML2XMLFiles

2018-03-13 Thread Peter Krempa
Commit 1b28038300b forgot to fix the arguments for this one caller. Signed-off-by: Peter Krempa --- Pushed under the build-breaker rule. tests/bhyvexml2xmltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bhyvexml2xmltest.c

[libvirt] [PATCH] virsysinfo: Use more virSkipSpacesBackwards()

2018-03-13 Thread Michal Privoznik
Some fields reported by dmidecode have plenty of useless spaces (in fact some have nothing but spaces). To deal with this we have introduced virSkipSpacesBackwards() and use it in virSysinfoParseX86Processor() and virSysinfoParseX86Memory(). However, other functions (e.g.

[libvirt] [PATCH 08/10] conf: Parse and validate disk source seclabels together with the source

2018-03-13 Thread Peter Krempa
Since seclabels are formatted along with the source element and will also make sense to be passed for the backing chain we should parse them in the place where we parse the disk source. Same applies for validation. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 39

[libvirt] [PATCH 06/10] conf: Validate disk source configuration also for the backing store

2018-03-13 Thread Peter Krempa
Since we already parse the of a disk source, we should also validate the configuration for the whole backing chain and not only for the top level image. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 24 ++-- 1 file changed, 14 insertions(+),

Re: [libvirt] [PATCH 2/2] virSecurityDACChownListFree: Don't leak list->items array

2018-03-13 Thread Peter Krempa
On Tue, Mar 13, 2018 at 14:37:05 +0100, Michal Privoznik wrote: > We're freeing individual items in it but not the array itself. > > ==19200== 40 bytes in 1 blocks are definitely lost in loss record 847 of 1,059 > ==19200==at 0x4C2D12F: realloc (vg_replace_malloc.c:785) > ==19200==by

Re: [libvirt] [PATCH] build: Add srpm make target

2018-03-13 Thread Andrea Bolognani
On Tue, 2018-03-13 at 11:20 +0100, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > Makefile.am | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/Makefile.am b/Makefile.am > index 0d46c16c22..81c7f52d9c 100644 > --- a/Makefile.am > +++ b/Makefile.am >

[libvirt] [PATCH 05/10] conf: disk: Separate virStorageSource formatting

2018-03-13 Thread Peter Krempa
Move out formatting of 'startuPolicy' which is a property of the disk out of the element. Extracting the code formating the content and attributes will also allow reuse in other parts of the code. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 90

[libvirt] [PATCH 03/10] conf: Remove virDomainDiskSourceDefFormatSeclabel

2018-03-13 Thread Peter Krempa
The wrapper functionality can be moved to the only user virDomainDiskSourceFormatInternal. Also removes comment which does not reflect the truth any more. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 31 +++ 1 file changed, 7

Re: [libvirt] [PATCH 01/20] bhyve: Use virDomainObjListFindBy{UUID|ID}Ref

2018-03-13 Thread Marc Hartmayer
On Tue, Mar 13, 2018 at 01:39 PM +0100, John Ferlan wrote: > On 03/13/2018 03:44 AM, Marc Hartmayer wrote: >> On Fri, Mar 09, 2018 at 05:47 PM +0100, John Ferlan >> wrote: >>> For bhyveDomObjFromDomain, bhyveDomainLookupByUUID, and >>>

Re: [libvirt] [PATCH] bugfix: add lock in ClientClose to avoid data race

2018-03-13 Thread John Ferlan
On 03/01/2018 04:43 AM, xinhua.Cao wrote: > From: l00425170 > > When libvirt client registers callback function, > remoteDispatchConnectDomainEventCallbackRegisterAny is called, then > virInsertElementsN > will be called to add new callback for struct

[libvirt] [PATCH security-notice 1/4] LSN-2018-0001 / CVE-2017-5715 - Spectre variant 2 branch target injection

2018-03-13 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- notices/2018/0001.xml | 276 ++ 1 file changed, 276 insertions(+) create mode 100644 notices/2018/0001.xml diff --git a/notices/2018/0001.xml b/notices/2018/0001.xml new file mode 100644

[libvirt] [PATCH security-notice 0/4] Add missing security notices

2018-03-13 Thread Daniel P . Berrangé
This provides the security notices we've had so far in 2018 and a script to make future ones easier to create. Daniel P. Berrangé (4): LSN-2018-0001 / CVE-2017-5715 - Spectre variant 2 branch target injection LSN-2018-0002 / CVE-2018-5748 - QEMU monitor denial of service LSN-2018-0003 /

Re: [libvirt] [PATCH 01/20] bhyve: Use virDomainObjListFindBy{UUID|ID}Ref

2018-03-13 Thread John Ferlan
On 03/13/2018 12:44 PM, Marc Hartmayer wrote: > On Tue, Mar 13, 2018 at 01:39 PM +0100, John Ferlan > wrote: >> On 03/13/2018 03:44 AM, Marc Hartmayer wrote: >>> On Fri, Mar 09, 2018 at 05:47 PM +0100, John Ferlan >>> wrote: For

[libvirt] [PATCH security-notice 2/4] LSN-2018-0002 / CVE-2018-5748 - QEMU monitor denial of service

2018-03-13 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- notices/2018/0002.xml | 274 ++ 1 file changed, 274 insertions(+) create mode 100644 notices/2018/0002.xml diff --git a/notices/2018/0002.xml b/notices/2018/0002.xml new file mode 100644

[libvirt] [PATCH security-notice 4/4] Add a script for generating a list of vulnerable tags & branches

2018-03-13 Thread Daniel P . Berrangé
It is rather tedious making the list of vulnerable tags and branches for the security notice reports. This script takes the changeset of the commit that first introduced the flaw and then outputs an XML snippet listing every tag and branch which contains that vulnerable changeset. This can be

[libvirt] [PATCH 2/4] libxl: MigrateConfirm: Dont unlock virDomainObj in helper function

2018-03-13 Thread Jim Fehlig
The libxlDomainMigrateConfirm3Params API locks and ref counts the associated virDomainObj but relies on the helper function libxlDomainMigrationConfirm to unlock the object. Unref'ing the object is not done in either function. libxlDomainMigrationConfirm is also used by

[libvirt] [PATCH 3/4] libxl: MigratePrepare: properly cleanup after virDomainObjListAdd

2018-03-13 Thread Jim Fehlig
libxlDomainMigrationPrepare adds the incoming domain def to the list of domains via virDomainObjListAdd, which returns a locked and ref counted virDomainObj. On exit the object is unlocked but not unref'ed. The same is true for libxlDomainMigrationPrepareTunnel3. Convert both to use the

[libvirt] [PATCH 0/4] libxl: fix virDomainObj locking and ref counting in migration APIs

2018-03-13 Thread Jim Fehlig
While reviewing a patch [0] from John's series to rework virDomainObjListFindBy{UUID|ID}Ref, I noticed several problems with locking and ref counting in the libxl migration APIs. This series changes the Begin, Prepare, Perform, and Confirm APIs to use the standard pattern of get a locked and ref

[libvirt] [PATCH 4/4] libxl: MigratePerform: properly cleanup after libxlDomObjFromDomain

2018-03-13 Thread Jim Fehlig
ibxlDomObjFromDomain to returns locked and ref counted virDomainObj but libxlDomainMigratePerform3Params only unlocks the object on exit. Convert it to use the virDomainObjEndAPI function for cleanup. Signed-off-by: Jim Fehlig --- src/libxl/libxl_driver.c | 3 +-- 1 file

[libvirt] [PATCH security-notice 3/4] LSN-2018-0003 / CVE-2018-6764 - Insecure usage of NSS modules during container startup

2018-03-13 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- notices/2018/0003.xml | 269 ++ 1 file changed, 269 insertions(+) create mode 100644 notices/2018/0003.xml diff --git a/notices/2018/0003.xml b/notices/2018/0003.xml new file mode 100644

[libvirt] [PATCH 1/4] libxl: MigrateBegin: Dont call EndAPI in helper function

2018-03-13 Thread Jim Fehlig
The libxlDomainMigrateBegin3Params API locks and ref counts the associated virDomainObj but relies on the helper function libxlDomainMigrationBegin to unref/unlock the object. libxlDomainMigrationBegin is also used by libxlDomainMigratePerform3Params for p2p migration, but in that case the

[libvirt] [PATCH 0/2] qemu: Remove memory backing files on failed memory hotplug

2018-03-13 Thread Peter Krempa
see 2/2 Peter Krempa (2): REPRODUCER -- DO NOT PUSH qemu: hotplug: Clean up memory backing files after failed memory hotplug dom.xml | 110 mem.xml | 6 +++ src/qemu/qemu_hotplug.c | 7 +++ 3 files

[libvirt] [PATCH 2/2] qemu: hotplug: Clean up memory backing files after failed memory hotplug

2018-03-13 Thread Peter Krempa
Libvirt provides full path to the backing file since commit fec8f9c49afb479f6. This made qemu create the backend object but did not delete it. This was fixed for unplug case in 4d83a6722f but not in case of failure to hotplug the frontend. We'd leave the files behind which would make memory

[libvirt] [PATCH 1/2] REPRODUCER -- DO NOT PUSH

2018-03-13 Thread Peter Krempa
https://bugzilla.redhat.com/show_bug.cgi?id=1553085 This breaks hotplug so that we can see whether the file was left dangling. Reproduce by: virsh create dom.xml virsh attach-device memplug mem.xml ls /var/lib/libvirt/qemu/ram/libvirt/qemu/*-memplug After the failed hotplug, qemu should leave

Re: [libvirt] [PATCH] qemu: hotplug: fail when net device detach times out

2018-03-13 Thread Jiri Denemark
On Tue, Mar 13, 2018 at 18:20:51 +, Daniel P. Berrangé wrote: > On Tue, Mar 13, 2018 at 06:13:46PM +, Jonathan Davies wrote: > > Thanks all the helpful replies. > > > > Just to check I've understood: The design is that the call is synchronous > > but may become asynchronous if it times