[PATCH 1/7] test_driver: Replace virAtomicIntAdd() with virAtomicIntInc()

2020-01-31 Thread Michal Privoznik
Instead of calling virAtomicIntAdd(, 1); we can call virAtomicIntInc() directly. Signed-off-by: Michal Privoznik --- src/test/test_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 47c1fc588f..6f617592f3 100644 ---

[PATCH 6/7] src: Drop virAtomicIntDecAndTest() with g_atomic_int_dec_and_test()

2020-01-31 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/libxl/libxl_domain.c | 2 +- src/lxc/lxc_process.c | 2 +- src/nwfilter/nwfilter_dhcpsnoop.c | 8 src/qemu/qemu_process.c | 2 +- src/util/viratomic.h | 11 --- src/util/virobject.c

[PATCH 5/7] src: Replace virAtomicIntInc() with g_atomic_int_add()

2020-01-31 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/libxl/libxl_domain.c | 2 +- src/libxl/libxl_driver.c | 2 +- src/lxc/lxc_process.c | 4 ++-- src/nwfilter/nwfilter_dhcpsnoop.c | 10 +- src/qemu/qemu_process.c | 4 ++-- src/test/test_driver.c

[PATCH 2/7] tests: Drop viratomictest

2020-01-31 Thread Michal Privoznik
In future commits our virAtomic* APIs will be replaced with their GLib variants. Instead of trying to update the test after each commit and eventually removing the test anyway, remove it upfront and save the hassle. Signed-off-by: Michal Privoznik --- tests/Makefile.am | 5 --

[PATCH 4/7] src: Replace virAtomicIntSet() with g_atomic_int_set()

2020-01-31 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/nwfilter/nwfilter_dhcpsnoop.c | 2 +- src/test/test_driver.c| 4 ++-- src/util/viratomic.h | 9 - src/util/virobject.c | 2 +- src/util/virsystemd.c | 10 +- 5 files changed, 9

[PATCH 7/7] Drop virAtomic module

2020-01-31 Thread Michal Privoznik
Now, that every use of virAtomic was replaced with its g_atomic equivalent, let's remove the module. Signed-off-by: Michal Privoznik --- configure.ac | 1 - m4/virt-atomic.m4 | 77 -- src/Makefile.am | 6 ---

[PATCH 3/7] src: Replace virAtomicIntGet() with g_atomic_int_get()

2020-01-31 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- src/nwfilter/nwfilter_dhcpsnoop.c | 12 ++-- src/util/viratomic.h | 9 - src/util/virsystemd.c | 6 +++--- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c

[PATCH 0/7] Drop virAtomic module

2020-01-31 Thread Michal Privoznik
Inspired by: https://www.redhat.com/archives/libvir-list/2020-January/msg01446.html Instead of using: #define virAtomicIntXXX g_atomic_int_XXX let's use the GLib directly and drop needless defines. Michal Prívozník (7): test_driver: Replace virAtomicIntAdd() with virAtomicIntInc()

Re: [PATCH] lib: Prohibit parallel connections with tunneled migration

2020-01-31 Thread Jim Fehlig
Any comments on this patch? Regards, Jim On 1/21/20 8:00 PM, Jim Fehlig wrote: As discussed on the developer list, parallel migration connections are not compatible with tunneled migration https://www.redhat.com/archives/libvir-list/2020-January/msg00463.html Prohibit the concurrent use of

[PATCH 3/5] qemu: Extend QEMU with tpm-spapr support

2020-01-31 Thread Stefan Berger
Extend QEMU with tpm-spapr support. Signed-off-by: Stefan Berger --- src/qemu/qemu_command.c| 15 ++- src/qemu/qemu_domain.c | 2 ++ src/qemu/qemu_domain_address.c | 10 ++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git

[PATCH 0/5] Add support for SPAPR vTPM for pSeries VM

2020-01-31 Thread Stefan Berger
QEMU 5.0 will have SPAPR vTPM support. This series of patches adds support for the XML and command line creation of the SPAPR vTPM for pSeries VMs along with test cases. Regards, Stefan Stefan Berger (5): conf: Add support for tpm-spapr to domain XML qemu: Extend QEMU capabilities with

