[libvirt] [PATCH 1/2] virstring: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Michal Privoznik
These functions don't really abort() on OOM. The fix was merged upstream, but not in the minimal version we require. Provide our own implementation which can be removed once we bump the minimal version. Signed-off-by: Michal Privoznik --- Dan claims this is fixed upstream, but I'm failing to see

[libvirt] [PATCH 0/2] Couple of g_strdup_printf() fixes

2019-10-18 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): virstring: Reimplement g_strdup_printf() and g_strdup_vprintf() m4: Don't suggest attribute malloc m4/virt-compile-warnings.m4 | 1 + src/libvirt_private.syms| 2 ++ src/util/virstring.c| 29 + src/util/virstr

[libvirt] [PATCH 2/2] m4: Don't suggest attribute malloc

2019-10-18 Thread Michal Privoznik
With glib inclusion, some of its functions have __attribute__((__malloc__)) which make compiler realize we want to use the same attribute for some trivial functions of ours. For instance qemuDomainManagedSavePath(). I don't see any real benefit into using the attribute, so disable that suggestion.

Re: [libvirt] [PATCH 1/2] virstring: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Peter Krempa
On Fri, Oct 18, 2019 at 10:16:49 +0200, Michal Privoznik wrote: > These functions don't really abort() on OOM. The fix was merged > upstream, but not in the minimal version we require. Provide our > own implementation which can be removed once we bump the minimal > version. > > Signed-off-by: Mich

Re: [libvirt] [PATCH 2/2] m4: Don't suggest attribute malloc

2019-10-18 Thread Peter Krempa
On Fri, Oct 18, 2019 at 10:16:50 +0200, Michal Privoznik wrote: > With glib inclusion, some of its functions have > __attribute__((__malloc__)) which make compiler realize we want > to use the same attribute for some trivial functions of ours. For > instance qemuDomainManagedSavePath(). I don't see

Re: [libvirt] [PATCH 1/2] virstring: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Daniel P . Berrangé
On Fri, Oct 18, 2019 at 10:38:27AM +0200, Peter Krempa wrote: > On Fri, Oct 18, 2019 at 10:16:49 +0200, Michal Privoznik wrote: > > These functions don't really abort() on OOM. The fix was merged > > upstream, but not in the minimal version we require. Provide our > > own implementation which can b

Re: [libvirt] Some questions about live migration

2019-10-18 Thread Jiri Denemark
On Fri, Oct 18, 2019 at 15:00:19 +0800, Luyao Zhong wrote: > Hi libvirt experts, > > I have some questions about live migration. I'm assuming you are not asking about post-copy migration, since it is a bit more complicated as the current state if split between the source and destination hosts and

[libvirt] [PATCH v2] glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Michal Privoznik
These functions don't really abort() on OOM. The fix was merged upstream, but not in the minimal version we require. Provide our own implementation which can be removed once we bump the minimal version. Signed-off-by: Michal Privoznik --- v2 of: https://www.redhat.com/archives/libvir-list/2019-

[libvirt] [PATCH v5] util: Set SIGPIPE to a no-op handler in virFork

2019-10-18 Thread Wang Yechao
Libvirtd has set SIGPIPE to ignored, and virFork resets all signal handlers to the defaults. But child process may write logs to stderr/stdout, that may generate SIGPIPE if journald has stopped. So set SIGPIPE to a dummy no-op handler before unmask signals in virFork. And there is no need to set S

Re: [libvirt] [PATCH v2] glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Peter Krempa
On Fri, Oct 18, 2019 at 11:49:05 +0200, Michal Privoznik wrote: > These functions don't really abort() on OOM. The fix was merged > upstream, but not in the minimal version we require. Provide our > own implementation which can be removed once we bump the minimal > version. > > Signed-off-by: Mich

Re: [libvirt] [PATCH v2] glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Ján Tomko
On Fri, Oct 18, 2019 at 12:16:00PM +0200, Peter Krempa wrote: On Fri, Oct 18, 2019 at 11:49:05 +0200, Michal Privoznik wrote: These functions don't really abort() on OOM. The fix was merged upstream, but not in the minimal version we require. Provide our own implementation which can be removed o

Re: [libvirt] [PATCH v2] glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Daniel P . Berrangé
On Fri, Oct 18, 2019 at 12:16:00PM +0200, Peter Krempa wrote: > On Fri, Oct 18, 2019 at 11:49:05 +0200, Michal Privoznik wrote: > > These functions don't really abort() on OOM. The fix was merged > > upstream, but not in the minimal version we require. Provide our > > own implementation which can b

[libvirt] [PATCH v2 1/2] qemu: fix type of default video device

2019-10-18 Thread Pavel Mores
If a graphics device is added to XML that has no video device, libvirt automatically added a video device which was always of type 'cirrus' on x86_64, even if the underlying qemu didn't support cirrus. This patch refines a bit the decision about the type of the video device. Based on QEMU capabili

