[libvirt] [PATCH 1/4] backup: Prepare for Unix sockets in QMP nbd-server-start

2019-06-05 Thread Eric Blake
Migration always uses a TCP socket for NBD servers, because we don't support same-host migration. But upcoming pull-mode incremental backup needs to also support a Unix socket, for retrieving the backup from the same host. Support this by plumbing virStorageNetHostDef through the monitor calls,

[libvirt] [PATCH 3/4] backup: Add new qemu monitor bitmap

2019-06-05 Thread Eric Blake
The upcoming virDomainBackup() API needs to take advantage of various qcow2 bitmap manipulations as the basis to virDomainCheckpoints and incremental backups. Add four functions to expose block-dirty-bitmap-{add,enable,disable,merge} (this is the recently-added QEMU_CAPS_BITMAP_MERGE capability).

[libvirt] [PATCH 0/4] incremental backup: QMP interactions

2019-06-05 Thread Eric Blake
I'm trying to break my incremental backup work into smaller pieces so I can make progress and actually get some code committed, while I continue to hammer away at preparing a v9 series that addresses even more review comments and things learned during testing. These few patches represent the bulk

[libvirt] [PATCH 2/4] backup: Add two new qemu capabilities

2019-06-05 Thread Eric Blake
Add two capabilities for testing features required for the upcoming virDomainBackupBegin: use block-dirty-bitmap-merge as the generic witness of bitmap support needed for checkpoints (since all of the bitmap management functionalities were finalized in the same qemu 4.0 release), and the bitmap

[libvirt] [PATCH 4/4] backup: Add new parameters to qemu monitor nbd-server-add

2019-06-05 Thread Eric Blake
The upcoming virDomainBackup() API needs to take advantage of the ability to expose a bitmap as part of nbd-server-add for a pull-mode backup (this is the recently-added QEMU_CAPS_NBD_BITMAP capability). Signed-off-by: Eric Blake --- src/qemu/qemu_monitor.h | 4 +++-

Re: [libvirt] [PATCH v4 0/3] numa: deprecate '-numa node, mem' and default memory distribution

2019-06-05 Thread Eduardo Habkost
On Wed, Jun 05, 2019 at 06:33:11PM +0100, Daniel P. Berrangé wrote: [...] > I wonder if there's a way to close the testing gap somehow ? Random idea > would be a non-versioned "pc-no-deprecated" machine type, which blocks > all use of deprecated features and does not promise any migration compat.

Re: [libvirt] [PATCH v4 0/3] numa: deprecate '-numa node, mem' and default memory distribution

2019-06-05 Thread Daniel P . Berrangé
To summarize implications on libvirt... This patch currently doesn't change the deprecation status of any machine type, so it is effectively no-op metadata addition right now. Libvirt version N can implement support for this today, and nothing would change from a functional POV with QEMU 4.1.

Re: [libvirt] [PATCH v6 01/23] conf: allow bandwidth parsing / formatting to include class ID

2019-06-05 Thread Laine Stump
On 5/23/19 11:32 AM, Daniel P. Berrangé wrote: The domain conf actual network def stores a element separately from the . The class ID should really just be an attribute on the element. We can't change existing XML, and this isn't visible to users since it is internal XML only. When we expose

Re: [libvirt] [PATCH 3/3] virsh: undefine: Clarify that --delete-storage-volume-snapshots causes failures

2019-06-05 Thread Eric Blake
On 6/5/19 6:23 AM, Peter Krempa wrote: > The flag causes undefine to fail if trying to remove a non-RBD disk. Add > a warning about that. > > Signed-off-by: Peter Krempa > --- > tools/virsh.pod | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/virsh.pod

Re: [libvirt] [PATCH 0/3] virsh: undefine: Clarify things around snapshots

2019-06-05 Thread Eric Blake
On 6/5/19 6:23 AM, Peter Krempa wrote: > Peter Krempa (3): > virsh: undefine: Clarify help string for --snapshots-metadata > virsh: undefine: Rename --delete-snapshots to > --delete-storage-volume-snapshots > virsh: undefine: Clarify that --delete-storage-volume-snapshots causes >

[libvirt] [PATCH 12/13] qemu: snapshot: Return early if there's nothing to snapshot

2019-06-05 Thread Peter Krempa
Skip actual snapshot creation code if we have 0 disks to snapshot. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5b6d3bb795..b7f5142605 100644 --- a/src/qemu/qemu_driver.c