[PATCH 2/5] qemu: Extend QEMU capabilities with 'tpm-spapr'

2020-01-31 Thread Stefan Berger
Extend the QEMU capabilties with tpm-spapr support. Signed-off-by: Stefan Berger --- src/qemu/qemu_capabilities.c | 6 ++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index

[PATCH 1/5] conf: Add support for tpm-spapr to domain XML

2020-01-31 Thread Stefan Berger
From: Stefan Berger This patch adds support for the tpm-spapr device model for ppc64. The XML for this type of TPM looks as follows: Extend the documentation. Signed-off-by: Stefan Berger --- docs/formatdomain.html.in | 4 +++- docs/schemas/domaincommon.rng | 4

[PATCH 5/5] tests: Add test for domain XML with tpm-spapr TPM device model

2020-01-31 Thread Stefan Berger
This patch adds a test case for domain XML with the tpm-spapr TPM device model. Signed-off-by: Stefan Berger --- .../tpm-emulator-spapr.ppc64-latest.args | 45 ++ tests/qemuxml2argvdata/tpm-emulator-spapr.xml | 60 +++ tests/qemuxml2argvtest.c

Re: [PATCH v2 0/2] finish qemu-nbd --partition deprecation

2020-01-31 Thread Eric Blake
ping On 1/23/20 10:46 AM, Eric Blake wrote: Based-on: <20200116141511.16849-1-peter.mayd...@linaro.org> (0/3 convert qemu-nbd, qemu-block-drivers to rST) In v2: - rebased on top of rST doc changes - patch 1 added Eric Blake (2): docs: Fix typo in qemu-nbd -P replacement qemu-nbd:

[libvirt PATCH 2/5] qemu: Add the QEMU_CAPS_CPU_KVM_NO_ADJVTIME capability

2020-01-31 Thread Andrea Bolognani
We will use this capability to detect whether the QEMU binary supports the kvm-no-adjvtime CPU feature. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[libvirt PATCH 5/5] tests: Add tests for the kvm-no-adjvtime CPU feature

2020-01-31 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- .../aarch64-features-misc.aarch64-latest.args | 32 +++ .../aarch64-features-misc.xml | 17 ++ tests/qemuxml2argvtest.c | 2 ++ 3 files changed, 51 insertions(+) create mode 100644

[libvirt PATCH 3/5] cpu: Add the kvm-no-adjvtime CPU feature

2020-01-31 Thread Andrea Bolognani
The feature is currently available on ARM only, and so it only needs to be known to the corresponding CPU driver. Signed-off-by: Andrea Bolognani --- src/cpu_map/arm_features.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cpu_map/arm_features.xml b/src/cpu_map/arm_features.xml

[libvirt PATCH 4/5] qemu: Validate the kvm-no-adjvtime CPU feature

2020-01-31 Thread Andrea Bolognani
Error out if the QEMU binary doesn't support it. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d3045b4bcd..8b0c91d6c1 100644 ---

[libvirt PATCH 1/5] tests: Add capabilities for QEMU 5.0.0 on aarch64

2020-01-31 Thread Andrea Bolognani
This is the first QEMU version that supports the kvm-no-adjvtime CPU feature. Signed-off-by: Andrea Bolognani --- This patch has been trimmed. .../qemu_5.0.0-virt.aarch64.xml | 156 + tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 150 + .../caps_5.0.0.aarch64.replies

[libvirt PATCH 0/5] qemu: Add support for the kvm-no-adjvtime CPU feature

2020-01-31 Thread Andrea Bolognani
This ARM-specific CPU feature has been recently added to QEMU with https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg04124.html Patch 1/5 has been trimmed quite liberally: to obtain the unabridged version of this series, use $ git fetch https://gitlab.com/abologna/libvirt

Re: [libvirt PATCH v2 56/56] gnulib: delete all gnulib integration

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:37PM +, Daniel P. Berrangé wrote: > This deletes all trace of gnulib from libvirt. We still > have the keycodemapdb submodule to deal with. The simple > solution taken was to update it when running autogen.sh. > > Previously gnulib could auto-trigger refresh when