[libvirt] [PATCH v2 2/2] qemu: add tests of the default video type selection algorithm

2019-10-18 Thread Pavel Mores
The test case for x86_64 and neither cirrus nor vga capability is of the xml2argv type because it actually fails to parse the XML at all [*] which is something that xml2xml tests don't seem to handle. xml2argv test fails to produce a qemu argv for this case which xml2argv tests can handle. The (u

[libvirt] [PATCH v2 0/2] qemu: fix type of default video device

2019-10-18 Thread Pavel Mores
This new version mostly integrates Cole's comments about the first version. Pavel Mores (2): qemu: fix type of default video device qemu: add tests of the default video type selection algorithm src/qemu/qemu_domain.c| 39 +++-- .../default-video-type-aarch

Re: [libvirt] [PATCH v2] glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Peter Krempa
On Fri, Oct 18, 2019 at 11:25:55 +0100, Daniel Berrange wrote: > On Fri, Oct 18, 2019 at 12:16:00PM +0200, Peter Krempa wrote: > > On Fri, Oct 18, 2019 at 11:49:05 +0200, Michal Privoznik wrote: > > > These functions don't really abort() on OOM. The fix was merged > > > upstream, but not in the min

[libvirt] [PATCH v3] glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Michal Privoznik
These functions don't really abort() on OOM. The fix was merged upstream, but not in the minimal version we require. Provide our own implementation which can be removed once we bump the minimal version. Signed-off-by: Michal Privoznik --- Diff to v3: - fixed infinite recursion src/internal.h

Re: [libvirt] [PATCH v3] glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Daniel P . Berrangé
On Fri, Oct 18, 2019 at 02:40:41PM +0200, Michal Privoznik wrote: > These functions don't really abort() on OOM. The fix was merged > upstream, but not in the minimal version we require. Provide our > own implementation which can be removed once we bump the minimal > version. > > Signed-off-by: Mi

Re: [libvirt] [PATCH v3] glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Ján Tomko
On Fri, Oct 18, 2019 at 02:40:41PM +0200, Michal Privoznik wrote: These functions don't really abort() on OOM. The fix was merged upstream, but not in the minimal version we require. Provide our own implementation which can be removed once we bump the minimal version. Signed-off-by: Michal Privo

Re: [libvirt] [PATCH 2/2] libvirt-rust Fix Stream::send

2019-10-18 Thread Martin Kletzander
On Wed, Oct 16, 2019 at 01:49:51PM +0200, Sahid Orentino Ferdjaoui wrote: On Fri, Sep 20, 2019 at 10:02:47AM +0200, Martin Kletzander wrote: On Thu, Sep 19, 2019 at 05:48:49AM +, Linus Färnstrand wrote: > * Handle the -2 error case > * Allow sending arbitrary byte array, not just UTF-8 strin

Re: [libvirt] [PATCH] conf: Fix memory leak caused by missing VIR_FREE for video resolution.

2019-10-18 Thread Jonathon Jongsma
Thanks, Reviewed-by: Jonathon Jongsma On Fri, 2019-10-18 at 00:15 -0300, jcfara...@gmail.com wrote: > From: Julio Faracco > > Commit 72862797 introduced resolution settings for QEMU video > drivers. > It includes a new structure inside video definition. So, the code > needs > to clear pointer

Re: [libvirt] [PULL v3 00/19] Bitmaps patches

2019-10-18 Thread Peter Maydell
On Thu, 17 Oct 2019 at 22:54, John Snow wrote: > > The following changes since commit f22f553efffd083ff624be116726f843a39f1148: > > Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20191013' into > staging (2019-10-17 16:48:56 +0100) > > are available in the Git repository at: > > http

Re: [libvirt] [PATCH] Apparmor: Support Xen scripts in libexec

2019-10-18 Thread Andrea Bolognani
On Thu, 2019-10-17 at 03:41 +, Jim Fehlig wrote: > Upstream Xen has traditionally installed various hotplug and > utility scripts in /etc/xen/scripts/. openSUSE is slowly moving > all distribution provided configuration files and scripts from > /etc to /usr. In the case of the Xen scripts provi

[libvirt] [PATCH] build: fix substitution of RUNSTATEDIR in man pages

2019-10-18 Thread Daniel P . Berrangé
When RUNSTATEDIR was introduced commit d29c917ef470a25149d1f3787ec494d006549f27 Author: Daniel P. Berrangé Date: Tue Aug 20 16:05:12 2019 +0100 src: honour the RUNSTATEDIR variable in all code The makefile rules for man pages were accidentally not updated for the new variablle name.

[libvirt] [PATCH] gitdm/companies: add 'ibm' file

2019-10-18 Thread Daniel Henrique Barboza
Some people from IBM does not use 'ibm.com' domain emails. CC: jcfara...@gmail.com Suggested-by: Leonardo Augusto Guimarães Garcia Signed-off-by: Daniel Henrique Barboza --- Julio, I didn't add you in this list because I am not sure about the nature of your contributions to Libvirt. Let me kno