[libvirt] [PATCH 10/13] qemu: snapshot: Don't overload 'ret' in qemuDomainSnapshotCreateDiskActive

2019-06-05 Thread Peter Krempa
Introduce 'rc' for collecting state from monitor commands so that we can initialize 'ret' to -1. This also fixes few cases which could return 0 from the fucntion despite an error condition. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 23 --- 1 file changed, 12

[libvirt] [PATCH 05/13] qemu: snapshot: Remove unused cleanup section in qemuDomainSnapshotCreateSingleDiskActive

2019-06-05 Thread Peter Krempa
After getting rid of pre-transaction qemu support the cleanup section is unused. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fad96053db..97f7ad16bf

[libvirt] [PATCH 04/13] qemu: Use VIR_AUTO* in qemuDomainSnapshotCreateActiveExternal

2019-06-05 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 65b54b7511..fad96053db 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15358,14 +15358,14 @@

[libvirt] [PATCH 07/13] qemu: snapshot: Always save config XML after qemuDomainSnapshotCreateDiskActive

2019-06-05 Thread Peter Krempa
If there's a offline config definition save it unconditionally even if it was not modified. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[libvirt] [PATCH 13/13] qemu: snapshot: Remove unnecessary 'do_transaction' logic in qemuDomainSnapshotCreateDiskActive

2019-06-05 Thread Peter Krempa
Now that we never get to the actual snapshot code if there's nothing to do we can remove the variable and surrounding logic. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git

[libvirt] [PATCH 03/13] qemu: Use virErrorPreserveLast in qemuDomainSnapshotCreateDiskActive

2019-06-05 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8093b27656..65b54b7511 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15301,7 +15301,7 @@

[libvirt] [PATCH 02/13] qemu: Use VIR_AUTOPTR in qemuDomainSnapshotCreateDiskActive

2019-06-05 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9c6221d3b2..8093b27656 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15235,7 +15235,7 @@

[libvirt] [PATCH 01/13] qemu: snapshot: Pass 'cfg' to external snapshot functions

2019-06-05 Thread Peter Krempa
The caller has it so there's no point in getting it again. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 42b1ce2521..9c6221d3b2 100644 ---

[libvirt] [PATCH 11/13] qemu: snapshot: Unify 'cleanup' and 'error' in qemuDomainSnapshotCreateDiskActive

2019-06-05 Thread Peter Krempa
All cases taking the 'cleanup' path can take the original 'error' path. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 17270d5f83..5b6d3bb795 100644 ---

[libvirt] [PATCH 00/13] qemu: External disk snapshot code refactors/cleanups (blockdev-add saga)

2019-06-05 Thread Peter Krempa
Few cleanups to the snapshot code extracted from my blockdev branch. Peter Krempa (13): qemu: snapshot: Pass 'cfg' to external snapshot functions qemu: Use VIR_AUTOPTR in qemuDomainSnapshotCreateDiskActive qemu: Use virErrorPreserveLast in qemuDomainSnapshotCreateDiskActive qemu: Use

[libvirt] [PATCH 09/13] qemu: snapshot: Move all cleanup of snapshot disk data to qemuDomainSnapshotDiskDataFree

2019-06-05 Thread Peter Krempa
qemuDomainSnapshotDiskDataFree also removes the resources associated with the disk data. Move the unlinking of the just-created file so that we can unify the cleanup paths. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 14 ++ 1 file changed, 6 insertions(+), 8

[libvirt] [PATCH 06/13] qemu: snapshot: Always save status and config after qemuDomainSnapshotCreateDiskActive

2019-06-05 Thread Peter Krempa
The error path is unlikely thus saving the status XML even if we didn't modify it does not add much burden. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[libvirt] [PATCH 08/13] qemu: snapshot: Densely pack data in qemuDomainSnapshotDiskDataCollect

2019-06-05 Thread Peter Krempa
The function skips disks which are not selected for snapshot. Rather than creating a sparse array and check whether the given field is filled compress the entries. Note that this does not allocate a smaller array, but the memory allocation is short-lived. Signed-off-by: Peter Krempa ---

Re: [libvirt] [PATCH 0/3] virsh: undefine: Clarify things around snapshots

2019-06-05 Thread Fabiano Fidêncio
On Wed, Jun 5, 2019 at 1:27 PM Peter Krempa wrote: > > Peter Krempa (3): > virsh: undefine: Clarify help string for --snapshots-metadata > virsh: undefine: Rename --delete-snapshots to > --delete-storage-volume-snapshots > virsh: undefine: Clarify that --delete-storage-volume-snapshots