Re: [libvirt PATCH v2 55/56] src: remove virFilePrintf in favour of g_fprintf

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:36PM +, Daniel P. Berrangé wrote: > The virFilePrintf function was a wrapper for fprintf() to provide > Windows portability, since gnulib's fprintf() replacement was > license restricted. This is no longer needed now we have the > g_fprintf function available. >

Re: [libvirt PATCH v2 54/56] src: ensure use of g_printf / g_fprintf functions

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:35PM +, Daniel P. Berrangé wrote: > The printf/fprintf function impls provided on Windows do > not follow the normal syntax for format specifiers as > the UNIX hosts. Currently we use GNULIB to provide a > portability fix for this. GLib has also imported the >

Re: [libvirt PATCH v2 53/56] src: optionally include xlocale.h header

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:34PM +, Daniel P. Berrangé wrote: > On macOS some definitions are in xlocale.h, instead of in > locale.h. GNULIB hides this difference by making the latter > include the former. > > Signed-off-by: Daniel P. Berrangé > --- > configure.ac | 1 + >

Re: [libvirt PATCH v2 52/56] src: add define of ENOMSG for MinGW

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:33PM +, Daniel P. Berrangé wrote: > MinGW lacks ENOMSG until version 6.0.0 (Fedora 31). > > Signed-off-by: Daniel P. Berrangé > --- > src/internal.h | 6 ++ > 1 file changed, 6 insertions(+) Reviewed-by: Pavel Hrdina signature.asc Description: PGP

Re: [PATCH] build: Drop execute permissions on virsh bash completion command

2020-01-31 Thread Ján Tomko
On Fri, Jan 31, 2020 at 09:01:41AM -0700, Jim Fehlig wrote: On 1/31/20 8:39 AM, Michal Privoznik wrote: On 1/31/20 3:38 PM, Jim Fehlig wrote: rpmlint complains about "script-without-shebang" due to the execute permissions on /usr/share/bash-completion/completions/vsh. Use INSTALL_DATA instead

Re: [libvirt PATCH v2 51/56] src: assume sys/sysmacros.h always exists on Linux

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:32PM +, Daniel P. Berrangé wrote: > All our supported Linux distros now have this header. > It has never existed on FreeBSD / macOS / Mingw. > > Signed-off-by: Daniel P. Berrangé > --- > src/conf/domain_audit.c | 4 +--- > src/lxc/lxc_controller.c | 4 +--- >

Re: [libvirt PATCH v2 50/56] m4: add check for pthread library

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:31PM +, Daniel P. Berrangé wrote: > When we get rid of GNULIB, we need to check for -lpthread > support. > > Signed-off-by: Daniel P. Berrangé > --- > m4/virt-pthread.m4 | 26 ++ > src/Makefile.am| 2 -- > tests/Makefile.am | 2 +-

Re: [PATCH] build: Drop execute permissions on virsh bash completion command

2020-01-31 Thread Jim Fehlig
On 1/31/20 8:39 AM, Michal Privoznik wrote: On 1/31/20 3:38 PM, Jim Fehlig wrote: rpmlint complains about "script-without-shebang" due to the execute permissions on /usr/share/bash-completion/completions/vsh. Use INSTALL_DATA instead of INSTALL_SCRIPT to avoid the unnecessary execute

Re: [libvirt PATCH v2 48/56] src: convert code to use virPipe APIs

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:29PM +, Daniel P. Berrangé wrote: > This addreses portability to Windows and standardizes > error reporting. This fixes a number of places which > failed to set O_CLOEXEC or failed to report errors. > > Signed-off-by: Daniel P. Berrangé > --- >

Re: [libvirt PATCH v2 49/56] tools: conditionalize use of O_SYNC flag

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:30PM +, Daniel P. Berrangé wrote: > The O_SYNC flag is not defined on Windows platforms. > > Signed-off-by: Daniel P. Berrangé > --- > tools/vsh.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Pavel Hrdina signature.asc

[libvirt PATCH] qemu: drop unused variable

2020-01-31 Thread Ján Tomko
The g_auto conversion made clang realize the variable is unused: ../../src/qemu/qemu_domain.c:10349:36: error: unused variable 'cfg' [-Werror,-Wunused-variable] g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); Signed-off-by: Ján Tomko Fixes:

Re: [libvirt PATCH v2 47/56] src: introduce a wrapper for the pipe2() system call

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:28PM +, Daniel P. Berrangé wrote: > This hides the differences between Windows and UNIX, > and adds standard error reporting. > > Signed-off-by: Daniel P. Berrangé > --- > configure.ac | 1 + > src/libvirt_private.syms | 3 ++ > src/util/virutil.c

Re: [libvirt PATCH] qemu: Fix domain ID allocation

2020-01-31 Thread Michal Privoznik
On 1/31/20 4:45 PM, Ján Tomko wrote: On Fri, Jan 31, 2020 at 04:33:50PM +0100, Michal Privoznik wrote: On 1/31/20 3:43 PM, Ján Tomko wrote: The rewrite to use GLib's atomic ops functions changed the behavior of virAtomicIntInc - before it returned the pre-increment value. Most of the callers

Re: [libvirt PATCH] qemu: Fix domain ID allocation

2020-01-31 Thread Ján Tomko
On Fri, Jan 31, 2020 at 04:33:50PM +0100, Michal Privoznik wrote: On 1/31/20 3:43 PM, Ján Tomko wrote: The rewrite to use GLib's atomic ops functions changed the behavior of virAtomicIntInc - before it returned the pre-increment value. Most of the callers using its value were adjusted, but the

Re: [PATCH] build: Drop execute permissions on virsh bash completion command

2020-01-31 Thread Michal Privoznik
On 1/31/20 3:38 PM, Jim Fehlig wrote: rpmlint complains about "script-without-shebang" due to the execute permissions on /usr/share/bash-completion/completions/vsh. Use INSTALL_DATA instead of INSTALL_SCRIPT to avoid the unnecessary execute permissions. Signed-off-by: Jim Fehlig --- BTW, of

Re: [libvirt PATCH] qemu: Fix domain ID allocation

2020-01-31 Thread Michal Privoznik
On 1/31/20 3:43 PM, Ján Tomko wrote: The rewrite to use GLib's atomic ops functions changed the behavior of virAtomicIntInc - before it returned the pre-increment value. Most of the callers using its value were adjusted, but the one in qemuDriverAllocateID was not. If libvirtd would reconnect

Re: [libvirt PATCH v2 45/56] configure: request 64-bit APIs on 32-bit platforms

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:26PM +, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > configure.ac | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Pavel Hrdina signature.asc Description: PGP signature

Re: [libvirt PATCH v2 46/56] examples: remove obsolete workaround for mingw

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:27PM +, Daniel P. Berrangé wrote: > The build still succeeds with the workaround removed, so > whatever was causing the problem no longer exists. > > Signed-off-by: Daniel P. Berrangé > --- > examples/c/domain/domtop.c | 15 --- >

Re: [libvirt PATCH v2 44/56] src: remove sys/wait.h from many files

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:25PM +, Daniel P. Berrangé wrote: > Most code now uses the virProcess / virCommand APIs, so > the need for sys/wait.h is quite limited. Removing this > include removes the dependency on GNULIB providing a > dummy sys/wait.h for Windows. > > Signed-off-by: Daniel

Re: [libvirt PATCH v2 43/56] util: conditionalize FD stream to exclude WIN32

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:24PM +, Daniel P. Berrangé wrote: > Almost none of the virFDStream code will actually work > on WIN32 builds, nor is it used except for in the > virtualbox driver for screenshots. It is simpler to > wrap it all in a '#ifndef WIN32'. > > Signed-off-by: Daniel P.

Re: [libvirt PATCH] qemu: Fix domain ID allocation

2020-01-31 Thread Peter Krempa
On Fri, Jan 31, 2020 at 15:43:14 +0100, Ján Tomko wrote: > The rewrite to use GLib's atomic ops functions changed the behavior > of virAtomicIntInc - before it returned the pre-increment value. > > Most of the callers using its value were adjusted, but the one > in qemuDriverAllocateID was not.

[libvirt PATCH] docs: fix a typo