[libvirt] [PATCH] util: add stdlib.h include for abort() prototype

2019-10-18 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- Pushed as a build fix for Mingw src/util/glibcompat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/glibcompat.c b/src/util/glibcompat.c index 25dedf0ed5..3f830840cf 100644 --- a/src/util/glibcompat.c +++ b/src/util/glibcompat.c @@ -18,6 +1

Re: [libvirt] [PATCH] Apparmor: Support Xen scripts in libexec

2019-10-18 Thread Jim Fehlig
On 10/18/19 8:31 AM, Andrea Bolognani wrote: > On Thu, 2019-10-17 at 03:41 +, Jim Fehlig wrote: >> Upstream Xen has traditionally installed various hotplug and >> utility scripts in /etc/xen/scripts/. openSUSE is slowly moving >> all distribution provided configuration files and scripts from >>

Re: [libvirt] [PATCH] Apparmor: Support Xen scripts in libexec

2019-10-18 Thread Andrea Bolognani
On Fri, 2019-10-18 at 14:51 +, Jim Fehlig wrote: > On 10/18/19 8:31 AM, Andrea Bolognani wrote: > > On Thu, 2019-10-17 at 03:41 +, Jim Fehlig wrote: > > > If this is deemed too distro-specific I'm happy to maintain a > > > downstream patch. > > > > > > src/security/apparmor/usr.sbin.libv

Re: [libvirt] [PATCH] build: fix substitution of RUNSTATEDIR in man pages

2019-10-18 Thread Andrea Bolognani
On Fri, 2019-10-18 at 15:33 +0100, Daniel P. Berrangé wrote: > When RUNSTATEDIR was introduced > > commit d29c917ef470a25149d1f3787ec494d006549f27 > Author: Daniel P. Berrangé > Date: Tue Aug 20 16:05:12 2019 +0100 > > src: honour the RUNSTATEDIR variable in all code > > The makefil

Re: [libvirt] [PATCH] build: fix substitution of RUNSTATEDIR in man pages

2019-10-18 Thread Pavel Hrdina
On Fri, Oct 18, 2019 at 03:33:01PM +0100, Daniel P. Berrangé wrote: > When RUNSTATEDIR was introduced > > commit d29c917ef470a25149d1f3787ec494d006549f27 > Author: Daniel P. Berrangé > Date: Tue Aug 20 16:05:12 2019 +0100 > > src: honour the RUNSTATEDIR variable in all code > > The

[libvirt] [PATCH v3 1/9] qemu: fix domain device validation

2019-10-18 Thread Jonathon Jongsma
When the virDomainCapsDeviceDefValidate() function returned an error status (-1), we were aborting the function early, but returning the default return value (0). This patch properly returns an error in that case. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_domain.c | 2 +- 1 file changed,

[libvirt] [PATCH v3 9/9] qemu: add 'ramfb' attribute for mediated devices

2019-10-18 Thread Jonathon Jongsma
The 'ramfb' attribute provides a framebuffer to the guest that can be used as a boot display for the vgpu For example, the following configuration can be used to provide a vgpu with a boot display: Signed-off-by: Jonathon Jongsma --- docs/formatdomain.h

[libvirt] [PATCH v3 6/9] qemu: validate vhost-user video backend in qemu_domain.c

2019-10-18 Thread Jonathon Jongsma
The goal is to move all of the video device validation to a single place and use domain caps to validate the supported video device models. Since qemuDomainDeviceDefValidateVideo() is called from qemuProcessStartValidate(), these changes should not change anny behavior. Signed-off-by: Jonathon Jon

[libvirt] [PATCH v3 0/9] Enable ramfb parameter for mediated devices

2019-10-18 Thread Jonathon Jongsma
This is the third version of a patch series that adds support for a boot display for mediated vgpu devices using the 'ramfb' parameter. This version fixes a bunch of test failures that I had inadvertently introduced in the last series. It also splits the 4th patch up into several separate patches a

[libvirt] [PATCH v3 2/9] qemu: use g_autoptr in qemuDomainDeviceDefValidate()

2019-10-18 Thread Jonathon Jongsma
This allows us to simplify the function and avoid jumping to 'cleanup'. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_domain.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 92a0df2d75..39ab424873 100644

[libvirt] [PATCH v3 8/9] qemu: use domain caps to validate video device model

2019-10-18 Thread Jonathon Jongsma
As suggested by Cole, this patch uses the domain capabilities to validate the supported video model types. This allows us to remove the model type validation from qemu_process.c and qemu_domain.c and consolidates it all in a single place that will automatically adjust when new domain capabilities a

[libvirt] [PATCH v3 4/9] qemu: set domain capability for ramfb device

2019-10-18 Thread Jonathon Jongsma
commit 9bfcf0f62d9cf16db526a948242a7409ae883209 added the QEMU_CAPS_DEVICE_RAMFB capability but did not set the domain capability. This patch sets the domain capability for the ramfb device and updates the tests. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c