Re: [libvirt] [Qemu-devel] QMP; unsigned 64-bit ints; JSON standards compliance

2019-06-05 Thread Daniel P . Berrangé
On Tue, Jun 04, 2019 at 08:38:24AM +0200, Markus Armbruster wrote: > We've discussed possible solutions. Is anyone working or intending to > work on patches? I'm not actively working on it now, nor any plans in the near future. I would like to see it fixed sooner rather than later though.

[libvirt] [PATCH 2/3] virsh: undefine: Rename --delete-snapshots to --delete-storage-volume-snapshots

2019-06-05 Thread Peter Krempa
The old flag name confused some users into thinking it's the correct way to undefine a VM with libvirt (not storage volume) snapshots. The correct flag in that case is way less obvious: --snapshots-metadata. Rename the flag (by adding an alias) to something which will promote looking up the

[libvirt] [PATCH 1/3] virsh: undefine: Clarify help string for --snapshots-metadata

2019-06-05 Thread Peter Krempa
Reword the end of the help string to make it more obvious that the VM must be inactive. Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 82140feb57..a6e4469160 100644 ---

[libvirt] [PATCH 0/3] virsh: undefine: Clarify things around snapshots

2019-06-05 Thread Peter Krempa
Peter Krempa (3): virsh: undefine: Clarify help string for --snapshots-metadata virsh: undefine: Rename --delete-snapshots to --delete-storage-volume-snapshots virsh: undefine: Clarify that --delete-storage-volume-snapshots causes failures tools/virsh-domain.c | 6 +-

[libvirt] [PATCH 3/3] virsh: undefine: Clarify that --delete-storage-volume-snapshots causes failures

2019-06-05 Thread Peter Krempa
The flag causes undefine to fail if trying to remove a non-RBD disk. Add a warning about that. Signed-off-by: Peter Krempa --- tools/virsh.pod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/virsh.pod b/tools/virsh.pod index fd9ba00d1f..11e853deea 100644 ---

[libvirt] [PATCH 19/19] tests: add vhost-user-gpu xml2argv tests

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- .../vhost-user-gpu-secondary.args | 35 +++ .../vhost-user-gpu-secondary.xml | 44 +++ tests/qemuxml2argvdata/vhost-user-vga.args| 32 ++

[libvirt] [PATCH 16/19] qemu: start/stop the vhost-user-gpu external device

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Each vhost-user-gpu needs its own helper gpu process. Start/stop them, and apply the emulator cgroup controller. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_extdevice.c | 49 +++ 1 file changed, 44 insertions(+), 5

[libvirt] [PATCH 10/19] qemu: validate virtio-gpu with vhost-user

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Check qemu capability, and accept 3d acceleration. 3d acceleration support is checked when looking for a suitable vhost-user helper. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_process.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff

[libvirt] [PATCH 09/19] qemu: check that qemu is vhost-user-vga capable

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau To support virtio VGA with vhost-user, vhost-user-vga device is necessary. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_domain.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[libvirt] [PATCH 08/19] qemu: add vhost-user-gpu capabilities checks

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Those new devices are merged for QEMU 4.1. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_capabilities.c | 6 ++ src/qemu/qemu_capabilities.h | 4 2 files changed, 10 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c

[libvirt] [PATCH 11/19] qemu: restrict 'virgl=' option to non-vhostuser video type

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau vhost-user device doesn't have a virgl option, it is passed to the vhost-user-gpu helper process instead. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c

[libvirt] [PATCH 13/19] qemu: add qemuSecurityStartVhostUserGPU helper

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau See function documentation. Used in a following patch. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_security.c | 48 src/qemu/qemu_security.h | 6 + 2 files changed, 54 insertions(+) diff --git

[libvirt] [PATCH 17/19] qemu: build vhost-user GPU devices

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau For each vhost-user GPUs, - build a socket chardev, and pass the vhost-user socket to it - build a vhost-user video device and associate it with the chardev Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c | 46 +++-- 1

[libvirt] [PATCH 18/19] tests: mock execv/execve

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Learn to override the paths to the program to execute (vhost-user helpers are executed to check for runtime capabilities). Signed-off-by: Marc-André Lureau --- tests/virfilewrapper.c | 22 ++ 1 file changed, 22 insertions(+) diff --git

[libvirt] [PATCH 06/19] domain: add rendernode attribute on

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau vhost-user-gpu helper may accept --render-node option to specify on which GPU should the renderning be done. (by comparison rendernode is the target/display rendering) Signed-off-by: Marc-André Lureau --- docs/formatdomain.html.in | 5 +