2020-01-31 Thread Ján Tomko
s/axnd/and/ Signed-off-by: Ján Tomko Fixes: f0f34056ab26eaa9f903a51cd1fa155088fd640f --- Pushed as trivial docs/formatdomain.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 20bf6a9b84..60a103d7c6 100644 ---

Re: [libvirt PATCH v2 42/56] src: conditionalize / remove use of poll.h

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:23PM +, Daniel P. Berrangé wrote: > Remove imports of poll.h which are redundant, and > conditionalize remaining usage that needs to compile > on Windows platforms. > > Signed-off-by: Daniel P. Berrangé > --- > src/util/virpolkit.c | 2 +- > src/util/virutil.c

Re: [libvirt PATCH v2 41/56] util: delete the poll() based event loop impl

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:22PM +, Daniel P. Berrangé wrote: > It is no longer require since switching to the GLib based > event loop impl. > > Signed-off-by: Daniel P. Berrangé > --- > po/POTFILES.in | 1 - > src/libvirt_private.syms | 13 - > src/util/Makefile.inc.am | 2

Re: [libvirt PATCH v2 40/56] util: switch to use the GLib event loop impl

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:21PM +, Daniel P. Berrangé wrote: > This sets the GLib event loop as the impl when calling > virEventRegisterDefaultImpl(). This remains a private > impl detail of libvirt, so applications must *NOT* > assume that a call to virEventRegisterDefaultImpl() > results

Re: [libvirt PATCH v2 39/56] util: import an event loop impl based on GMainContext

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:20PM +, Daniel P. Berrangé wrote: > The libvirt-glib project has provided a GMainContext based > event loop impl for applications. This imports it and sets > it up for use by libvirt as the primary event loop. This > remains a private impl detail of libvirt. > >

[PATCH] build: Drop execute permissions on virsh bash completion command

2020-01-31 Thread Jim Fehlig
rpmlint complains about "script-without-shebang" due to the execute permissions on /usr/share/bash-completion/completions/vsh. Use INSTALL_DATA instead of INSTALL_SCRIPT to avoid the unnecessary execute permissions. Signed-off-by: Jim Fehlig --- BTW, of the nearly 800 files in

[libvirt PATCH] qemu: Fix domain ID allocation

2020-01-31 Thread Ján Tomko
The rewrite to use GLib's atomic ops functions changed the behavior of virAtomicIntInc - before it returned the pre-increment value. Most of the callers using its value were adjusted, but the one in qemuDriverAllocateID was not. If libvirtd would reconnect to a running domain during startup, the

[PATCH 05/19] tests: qemublock: Add checkpoint deletion test for deep backing chain

2020-01-31 Thread Peter Krempa
Add test cases for merging various pairs of bitmaps when snapshots were created together with checkpoints. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 6 ++ .../snapshots-current-out.json| 29 + .../snapshots-intermediate1-out.json

[PATCH 18/19] tests: qemublock: Add tests for qemuBlockBitmapsHandleBlockcopy

2020-01-31 Thread Peter Krempa
Use some of the existing bitmap data to add tests for qemuBlockBitmapsHandleBlockcopy. As the output depends on the ordering in the hash table we must also install the "virdeterministichash" mock preload library. Signed-off-by: Peter Krempa --- tests/qemublocktest.c |

[PATCH 17/19] qemu: block: Introduce function to calculate bitmap handling for block-copy

2020-01-31 Thread Peter Krempa
Add a function calculating which bitmaps to copy to the mirror during a block-copy operation. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 138 ++ src/qemu/qemu_block.h | 7 +++ 2 files changed, 145 insertions(+) diff --git

[PATCH 13/19] qemu: blockjob: Store 'jobflags' with block job data

2020-01-31 Thread Peter Krempa
Add a variable which will store the contents of the 'flags' variable as passed in by the individual block jobs. Since the flags may influence behaviour of the jobs it's important to preserve it to the finalization steps. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.h

[PATCH 10/19] virJSONValueNewArray: Use g_new0 to allocate and remove NULL checks from callers

2020-01-31 Thread Peter Krempa
Use the glib allocation function that never returns NULL and remove the now dead-code checks from all callers. Signed-off-by: Peter Krempa --- src/locking/lock_daemon.c| 4 ++-- src/logging/log_handler.c| 3 +-- src/network/leaseshelper.c | 6 +-