[libvirt] [PATCH v3 3/9] qemu: Set capabilities properly for tests

2019-10-18 Thread Jonathon Jongsma
Several tests were not specifying the necessary qemu capabilities for what they were testing. Due to the way that the video devices are currently validated, this is not causing any problems. But a change to video device validation in a following patch would have exposed this issue and resulted in m

[libvirt] [PATCH v3 7/9] qemu: move validation of video accel to qemu_domain.c

2019-10-18 Thread Jonathon Jongsma
Continue consolidation of video device validation started in previous patch. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_domain.c | 9 + src/qemu/qemu_process.c | 11 --- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qem

[libvirt] [PATCH v3 5/9] qemu: set domain capability for video type "none"

2019-10-18 Thread Jonathon Jongsma
In a follow-up commit, we will use the domain capabilities to validate video device configurations, which means that we also need to make sure that the domain capabilities include the "none" video device. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c

Re: [libvirt] [PATCH] gitdm/companies: add 'ibm' file

2019-10-18 Thread Andrea Bolognani
On Fri, 2019-10-18 at 11:40 -0300, Daniel Henrique Barboza wrote: > Julio, > > I didn't add you in this list because I am not sure about the > nature of your contributions to Libvirt. Let me know if you want > your email to be added here as well. It'd be even better if he posted the patch himself

[libvirt] [PATCH RFC 03/40] util: hash: Introduce virHashHasEntry

2019-10-18 Thread Peter Krempa
Add a helper that checks whether an entry with given name exists but does not touch the userdata. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/virhash.c | 49 src/util/virhash.h | 1 + 3 files changed, 42 insertio

[libvirt] [PATCH RFC 01/40] util: hash: Add possibility to use simpler data free function in virHash

2019-10-18 Thread Peter Krempa
Introduce a new type virHashDataFreeSimple which has only a void * as argument for cases when knowing the name of the entry when freeing the hash entry is not required. Signed-off-by: Peter Krempa --- src/conf/domain_addr.c | 4 ++-- src/util/vircgroup.c | 2 +- src/util/virhash.c | 15 +

[libvirt] [PATCH RFC 10/40] qemu: Replace use of virDomainDiskFindByBusAndDst with virDomainDiskByTarget

2019-10-18 Thread Peter Krempa
In both replaced cases we have other code that verifies that the bus can't be changed or that the target is unique, so limiting the search to disks with same bus makes no sense. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 7 ++- src/qemu/qemu_hotplug.c | 2 +- 2 files changed,

[libvirt] [PATCH RFC 13/40] qemu: monitor: Introduce new interface to query-named-block-nodes

2019-10-18 Thread Peter Krempa
Retrieve data for individual block nodes in a hash table. Currently only capacity and allocation data is extracted but this will be extended in the future. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 18 ++ src/qemu/qemu_monitor.h | 11 ++ src/qemu/qemu_monito

[libvirt] [PATCH RFC 08/40] conf: Remove virDomainDiskPathByName

2019-10-18 Thread Peter Krempa
Last use was removed in 29682196d8f. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 11 --- src/conf/domain_conf.h | 1 - src/libvirt_private.syms | 1 - 3 files changed, 13 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 88e93f6fb8..8b4e8

[libvirt] [PATCH RFC 15/40] qemu: checkpoint: Fix rollback and access to unlocked 'vm' when deleting checkpoints

2019-10-18 Thread Peter Krempa
Delete/merge bitmaps when deleting checkpoints using a 'transaction' so that we don't have to deal with halfway-failed scenarios and also fix access to 'vm' while in the monitor lock. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 47 +++--- 1 file c

[libvirt] [PATCH RFC 14/40] qemu: block: Don't query monitor in qemuBlockStorageSourceCreateDetectSize

2019-10-18 Thread Peter Krempa
Calling the monitor was convenient for the implementation in qemuDomainBlockCopyCommon, but causes the snapshot code to call query-named-block-nodes for every disk. Fix this by removing the monitor call from qemuBlockStorageSourceCreateDetectSize so that the data can be reused in loops. Signed-of

[libvirt] [PATCH RFC 05/40] qemu: domain: Remove pointless return value in qemuDomainPrepareDiskSourceData

2019-10-18 Thread Peter Krempa
The function does not do anything that could fail. Remove the return value. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 16 src/qemu/qemu_domain.h | 5 ++--- tests/qemublocktest.c | 3 +-- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/qemu/q

[libvirt] [PATCH RFC 09/40] conf: Introduce virDomainDiskByTarget

2019-10-18 Thread Peter Krempa
Introduce a simpler replacement for virDomainDiskByName when looking up by disk target. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 16 src/conf/domain_conf.h | 4 src/libvirt_private.syms | 1 + 3 files changed, 21 insertions(+) diff --git a/src/conf/do

[libvirt] [PATCH RFC 07/40] qemu: domain: Tolerate NULL @disk in qemuDomainPrepareDiskSourceData