[libvirt] [PATCH 07/19] qemu-cgroup: allow accel rendernode access

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_cgroup.c | 24 1 file changed, 24 insertions(+) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index ca76c4fdfa..1627b5ef5d 100644 --- a/src/qemu/qemu_cgroup.c +++

[libvirt] [PATCH 15/19] qemu: prepare domain for vhost-user GPU

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Call qemuExtVhostUserGPUPrepareDomain() to fill the domain with the location of the vhost-user binary to start. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_extdevice.c | 30 ++ src/qemu/qemu_extdevice.h | 5 +

[libvirt] [PATCH 14/19] qemu: add vhost-user-gpu helper unit

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Similar to the qemu_tpm.c, add a unit with a few functions to start/stop and setup the cgroup of the external vhost-user-gpu process. See function documentation. Since the vhost-user connection fd isn't necessarily specific to QEMU, it was easier to add it to

[libvirt] [PATCH 04/19] qemu: extract out qemuFetchConfigs from firmware

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau The same config files disovery & priority rules are used for vhost-user backends. Signed-off-by: Marc-André Lureau --- src/qemu/Makefile.inc.am | 2 + src/qemu/qemu_configs.c | 183 +++ src/qemu/qemu_configs.h | 31 +++

[libvirt] [PATCH 01/19] device-conf: removed unneeded virDomainDeviceInfoCopy()

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/conf/device_conf.c | 21 - src/conf/device_conf.h | 2 -- src/libvirt_private.syms | 1 - 3 files changed, 24 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index

[libvirt] [PATCH 12/19] qemu: add vhost-user helpers

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Add qemuVhostUserFetchConfigs() to discover vhost-user helpers. qemuVhostUserFillDomainGPU() will find the first matching GPU helper with the required capabilities and set the associated vhost_user_binary. Signed-off-by: Marc-André Lureau --- src/conf/device_conf.c

[libvirt] [PATCH 02/19] tpm: minor argument comment fix

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 835a9caf46..41fef1f8f5 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -745,7

[libvirt] [PATCH 03/19] qemu_firmware: only set nfeatures on success

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau The field is set just before returning on success. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_firmware.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index f3d89d000d..bf29b10b9a 100644 ---

[libvirt] [PATCH 00/19] Add vhost-user-gpu support

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Hi, This series of patches adds support for running virtio GPUs in seperate processes, thanks to vhost-user backend. The QEMU support landed for 4.1. There are several benefits of running the GPU/virgl in an external process, since Mesa is rather heavy on the qemu main

[libvirt] [PATCH 05/19] domain: add "vhostuser" attribute to virtio video model

2019-06-05 Thread marcandre . lureau
From: Marc-André Lureau Accept a new attribute to specify usage of helper process, ex: Signed-off-by: Marc-André Lureau --- docs/formatdomain.html.in | 6 ++ docs/schemas/domaincommon.rng | 11 ++- src/conf/domain_conf.c| 14 ++

Re: [libvirt] [PATCH v2 06/11] qemu: Grab modify job for changing domain XML

2019-06-05 Thread Michal Privoznik
On 6/5/19 11:32 AM, Peter Krempa wrote: On Wed, Jun 05, 2019 at 11:09:14 +0200, Michal Privoznik wrote: Changing domain definition must be guarded with acquiring modify job. The problem is if there is a thread executing say qemuDomainSetMemoryStatsPeriod() which is an API that acquires modify

Re: [libvirt] [PATCH v2 06/11] qemu: Grab modify job for changing domain XML

2019-06-05 Thread Peter Krempa
On Wed, Jun 05, 2019 at 11:09:14 +0200, Michal Privoznik wrote: > Changing domain definition must be guarded with acquiring modify > job. The problem is if there is a thread executing say > qemuDomainSetMemoryStatsPeriod() which is an API that acquires > modify job and then possibly unlock the

[libvirt] [PATCH v2 09/11] lxc_domain: Allow lxcDomainObjListAdd to keep job upon return

2019-06-05 Thread Michal Privoznik
In some cases, caller of lxcDomainObjListAdd() tries to acquire MODIFY job after the call. Let's adjust lxcDomainObjListAdd() so that it will keep the job set upon return (if requested by caller). Signed-off-by: Michal Privoznik --- src/lxc/lxc_domain.c | 17 ++---