[PATCH 08/19] qemu: block: Extract calls of qemuBlockGetNamedNodeData into a helper function

2020-01-31 Thread Peter Krempa
Create a wrapper for qemuBlockGetNamedNodeData named qemuBlockGetNamedNodeData. The purpose of the wrapper is to integrate the monitor handling functionality and in the future possible qemuCaps-based flags. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 5 + src/qemu/qemu_block.c

[PATCH 03/19] tests: qemublock: Add synthetic snapshot+checkpoint test data

2020-01-31 Thread Peter Krempa
Add a faked qemu output which would simulate scenario where libvirt would take a snapshot and checkpoint simultaneously. This is visible in libvirt-2-format node where bitmap 'c' appears, but bitmap 'b' which is active in the previous layer is not present. Signed-off-by: Peter Krempa ---

[PATCH 15/19] qemu: block: Add validator for bitmap chains accross backing chains

2020-01-31 Thread Peter Krempa
Add a validator which checks that a bitmap spanning multiple backing chain members doesn't look broken. The current rules are that no intermediate birmaps are missing (unfortunately it's hard to know whether the topmost or bottommost bitmap is missing) and none of the components is inconsistent.

[PATCH 11/19] virhash: Make sure that hash key is always copied

2020-01-31 Thread Peter Krempa
Fix all implementations of virHashKeyCopy to always return a valid pointer. Tweak the return value expectation comment so that it doesn't necessarily require to allocate memory. Signed-off-by: Peter Krempa --- src/conf/domain_addr.c | 5 + src/util/virhash.c | 4 +---

[PATCH 14/19] qemu: blockjob: Store 'flags' for all the block job types

2020-01-31 Thread Peter Krempa
The flags may control important aspects of the block job which may influence also the termination of the job. Store the 'flags' for all the block job types. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 13 ++--- src/qemu/qemu_blockjob.h | 9 ++---

[PATCH 19/19] qemuDomainBlockPivot: Copy bitmaps backing checkpoints for virDomainBlockCopy

2020-01-31 Thread Peter Krempa
Use qemuBlockBitmapsHandleBlockcopy to calculate bitmaps to copy over for a block-copy job. We copy them when pivoting to the new image as at that point we are certain that we don't dirty any bitmap unnecessarily. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 28

[PATCH 07/19] qemu: checkpoint: Track and relabel images for bitmap merging

2020-01-31 Thread Peter Krempa
Allow qemu access to modify backing files in case when we want to delete a checkpoint. This patch adds tracking of which images need to be relabelled when calculating the transaction, the code to relabel them and rollback. To verify that stuff works we also output the list of images to relabel

[PATCH 12/19] virHashAddOrUpdateEntry: Simplify allocation of new entry

2020-01-31 Thread Peter Krempa
Use g_new0 and skip checking of the return value of keyCopy callback as both are bound to return a valid pointer. Signed-off-by: Peter Krempa --- src/util/virhash.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/util/virhash.c b/src/util/virhash.c index

[PATCH 02/19] tests: qemublock: Add few more test cases for checkpoint deletion

2020-01-31 Thread Peter Krempa
Add all intermediate steps and deletion of the current checkpoint on a flat (single-image) disk image. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 4 +++ .../checkpointdelete/basic-current-out.json | 29 +++ .../basic-intermediate1-out.json

[PATCH 01/19] tests: qemublock: Add test for checkpoint deletion bitmap merge

2020-01-31 Thread Peter Krempa
Add test infrastructure and a basic test for bitmap deletion. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 59 +++ .../checkpointdelete/basic-noparent-out.json | 9 +++ 2 files changed, 68 insertions(+) create mode 100644

[PATCH 09/19] util: json: Introduce virJSONValueArrayConcat

2020-01-31 Thread Peter Krempa
Add a helper that concatenates the second array into the first. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/virjson.c | 31 +++ src/util/virjson.h | 2 ++ 3 files changed, 34 insertions(+) diff --git

[PATCH 04/19] qemu: checkpoint: Introduce support for deleting checkpoints accross snapshots