2019-10-18 Thread Peter Krempa
In some cases we want to prepare a @src which is not meant to belong to a disk and thus does not require us to copy the data. Allow passing in NULL @disk into qemuDomainPrepareDiskSourceData. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 3 +++ 1 file changed, 3 insertions(+) diff --

[libvirt] [PATCH RFC 04/40] qemu: domain: Split out setup of virStorageSource from qemu driver config

2019-10-18 Thread Peter Krempa
qemuDomainPrepareDiskSourceData historically prepared everything but we'we split out the majority of the functionality so that it sets up predominantely only according to the configuration of the disk. There was one leftover bit of setting the gluster debug level from the config. Split this out in

[libvirt] [PATCH RFC 06/40] qemu: domain: clarify sematics of qemuDomainPrepareDiskSourceData

2019-10-18 Thread Peter Krempa
Note in the comment that this function prepares the storage source based on the configuration of the disk. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 29212eaa

[libvirt] [PATCH RFC 02/40] util: hash: Add new constructor 'virHashNew'

2019-10-18 Thread Peter Krempa
Add a simpler constructor for hash tables which specifically does not require specifying the initial hash size and uses simpler freeing function. The initial hash table size usually is not important as the hash table is growing when it reaches certain number of entries in one bucket. Additionally

[libvirt] [PATCH RFC 00/40] qemu: Add support for incremental backups

2019-10-18 Thread Peter Krempa
This series is my attempt to clean up and finish incremental backup as it was last posted in v10 here: https://www.redhat.com/archives/libvir-list/2019-August/msg01018.html Out of that series, patch 1 was dropped for now and I'll revisit it later. The patches adding docs, xml parsing and job plum

[libvirt] [PATCH RFC 11/40] conf: Remove unused virDomainDiskFindByBusAndDst

2019-10-18 Thread Peter Krempa
Previous commit removed last use of this function so we can get rid of it.t Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 21 - src/conf/domain_conf.h | 3 --- src/libvirt_private.syms | 1 - 3 files changed, 25 deletions(-) diff --git a/src/conf/domain_conf

[libvirt] [PATCH RFC 12/40] Replace virDomainDiskByName by virDomainDiskByTarget in appropriate cases

2019-10-18 Thread Peter Krempa
In many cases we used virDomainDiskByName to solely look up disk by target. We have a new helper now so we can replace it. Signed-off-by: Peter Krempa --- src/libxl/libxl_driver.c | 2 +- src/qemu/qemu_blockjob.c | 6 +++--- src/qemu/qemu_domain.c| 4 ++-- src/qemu/qemu_driver.c| 2 +-

[libvirt] [PATCH RFC 17/40] conf: snapshot: Don't clear current snapshot when redefining an existing one

2019-10-18 Thread Peter Krempa
There's no point in clearing the current snapshot when we are just changing the definition of the current snapshot as by the virtue of the 'update_current' flag the same snapshot would become current in qemuDomainSnapshotCreateXML. Signed-off-by: Peter Krempa --- src/conf/snapshot_conf.c | 7 +--

[libvirt] [PATCH RFC 28/40] qemu: blockjob: Use 'g_free' in qemuBlockJobDataDispose

2019-10-18 Thread Peter Krempa
Prepare the function for addition of new members to clean. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 127a04e840..e12dcde729 100644 --- a/src/qemu/qemu_

[libvirt] [PATCH RFC 18/40] conf: snapshot: Remove 'update_current' parameter from virDomainSnapshotRedefinePrep

2019-10-18 Thread Peter Krempa
The variable is unused so we can drop it. Signed-off-by: Peter Krempa --- src/conf/snapshot_conf.c | 1 - src/conf/snapshot_conf.h | 1 - src/qemu/qemu_driver.c | 2 +- src/test/test_driver.c | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/conf/snapshot_conf.c b/sr

[libvirt] [PATCH RFC 33/40] backup: Implement virsh support for backup

2019-10-18 Thread Peter Krempa
From: Eric Blake Introduce virsh commands for performing backup jobs. Signed-off-by: Eric Blake --- tools/Makefile.am| 1 + tools/virsh-backup.c | 209 +++ tools/virsh-backup.h | 21 + tools/virsh.c| 2 + tools/virsh.h| 1 +

[libvirt] [PATCH RFC 23/40] qemu: checkpoint: Split out checkpoint creation code

2019-10-18 Thread Peter Krempa
Separate out individual steps of creating a checkpoint from qemuCheckpointCreateXML into separate functions. This makes the function more readable and understandable and also some of the new functions will be reusable when we will be creating a checkpoint along with a backup in the upcoming patches

[libvirt] [PATCH RFC 32/40] backup: Parse and output backup XML

2019-10-18 Thread Peter Krempa
From: Eric Blake Accept XML describing a generic block job, and output it again as needed. This may still need a few tweaks to match the documented XML and RNG schema. Signed-off-by: Eric Blake --- src/conf/Makefile.inc.am | 2 + src/conf/backup_conf.c | 518 +++