[libvirt] [PATCH v2 11/11] libxl_domain: Allow libxlDomainObjListAdd to keep job upon return

2019-06-05 Thread Michal Privoznik
In some cases, caller of libxlDomainObjListAdd() tries to acquire MODIFY job after the call. Let's adjust libxlDomainObjListAdd() so that it will keep the job set upon return (if requested by caller). Signed-off-by: Michal Privoznik --- src/libxl/libxl_domain.c| 17 ++---

[libvirt] [PATCH v2 07/11] qemu_domain: Allow qemuDomainObjListAdd to keep job upon return

2019-06-05 Thread Michal Privoznik
In some cases, caller of qemuDomainObjListAdd() tries to acquire MODIFY job after the call. Let's adjust qemuDomainObjListAdd() so that it will keep the job set upon return (if requested by caller). Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c| 17 ++---

[libvirt] [PATCH v2 08/11] lxc: Grab modify job for changing domain XML

2019-06-05 Thread Michal Privoznik
The reasoning here is the same as in qemu driver fixed in previous commit. Long story short, changing an XML of a domain requires modify job to be acquired. Signed-off-by: Michal Privoznik --- src/lxc/lxc_domain.c | 57 src/lxc/lxc_domain.h | 7

[libvirt] [PATCH v2 10/11] libxl: Grab modify job for changing domain XML

2019-06-05 Thread Michal Privoznik
The reasoning here is the same as in qemu driver fixed in previous commit. Long story short, changing an XML of a domain requires modify job to be acquired. Signed-off-by: Michal Privoznik --- src/libxl/libxl_domain.c| 57 + src/libxl/libxl_domain.h|

[libvirt] [PATCH v2 06/11] qemu: Grab modify job for changing domain XML

2019-06-05 Thread Michal Privoznik
Changing domain definition must be guarded with acquiring modify job. The problem is if there is a thread executing say qemuDomainSetMemoryStatsPeriod() which is an API that acquires modify job and then possibly unlock the domain object and locks it again. However, becasue virDomainObjAssignDef()

[libvirt] [PATCH v2 02/11] virDomainObjListAddLocked: Set vm->def only in success path

2019-06-05 Thread Michal Privoznik
Because of past limitation of virDomainObjListAddObjLocked() we had to set vm->def even before the object was on the domains list. Signed-off-by: Michal Privoznik Reviewed-by: Nikolay Shirokovskiy --- src/conf/virdomainobjlist.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-)

[libvirt] [PATCH v2 05/11] virDomainObjListAdd: Remove unused flag

2019-06-05 Thread Michal Privoznik
After the previous commit the VIR_DOMAIN_OBJ_LIST_ADD_LIVE flag is not used anymore. Let's remove it. Signed-off-by: Michal Privoznik --- src/conf/virdomainobjlist.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conf/virdomainobjlist.h b/src/conf/virdomainobjlist.h

[libvirt] [PATCH v2 03/11] virDomainObjIsActive: Allow vm->def to be NULL

2019-06-05 Thread Michal Privoznik
Signed-off-by: Michal Privoznik Reviewed-by: Nikolay Shirokovskiy --- src/conf/domain_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 4c3ab07062..92c734e13d 100644 --- a/src/conf/domain_conf.h +++

[libvirt] [PATCH v2 00/11] Grab modify job for changing domain XML

2019-06-05 Thread Michal Privoznik
v2 of: https://www.redhat.com/archives/libvir-list/2019-May/msg00858.html diff to v1: - 1/9 from the original series is pushed now. It's independent from the feature. - Acquiring job is done in a way suggested by Nikolay in review of v1. Michal Prívozník (11): virDomainObjListAddObjLocked:

[libvirt] [PATCH v2 01/11] virDomainObjListAddObjLocked: Don't expect vm->def to be set

2019-06-05 Thread Michal Privoznik
In near future vm->def might be not set when calling this function. Therefore, have caller explicitly state what UUID and name the domain object should be stored under. Signed-off-by: Michal Privoznik Reviewed-by: Nikolay Shirokovskiy --- src/conf/virdomainobjlist.c | 14 +- 1 file

[libvirt] [PATCH v2 04/11] virDomainObjListAdd: Leave def assigning as an exercise for caller

2019-06-05 Thread Michal Privoznik
Some driver have concept of jobs (e.g. qemu, lxc, libxl and vz). This means that whenever something wants to modify a domain object it needs to acquire job (to mutually exclude with other threads trying to modify the same object). And aforementioned drivers do that more or less successfully.