2020-01-31 Thread Peter Krempa
Allow deleting of checkpoints when snapshots were created along. The code tracks and modifies the checkpoint list so that backups can still be taken with such a backing chain. This unfortunately requires to rename few bitmaps (by copying and deleting them) in some cases. Signed-off-by: Peter

[PATCH 16/19] tests: qemublocktest: Add another synthetic test case for broken bitmaps

2020-01-31 Thread Peter Krempa
Add a case where a bitmap spanning multiple images is missing one of the intermediate components. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 8 + .../bitmap/snapshots-synthetic-broken.json| 819 ++

[PATCH 06/19] tests: qemublock: Add checkpoint deletion tests for some special cases

2020-01-31 Thread Peter Krempa
Use the synthetic test data to verify that the algorithm correctly picks bitmaps to merge when the bitmap is changed along with the image itself. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 7 +++ ...hots-synthetic-checkpoint-current-out.json | 29 +

[PATCH 00/19] qemu: backup: Add support for checkpoint deletion and block copy with checkpoints

2020-01-31 Thread Peter Krempa
The first 7 patches are technically v2 of [libvirt] [RFC PATCH 00/16] qemu: checkpoint: Add support for deleting checkpoints accross snapshots https://www.redhat.com/archives/libvir-list/2020-January/msg00430.html as they were not reviewed, but the handling of block copy would conflict with

Re: [libvirt] [PATCH v1 0/8] domain_addr and qemu_domain cleanups

2020-01-31 Thread Michal Privoznik
On 1/9/20 7:33 PM, Daniel Henrique Barboza wrote: Hi, These are a few cleanups in some files that I'll end up messing with in a future series (which isn't Glibfied ATM). Figured it's best to clean them up now instead of adding more non-Glibfied code on top. Patches 7 and 8 are stuff that I

Re: [hooks PATCH] Don't allow @localhost email addresses in commit message

2020-01-31 Thread Ján Tomko
On Fri, Jan 31, 2020 at 10:38:56AM +0100, Andrea Bolognani wrote: On Mon, 2020-01-27 at 16:12 +, Daniel P. Berrangé wrote: + allow_localhost_email=$(git config --bool hooks.allowlocalhostemail) The comment at the beginning of the script documents most hooks.* configuration

Re: [libvirt PATCH] docs: Update godoc URLs for Go packages

2020-01-31 Thread Ján Tomko
On Thu, Jan 30, 2020 at 06:15:14PM +0100, Andrea Bolognani wrote: Since commit 201156ec6e65e08cdb04d6fdefe013652fb7fa87 Author: Daniel P. Berrangé Date: Mon Dec 16 10:06:50 2019 + docs: add pages to support Go module package resolution it's possible to use import

Re: [libvirt PATCH] docs: Update download location for Go packages

2020-01-31 Thread Ján Tomko
On Thu, Jan 30, 2020 at 06:13:55PM +0100, Andrea Bolognani wrote: We haven't ever made releases of the Go components, which makes sense because that's just not how that specific ecosystem works. For people who are looking to use libvirt from Go, the brief introductory pages located at the same

Re: [hooks PATCH] Don't allow @localhost email addresses in commit message

2020-01-31 Thread Andrea Bolognani
On Mon, 2020-01-27 at 16:12 +, Daniel P. Berrangé wrote: > + allow_localhost_email=$(git config --bool hooks.allowlocalhostemail) The comment at the beginning of the script documents most hooks.* configuration options[1], so please document this one as well. > + git

Re: [libvirt PATCH v2 38/56] tools: convert to use g_poll instead of poll

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:19PM +, Daniel P. Berrangé wrote: > g_poll is portable to Windows platforms. > > Signed-off-by: Daniel P. Berrangé > --- > tools/virsh-domain.c | 13 ++--- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/tools/virsh-domain.c

Re: [libvirt PATCH v2 37/56] tests: refactor event test to not run lock step

2020-01-31 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:18PM +, Daniel P. Berrangé wrote: > The current event loop test suite has two threads running > in lockstep. This was just about viable when we have full > control over the internal details of the event loop impl. > When we're using the GLib event loop though