[libvirt] [PATCH RFC 21/40] conf: checkpoint: Don't clear current checkpoint when redefining

2019-10-18 Thread Peter Krempa
If we are updating the current checkpoint when redefining by mentioning the current checkpoint as a parent of the newly redefined one we don't have to clear it first. Signed-off-by: Peter Krempa --- src/conf/checkpoint_conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a

[libvirt] [PATCH RFC 31/40] backup: Implement backup APIs for remote driver

2019-10-18 Thread Peter Krempa
From: Eric Blake This one is fairly straightforward - the generator already does what we need. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrangé --- src/remote/remote_driver.c | 3 ++ src/remote/remote_protocol.x | 53 +++- src/remote_protocol-struct

[libvirt] [PATCH RFC 16/40] qemu: monitor: Remove non-transaction based dirty bitmap APIs

2019-10-18 Thread Peter Krempa
We replaced them by use of transaction to simplify possible failure scenarios. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 51 --- src/qemu/qemu_monitor.h | 19 -- src/qemu/qemu_monitor_json.c | 119 --- src/qemu/qemu_moni

[libvirt] [PATCH RFC 30/40] backup: Introduce virDomainBackup APIs

2019-10-18 Thread Peter Krempa
From: Eric Blake Introduce a few new public APIs related to incremental backups. This builds on the previous notion of a checkpoint (without an existing checkpoint, the new API is a full backup, differing from virDomainBlockCopy in the point of time chosen and in operation on multiple disks at o

[libvirt] [PATCH RFC 25/40] qemu: monitor: Add helper for generating data for block bitmap merging

2019-10-18 Thread Peter Krempa
Introduce qemuMonitorTransactionBitmapMergeSourceAddBitmap which adds the appropriate entry into a virJSONValue array to be used with qemuMonitorTransactionBitmapMerge. Bitmap merging supports two possible formats and this new helper implements the more universal one specifying also the source node

[libvirt] [PATCH RFC 39/40] qemu: Implement backup job APIs and qemu handling

2019-10-18 Thread Peter Krempa
This allows to start and manage the backup job. Signed-off-by: Peter Krempa --- src/qemu/Makefile.inc.am | 2 + src/qemu/qemu_backup.c | 895 +++ src/qemu/qemu_backup.h | 41 ++ src/qemu/qemu_driver.c | 71 4 files changed, 1009 insertions(+) c

[libvirt] [PATCH RFC 40/40] qemu: blockjob: Implement concluded blockjob handler for backup blockjobs

2019-10-18 Thread Peter Krempa
After the individual sub-blockjobs of a backup libvirt job finish we must detect it and notify the parent job, so that it can be properly terminated. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 45 src/qemu/qemu_monitor_json.c | 4 2

[libvirt] [PATCH RFC 36/40] qemu: domain: Track backup job data in the status XML

2019-10-18 Thread Peter Krempa
Store the data of a backup job along with the index counter for new backup jobs in the status XML. Currently we will support only one backup job and thus there's no necessity to add arrays of jobs. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 72 ++

[libvirt] [PATCH RFC 27/40] qemu: blockjob: Refactor qemuBlockJobEventProcessConcludedTransition

2019-10-18 Thread Peter Krempa
Use only one switch case selecting job type and decide what's successful outcome on a case-by-case basis. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 81 1 file changed, 23 insertions(+), 58 deletions(-) diff --git a/src/qemu/qemu_blockjob

[libvirt] [PATCH RFC 38/40] tests: qemustatusxml2xml: Add test for 'pull' type backup job

2019-10-18 Thread Peter Krempa
Signed-off-by: Peter Krempa --- .../qemustatusxml2xmldata/backup-pull-in.xml | 607 ++ .../qemustatusxml2xmldata/backup-pull-out.xml | 1 + tests/qemuxml2xmltest.c | 2 + 3 files changed, 610 insertions(+) create mode 100644 tests/qemustatusxml2xmldata/

[libvirt] [PATCH RFC 20/40] conf: checkpoint: Don't clear current checkpoint when redefining an existing one

2019-10-18 Thread Peter Krempa
There's no point in clearing the current checkpoint when we are just changing the definition of the current checkpoint as by the virtue of the 'update_current' flag the same checkpoint would become current in qemuCheckpointCreateXML. Signed-off-by: Peter Krempa --- src/conf/checkpoint_conf.c | 5

[libvirt] [PATCH RFC 34/40] Add 'backup' block job type

2019-10-18 Thread Peter Krempa
A backup job may consist of many backup sub-blockjobs. Add the new blockjob type and add all type converter strings. Signed-off-by: Peter Krempa --- examples/c/misc/event-test.c | 3 +++ include/libvirt/libvirt-domain.h | 3 +++ src/conf/domain_conf.c | 2 +- src/qemu/qemu_blockjob

[libvirt] [PATCH RFC 35/40] qemu: monitor: Add support for blockdev-backup via 'transaction'

2019-10-18 Thread Peter Krempa
Implement the transaction actions generator for blockdev-backup. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 13 + src/qemu/qemu_monitor.h | 15 +++ src/qemu/qemu_monitor_json.c | 29 + src/qemu/qemu_monitor_json.h | 8

[libvirt] [PATCH RFC 19/40] conf: Don't reuse variable for different object in virDomainCheckpointRedefinePrep

2019-10-18 Thread Peter Krempa
The 'other' variable was used to store the parent of the redefined checkpoint and then the existing version of the currently redefined checkpoint. Make it less confusing by adding a 'parent' variable for the first case. Signed-off-by: Peter Krempa --- src/conf/checkpoint_conf.c | 14

[libvirt] [PATCH RFC 22/40] qemu: checkpoint: Enforce that 'bitmap' name must match checkpoint name

2019-10-18 Thread Peter Krempa
Prevent insane configurations by enforcing that disk bitmap for a checkpoint must match the name of the checkpoint. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index

[libvirt] [PATCH RFC 26/40] qemu: checkpoint: Use qemuMonitorTransactionBitmapMergeSourceAddBitmap

2019-10-18 Thread Peter Krempa
Use the new helper in qemuCheckpointDiscard rather than constructing the array manually. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 6a272f9dab..937d9d

[libvirt] [PATCH RFC 24/40] qemu: checkpoint: Extract finalizing steps of checkpoint creation

2019-10-18 Thread Peter Krempa
Extract the linking and saving bits of checkpoint creation into qemuCheckpointCreateFinalize so that qemuCheckpointCreateXML is a bit simpler and also makes it reusable in the backup code. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 44 +- src

[libvirt] [PATCH RFC 29/40] backup: Document new XML for backups

2019-10-18 Thread Peter Krempa
From: Eric Blake Prepare for new backup APIs by describing the XML that will represent a backup. The XML resembles snapshots and checkpoints in being able to select actions for a set of disks, but has other differences. It can support both push model (the hypervisor does the backup directly int

[libvirt] [PATCH RFC 37/40] qemu: blockjob: Track internal data for 'backup' blockjob

2019-10-18 Thread Peter Krempa
A backup blockjob needs to be able to notify the parent backup job as well as track all data to be able to clean up the bitmap and blockdev used for the backup. Add the data structure, job allocation function and status XML formatter and parser. Signed-off-by: Peter Krempa --- src/qemu/qemu_blo

Re: [libvirt] [PATCH RFC 00/40] qemu: Add support for incremental backups

2019-10-18 Thread Peter Krempa
On Fri, Oct 18, 2019 at 18:10:45 +0200, Peter Krempa wrote: [...] For convenience you can fetch it from git fetch https://gitlab.com/pipo.sk/libvirt.git incremental-backup-rfc -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/2] virstring: Reimplement g_strdup_printf() and g_strdup_vprintf()

2019-10-18 Thread Eric Blake
On 10/18/19 3:16 AM, Michal Privoznik wrote: These functions don't really abort() on OOM. The fix was merged upstream, but not in the minimal version we require. Provide our own implementation which can be removed once we bump the minimal version. Signed-off-by: Michal Privoznik --- + +/* D

[libvirt] [PATCH] qemu: fix CPU model error probing capabilities for ppc

2019-10-18 Thread Daniel P . Berrangé
The CPU driver only supports CPU models for PPC64 architecture, not plain PPC. Failed to probe capabilities for /usr/bin/qemu-system-ppc: this function is not supported by the connection driver: 'ppc' architecture is not supported by CPU driver This fixes a bug in commit db873ab3bc5f6fbd

Re: [libvirt] [PATCH RFC 01/40] util: hash: Add possibility to use simpler data free function in virHash

2019-10-18 Thread Eric Blake
On 10/18/19 11:10 AM, Peter Krempa wrote: Introduce a new type virHashDataFreeSimple which has only a void * as argument for cases when knowing the name of the entry when freeing the hash entry is not required. Signed-off-by: Peter Krempa --- src/conf/domain_addr.c | 4 ++-- src/util/vircgr

[libvirt] [PATCH v3 1/3] qemu_hotplug.c: adding qemuDomainGetUnplugTimeout

2019-10-18 Thread Daniel Henrique Barboza
For some architectures and setups, device removal can take longer than the default 5 seconds. This results in commands such as 'virsh setvcpus' to fire timeout messages even if the operation were successful in the guest, confusing the user. This patch sets a new 10 seconds unplug timeout for PPC64

[libvirt] [PATCH v3 2/3] qemu: Remove qemu_hotplugpriv.h and qemuDomainRemoveDeviceWaitTime

2019-10-18 Thread Daniel Henrique Barboza
qemu_hotplugpriv.h is a header file created to share a global variable called 'qemuDomainRemoveDeviceWaitTime', declared in qemu_hotplug.c, to other files that would want to change the timeout value (currently, only tests/qemuhotplugtest.c). Previous patch deprecated the variable, using qemu_drive

[libvirt] [PATCH v3 0/3] unplug timeout changes for PPC64

2019-10-18 Thread Daniel Henrique Barboza
changes in v3: - redesigned patch 1 based on Cole Robinson feedback v2: https://www.redhat.com/archives/libvir-list/2019-September/msg00447.html v1: https://www.redhat.com/archives/libvir-list/2019-August/msg00698.html Daniel Henrique Barboza (3): qemu_hotplug.c: adding qemuDomainGetUnplugTime

[libvirt] [PATCH v3 3/3] qemu_hotplug.c: user-friendlier setvcpus timeout error message

2019-10-18 Thread Daniel Henrique Barboza
The current 'setvcpus' timeout message requires a deeper understanding of QEMU/Libvirt internals to proper react to it. One who knows how setvcpus unplug work (it is an asynchronous operation between QEMU and guest that Libvirt can't know for sure if it failed, unless an explicit error happened dur

Re: [libvirt] [PATCH RFC 04/40] qemu: domain: Split out setup of virStorageSource from qemu driver config

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: qemuDomainPrepareDiskSourceData historically prepared everything but we'we split out the majority of the functionality so that it sets up predominantely only according to the configuration of the disk. There was one leftover bit of setting the gluster d

Re: [libvirt] [PATCH RFC 05/40] qemu: domain: Remove pointless return value in qemuDomainPrepareDiskSourceData

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: The function does not do anything that could fail. Remove the return value. Signed-off-by: Peter Krempa --- Reviewed-by: Daniel Henrique Barboza src/qemu/qemu_domain.c | 16 src/qemu/qemu_domain.h | 5 ++--- tests/qemublo

Re: [libvirt] [PATCH RFC 06/40] qemu: domain: clarify sematics of qemuDomainPrepareDiskSourceData

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: Note in the comment that this function prepares the storage source based on the configuration of the disk. Signed-off-by: Peter Krempa --- Reviewed-by: Daniel Henrique Barboza src/qemu/qemu_domain.c | 4 ++-- 1 file changed, 2 insertions(+),

Re: [libvirt] [PATCH RFC 07/40] qemu: domain: Tolerate NULL @disk in qemuDomainPrepareDiskSourceData

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: In some cases we want to prepare a @src which is not meant to belong to a disk and thus does not require us to copy the data. Allow passing in NULL @disk into qemuDomainPrepareDiskSourceData. Signed-off-by: Peter Krempa --- This is worth pushing as

Re: [libvirt] [PATCH RFC 08/40] conf: Remove virDomainDiskPathByName

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: Last use was removed in 29682196d8f. Signed-off-by: Peter Krempa --- Reviewed-by: Daniel Henrique Barboza src/conf/domain_conf.c | 11 --- src/conf/domain_conf.h | 1 - src/libvirt_private.syms | 1 - 3 files changed, 13 delet

Re: [libvirt] [PATCH RFC 09/40] conf: Introduce virDomainDiskByTarget

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: Introduce a simpler replacement for virDomainDiskByName when looking up by disk target. Signed-off-by: Peter Krempa --- Reviewed-by: Daniel Henrique Barboza src/conf/domain_conf.c | 16 src/conf/domain_conf.h | 4

Re: [libvirt] [PATCH RFC 10/40] qemu: Replace use of virDomainDiskFindByBusAndDst with virDomainDiskByTarget

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: In both replaced cases we have other code that verifies that the bus can't be changed or that the target is unique, so limiting the search to disks with same bus makes no sense. Signed-off-by: Peter Krempa --- Reviewed-by: Daniel Henrique Barboza

Re: [libvirt] [PATCH RFC 11/40] conf: Remove unused virDomainDiskFindByBusAndDst

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: Previous commit removed last use of this function so we can get rid of it.t Extra 't' at the end Reviewed-by: Daniel Henrique Barboza Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 21 - src/conf/domain_conf.h

Re: [libvirt] [PATCH RFC 12/40] Replace virDomainDiskByName by virDomainDiskByTarget in appropriate cases

2019-10-18 Thread Daniel Henrique Barboza
On 10/18/19 1:10 PM, Peter Krempa wrote: In many cases we used virDomainDiskByName to solely look up disk by target. We have a new helper now so we can replace it. Signed-off-by: Peter Krempa --- Reviewed-by: Daniel Henrique Barboza src/libxl/libxl_driver.c | 2 +- src/qemu/qemu_bl

Re: [libvirt] [PATCH RFC 02/40] util: hash: Add new constructor 'virHashNew'

2019-10-18 Thread Eric Blake
On 10/18/19 11:10 AM, Peter Krempa wrote: Add a simpler constructor for hash tables which specifically does not require specifying the initial hash size and uses simpler freeing function. The initial hash table size usually is not important as the hash table is growing when it reaches certain nu

  1   2   >