Re: [libvirt PATCH] qemu: explicitly disable virgl when requested

2020-01-24 Thread Michal Prívozník
On 1/25/20 12:12 AM, Jonathon Jongsma wrote: > If a domain is configured to have an egl-headless display and a virtio > video device, virgl will be enabled automatically within the guest, even > if the video device is configured with accel3d='no'. > > In this case we should explicitly pass

[libvirt PATCH] qemu: explicitly disable virgl when requested

2020-01-24 Thread Jonathon Jongsma
If a domain is configured to have an egl-headless display and a virtio video device, virgl will be enabled automatically within the guest, even if the video device is configured with accel3d='no'. In this case we should explicitly pass 'virgl=off' to qemu. See

Re: [RFC PATCH 09/16] qemu: checkpoint: Extract calculation of bitmap merging for checkpoint deletion

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: This will allow some testing before refactoring. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 72 -- src/qemu/qemu_checkpoint.h | 7 2 files changed, 53 insertions(+), 26 deletions(-) diff

Re: [RFC PATCH 08/16] qemu: checkpoint: Introduce helper to find checkpoint disk definition in parents

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: The algorithm is used in two places to find the parent checkpoint object which contains given disk and then uses data from the disk. Additionally the code is written in a very non-obvious way. Factor out the lookup of the disk into a function which also

Re: [RFC PATCH 07/16] qemu: domain: Remove unused qemuDomainDiskNodeFormatLookup

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: The function has no users now and there's no need for it as the common pattern is to look up the whole disk object anyways. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 14 -- src/qemu/qemu_domain.h | 3 --- 2 files changed,

Re: [RFC PATCH 06/16] qemu: checkpoint: tolerate missing disks on checkpoint deletion

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: If a disk is unplugged and then the user tries to delete a checkpoint the code would try to use NULL node name as it was not checked. Fix this by fetching the whole disk definition object and verifying it was found. Signed-off-by: Peter Krempa ---

Re: [RFC PATCH 05/16] qemu: checkpoint: Use disk definition directly when creating checkpoint

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: Lookup the whole disk definition rather than just the node name. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal

Re: [RFC PATCH 03/16] qemu: checkpoint: rename disk->chkdisk in qemuCheckpointDiscardBitmaps

2020-01-24 Thread Eric Blake
On 1/24/20 11:15 AM, Eric Blake wrote: On 1/9/20 12:21 PM, Peter Krempa wrote: Upcomming patches will also use the domain diks definition. Rename disk Upcoming, disck Urgh - I typo'd my typo correction. 'disck' is not a word, and 'disc' is unusual these days; so I meant 'disk'. to

Re: [RFC PATCH 04/16] qemu: checkpoint: rename disk->chkdisk in qemuCheckpointAddActions

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: Upcomming patches will also use the domain diks definition. Rename disk to chkdisk for clarity. Same typos as in 3/16. You could squash the two patches if desired, since it is so mechanical. Reviewed-by: Eric Blake -- Eric Blake, Principal Software

Re: [RFC PATCH 03/16] qemu: checkpoint: rename disk->chkdisk in qemuCheckpointDiscardBitmaps

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: Upcomming patches will also use the domain diks definition. Rename disk Upcoming, disck to chkdisk for clarity. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-)

Re: [RFC PATCH 02/16] qemu: checkpoint: split out checkpoint deletion bitmaps

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: qemuCheckpointDiscard is a massive function that can be separated into smaller bits. Extract the part that actually modifies the disk from the metadata handling. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 137

Re: [RFC PATCH 01/16] qemu: checkpoint: Store whether deleted checkpoint is current in a variable

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: Avoid two computations by using a boolean. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c Reviewed-by: Eric

Re: [RFC PATCH 00/16] qemu: checkpoint: Add support for deleting checkpoints accross snapshots

2020-01-24 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: Posted as RFC because qemu probably doesn't reopen backing images for bitmap operations resulting in: $ virsh checkpoint-delete vm --checkpointname a error: Failed to delete checkpoint a error: internal error: unable to execute QEMU command

Re: [PATCH v2 0/2] qemu: prevent too-deeply nested backing XML

2020-01-24 Thread Eric Blake
On 1/24/20 10:29 AM, Peter Krempa wrote: Patch 1 is new in the series. Patch 2 deals (partially) with review feedback on v1. Peter Krempa (2): qemu: snapshot: Always rewrite backingStore data when reusing existing images qemu: snapshot: Prevent too-nested domain XML when doing

Re: [libvirt PATCHv2 10/10] docs: add virtiofs kbase

2020-01-24 Thread Ján Tomko
On Fri, Jan 24, 2020 at 10:41:32AM +0100, Peter Krempa wrote: On Thu, Jan 23, 2020 at 18:46:11 +0100, Ján Tomko wrote: Add a document describing the usage of virtiofs. --- docs/kbase.html.in | 3 + docs/kbase/virtiofs.rst | 153 2 files changed,

Re: [PATCH v2 9/9] docs: secret: Unify and sanitize examples on how to set secret value

2020-01-24 Thread Eric Blake
On 1/24/20 10:08 AM, Peter Krempa wrote: Discourage passing secrets as commandline arguments. Signed-off-by: Peter Krempa --- docs/formatsecret.html.in | 88 +-- 1 file changed, 57 insertions(+), 31 deletions(-) +Setting secret values in virsh +

Re: [libvirt PATCHv2 10/10] docs: add virtiofs kbase

2020-01-24 Thread Ján Tomko
On Thu, Jan 23, 2020 at 03:58:43PM -0600, Eric Blake wrote: On 1/23/20 11:46 AM, Ján Tomko wrote: Add a document describing the usage of virtiofs. --- docs/kbase.html.in | 3 + docs/kbase/virtiofs.rst | 153 2 files changed, 156 insertions(+)

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.

2020-01-24 Thread Richard W.M. Jones
On Fri, Jan 24, 2020 at 04:13:14PM +, Daniel P. Berrangé wrote: > On Fri, Jan 24, 2020 at 03:01:51PM +, Daniel P. Berrangé wrote: > > On Fri, Jan 24, 2020 at 02:51:39PM +, Richard W.M. Jones wrote: > > > On Fri, Jan 24, 2020 at 02:35:01PM +, Daniel P. Berrangé wrote: > > > > On

[PATCH v2 2/2] qemu: snapshot: Prevent too-nested domain XML when doing inactive snapshot

2020-01-24 Thread Peter Krempa
Similarly to 510d154a0b41aa70aadabc0918d16dee22882394 we need to prevent doing too deeply nested backing chains and reject them with a sane error message. Add a loop to go through the snapshots prior to attempting actually creating them to prevent some possible inconsistent scenarios. We don't

[PATCH v2 1/2] qemu: snapshot: Always rewrite backingStore data when reusing existing images

2020-01-24 Thread Peter Krempa
Don't adopt the backing store data when reusing images provided by the user. This will force a backing chain re-probe as users might have passed in something unexpected in the overlay where our view of the backing chain would not correspond. This is done only for inactive snapshots as there we

[PATCH v2 0/2] qemu: prevent too-deeply nested backing XML

2020-01-24 Thread Peter Krempa
Patch 1 is new in the series. Patch 2 deals (partially) with review feedback on v1. Peter Krempa (2): qemu: snapshot: Always rewrite backingStore data when reusing existing images qemu: snapshot: Prevent too-nested domain XML when doing inactive snapshot src/qemu/qemu_driver.c | 6

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.

2020-01-24 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 03:01:51PM +, Daniel P. Berrangé wrote: > On Fri, Jan 24, 2020 at 02:51:39PM +, Richard W.M. Jones wrote: > > On Fri, Jan 24, 2020 at 02:35:01PM +, Daniel P. Berrangé wrote: > > > On Sun, Jan 19, 2020 at 01:04:07PM +, Richard W.M. Jones wrote: > > > >

Re: [PATCH v2 3/5] conf: Add rng backend model builtin

2020-01-24 Thread Michal Privoznik
On 1/9/20 9:00 AM, Han Han wrote: The 'builtin' rng backend model can be used as following: Signed-off-by: Han Han --- docs/formatdomain.html.in | 10 ++ docs/formatdomaincaps.html.in | 1 + docs/schemas/domaincommon.rng | 6 ++ src/conf/domain_audit.c

Re: [PATCH v2 0/5] Support rng backend model builtin

2020-01-24 Thread Michal Privoznik
On 1/9/20 9:00 AM, Han Han wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1785091 Implement 'rng-builtin' backend from QEMU. This feature is introduced to QEMU since v4.2. It uses getrandom() to get random, no external random source needed. github repo:

[PATCH v2 8/9] tools: virsh: Add --interactive flag for secret-set-value command

2020-01-24 Thread Peter Krempa
Simplify human usage of secret-set-value by adding --interactive which will read the value of the secret from the terminal. Signed-off-by: Peter Krempa --- docs/manpages/virsh.rst | 7 +-- tools/virsh-secret.c| 22 +- 2 files changed, 26 insertions(+), 3

[PATCH v2 9/9] docs: secret: Unify and sanitize examples on how to set secret value

2020-01-24 Thread Peter Krempa
Discourage passing secrets as commandline arguments. Signed-off-by: Peter Krempa --- docs/formatsecret.html.in | 88 +-- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/docs/formatsecret.html.in b/docs/formatsecret.html.in index

[PATCH v2 6/9] virsh: secret: Print warning that passing secret on command-line is insecure

2020-01-24 Thread Peter Krempa
Print a warning if users pass in secrets as command line arguments and mention it in the man page. Signed-off-by: Peter Krempa --- docs/manpages/virsh.rst | 3 +++ tools/virsh-secret.c| 4 2 files changed, 7 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst

[PATCH v2 7/9] virsh: secret: Add --plain switch for secret-set-value

2020-01-24 Thread Peter Krempa
Allow using the contents of --file without base64 decoding. Signed-off-by: Peter Krempa --- docs/manpages/virsh.rst | 5 +++-- tools/virsh-secret.c| 14 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index

[PATCH v2 0/9] virsh: secret: Improve handling of secret value

2020-01-24 Thread Peter Krempa
Improve handling of secrets for security. 'secret-passwd' command was dropped in favor of '--interactive' and few other changes requested at review. Peter Krempa (9): virsh: Work around virSecretFree quirks virsh: secret: Refactor cleanup in cmdSecretSetValue virsh: secret: Refactor

[PATCH v2 5/9] virsh: secret: Add --file 'filename' support for secret-set-value

2020-01-24 Thread Peter Krempa
The necessity to specify the secret value as command argument is insecure. Allow reading the secret from a file. Signed-off-by: Peter Krempa --- docs/manpages/virsh.rst | 7 +-- tools/virsh-secret.c| 38 +- 2 files changed, 38 insertions(+), 7

[PATCH v2 2/9] virsh: secret: Refactor cleanup in cmdSecretSetValue

2020-01-24 Thread Peter Krempa
Automatically clean the secret object and get rid of the cleanup label and 'ret' valiable. Signed-off-by: Peter Krempa --- tools/virsh-secret.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index

[PATCH v2 3/9] virsh: secret: Refactor cleanup in cmdSecretGetValue

2020-01-24 Thread Peter Krempa
Automatically clean the secret object and get rid of the cleanup label and 'ret' valiable. Signed-off-by: Peter Krempa --- tools/virsh-secret.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index

[PATCH v2 1/9] virsh: Work around virSecretFree quirks

2020-01-24 Thread Peter Krempa
Similarly to other libvirt object freeing APIs the function resets the libvirt error when called and doesn't take NULL gracefully. Install the workaround and g_autoptr handlers similarly to the 'virshDomain' type. Signed-off-by: Peter Krempa --- build-aux/syntax-check.mk | 2 +-

[PATCH v2 4/9] virsh: secret: Add --plain flag for secret-get-value

2020-01-24 Thread Peter Krempa
Users might want to get the raw value instead of dealing with base64 encoding. This might be useful for redirection to file and also for simple human-readable secrets. Signed-off-by: Peter Krempa --- docs/manpages/virsh.rst | 6 +- tools/virsh-secret.c| 17 +++-- 2 files

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.

2020-01-24 Thread Richard W.M. Jones
Seems like the CI test is passing now. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html

Re: [Bug 1860759] Re: [REGRESSION] option `-snapshot` ignored with blockdev

2020-01-24 Thread Eric Blake
On 1/24/20 4:41 AM, Ildar wrote: Max, thanks a lot for the explanation. Do you mean that snapshot-ing isn't possible totally for blockdev? Then I guess some libvirt users are in trouble :(( Actually I didn't quite caught the reason why a blockdev supports backing but not {backing to a file on

[libvirt PATCH v2 3/6] qemu: support interface functionality

2020-01-24 Thread Laine Stump
The QEMU driver uses the element to setup a "failover" pair of devices - the persistent device must be a virtio emulated NIC, with the only extra configuration being the addition of ",failover=on" to the device commandline, and the transient device must be a hostdev NIC ( or with a network that

[libvirt PATCH v2 2/6] conf: parse/format subelement of

2020-01-24 Thread Laine Stump
The subelement of devices is used to configure a simple teaming association between two interfaces in a domain. Example: The interface with is assumed to always be present, while the interface with type='transient' may be be

[libvirt PATCH v2 6/6] docs: document subelement

2020-01-24 Thread Laine Stump
and the QEMU backend implementation using virtio failover. Signed-off-by: Laine Stump --- docs/formatdomain.html.in | 100 ++ docs/news.xml | 28 +++ 2 files changed, 128 insertions(+) diff --git a/docs/formatdomain.html.in

[libvirt PATCH v2 0/6] element (was: virtio failover / vfio auto-plug-on-migrate)

2020-01-24 Thread Laine Stump
V1: https://www.redhat.com/archives/libvir-list/2020-January/msg00813.html This all used different names in V1 - in that incarnation the configuration was done using "failover" and "backupAlias" attributes added to the subelement of . But the resulting code was cumbersome and had little bits

[libvirt PATCH v2 5/6] qemu: add wait-unplug to qemu migration status enum

2020-01-24 Thread Laine Stump
Aside from itinerant error (actually warning) messages due to an unrecognized response from qemu, this isn't even necessary - the migration proceeds successfully to completion anyway. (I'm not sure where to see this status reported in the API though - do we need to add an extra state, or

[libvirt PATCH v2 1/6] qemu: add capabilities flag for failover feature

2020-01-24 Thread Laine Stump
Presence of the virtio-net-pci option called "failover" indicates support in a qemu binary of a simplistic bonding of a virtio-net device with another PCI device. This feature allows migration of guests that have a network device assigned to a guest with VFIO, by creating a network bond device in

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.

2020-01-24 Thread Richard W.M. Jones
I pushed those patches, so hopefully you should see the CI job being fixed shortly. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.

2020-01-24 Thread Richard W.M. Jones
On Fri, Jan 24, 2020 at 03:01:51PM +, Daniel P. Berrangé wrote: > On Fri, Jan 24, 2020 at 02:51:39PM +, Richard W.M. Jones wrote: > > On Fri, Jan 24, 2020 at 02:35:01PM +, Daniel P. Berrangé wrote: > > > On Sun, Jan 19, 2020 at 01:04:07PM +, Richard W.M. Jones wrote: > > > >

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.

2020-01-24 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 02:51:39PM +, Richard W.M. Jones wrote: > On Fri, Jan 24, 2020 at 02:35:01PM +, Daniel P. Berrangé wrote: > > On Sun, Jan 19, 2020 at 01:04:07PM +, Richard W.M. Jones wrote: > > > Basically OCaml 4.10 is much more strict about the difference between > > > string

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.

2020-01-24 Thread Richard W.M. Jones
On Fri, Jan 24, 2020 at 02:35:01PM +, Daniel P. Berrangé wrote: > On Sun, Jan 19, 2020 at 01:04:07PM +, Richard W.M. Jones wrote: > > Basically OCaml 4.10 is much more strict about the difference between > > string (immutable) and bytes (mutable). > > For all patches > > Reviewed-by:

Re: [PATCH ocaml 0/3] Small fixes for OCaml 4.10.

2020-01-24 Thread Daniel P . Berrangé
On Sun, Jan 19, 2020 at 01:04:07PM +, Richard W.M. Jones wrote: > Basically OCaml 4.10 is much more strict about the difference between > string (immutable) and bytes (mutable). For all patches Reviewed-by: Daniel P. Berrangé I presume this will fix the rawhide CI failure we have with

Re: [libvirt PATCHv2 04/10] conf: qemu: add virtiofs fsdriver type

2020-01-24 Thread Ján Tomko
On Fri, Jan 24, 2020 at 09:00:04AM +0100, Peter Krempa wrote: @@ -3949,6 +3954,8 @@ while the value immediate means that a host writeback is immediately triggered for all pages touched during a guest file write operation (since 0.9.10). +Since 6.1.0,

Re: [libvirt PATCH 05/32] build: generate configmake.h in root directory

2020-01-24 Thread Pavel Hrdina
On Thu, Jan 23, 2020 at 11:42:58AM +, Daniel P. Berrangé wrote: > Currently we rely on gnulib creating configmake.h, but we > can easily create it ourselves instead. > > Signed-off-by: Daniel P. Berrangé > --- > Makefile.am | 44 >

Re: [patch v2 1/1] virt-aa-helper: Add support for smartcard host-certificates

2020-01-24 Thread Arnaud Patard
Christian Ehrhardt writes: > On Thu, Dec 5, 2019 at 6:25 PM Arnaud Patard wrote: > >> When emulating smartcard with host certificates, qemu needs to >> be able to read the certificates files. Add necessary code to >> add the smartcard certificates file path to the apparmor profile. >> >>

Re: [libvirt PATCH 04/32] src: remove usage of strchrnul function

2020-01-24 Thread Pavel Hrdina
On Thu, Jan 23, 2020 at 11:42:57AM +, Daniel P. Berrangé wrote: > The strchrnul function doesn't exist on Windows and rather > than attempt to implement it, it is simpler to just avoid > its usage, as any callers are easily adapted. > > Signed-off-by: Daniel P. Berrangé > --- >

Re: [PATCH v2] qemu_capabilities: Rework domain caps cache

2020-01-24 Thread Peter Krempa
On Fri, Jan 24, 2020 at 13:40:03 +0100, Michal Privoznik wrote: > Since v5.6.0-48-g270583ed98 we try to cache domain capabilities, > i.e. store filled virDomainCaps in a hash table in virQEMUCaps > for future use. However, there's a race condition in the way it's > implemented. We use

[PATCH v2] qemu_capabilities: Rework domain caps cache

2020-01-24 Thread Michal Privoznik
Since v5.6.0-48-g270583ed98 we try to cache domain capabilities, i.e. store filled virDomainCaps in a hash table in virQEMUCaps for future use. However, there's a race condition in the way it's implemented. We use virQEMUCapsGetDomainCapsCache() to obtain the pointer to the hash table, then we

Re: [PATCH 0/4] qemu: fix block jobs when copy_on_read is enabled

2020-01-24 Thread Peter Krempa
On Fri, Jan 24, 2020 at 11:23:46 +0100, Max Reitz wrote: > On 23.01.20 16:57, Peter Krempa wrote: > > QEMU requires us to pass the topmost node(-name) in the backing chain as > > the 'device' argument for the blockdev-mirror/block-commit commands. > > Otherwise QEMU complains: > > > > "Need a

Re: [libvirt PATCH 03/32] util: add API for reading password from the console

2020-01-24 Thread Pavel Hrdina
On Thu, Jan 23, 2020 at 11:42:56AM +, Daniel P. Berrangé wrote: > This imports a simpler version of GNULIB's getpass() function > impl for Windows. Note that GNULIB's impl was buggy as it > returned a static string on UNIX, and a heap allocated string > on Windows. This new impl always heap

Re: [PATCH v4 0/6] introduce support for an embedded driver mode

2020-01-24 Thread Daniel P . Berrangé
Ping On Fri, Jan 10, 2020 at 10:34:24AM +, Daniel P. Berrangé wrote: > This is a followup to: > > v1: https://www.redhat.com/archives/libvir-list/2019-May/msg00467.html > v2: https://www.redhat.com/archives/libvir-list/2019-December/msg00050.html > v3:

Re: [PATCH 3/3] qemu_capabilities: Reword domain caps cache

2020-01-24 Thread Peter Krempa
On Fri, Jan 24, 2020 at 11:27:18 +0100, Michal Privoznik wrote: > Since v5.6.0-48-g270583ed98 we try to cache domain capabilities, > i.e. store filled virDomainCaps in a hash table in virQEMUCaps > for future use. However, there's a race condition in the way it's > implemented. We use

Re: [PATCH 2/3] qemu_conf: Avoid dereferencing NULL in virQEMUDriverGetHost{NUMACaps, CPU}

2020-01-24 Thread Peter Krempa
On Fri, Jan 24, 2020 at 11:27:17 +0100, Michal Privoznik wrote: > When fixing [1] I've ran attached reproducer and had it spawn > 1024 threads and query capabilities XML in each one of them. This > lead libvirtd to hit the RLIMIT_NOFILE limit which was kind of > expected. What wasn't expected was

Re: [PATCH 1/3] cpu.c: Check properly for virCapabilitiesGetNodeInfo() retval

2020-01-24 Thread Peter Krempa
On Fri, Jan 24, 2020 at 11:27:16 +0100, Michal Privoznik wrote: > The virCapabilitiesGetNodeInfo() function has the usual return > value semantics for integeres: a negative value means an error, > zero or a positive value means success. However, the function > call done in virCPUProbeHost()

[PATCH 0/3] qemu_capabilities: Reword domain caps cache

2020-01-24 Thread Michal Privoznik
It's fairly easy to reproduce the bug (see its description in 3/3). Just put a sleep here: diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index b62dd1df52..eeae967420 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1399,6 +1399,7 @@

[PATCH 1/3] cpu.c: Check properly for virCapabilitiesGetNodeInfo() retval

2020-01-24 Thread Michal Privoznik
The virCapabilitiesGetNodeInfo() function has the usual return value semantics for integeres: a negative value means an error, zero or a positive value means success. However, the function call done in virCPUProbeHost() doesn't check for the return value accordingly. Signed-off-by: Michal

[PATCH 3/3] qemu_capabilities: Reword domain caps cache

2020-01-24 Thread Michal Privoznik
Since v5.6.0-48-g270583ed98 we try to cache domain capabilities, i.e. store filled virDomainCaps in a hash table in virQEMUCaps for future use. However, there's a race condition in the way it's implemented. We use virQEMUCapsGetDomainCapsCache() to obtain the pointer to the hash table, then we

[PATCH 2/3] qemu_conf: Avoid dereferencing NULL in virQEMUDriverGetHost{NUMACaps, CPU}

2020-01-24 Thread Michal Privoznik
When fixing [1] I've ran attached reproducer and had it spawn 1024 threads and query capabilities XML in each one of them. This lead libvirtd to hit the RLIMIT_NOFILE limit which was kind of expected. What wasn't expected was a subsequent segfault. It happened because virCPUProbeHost failed and

Re: [PATCH 0/4] qemu: fix block jobs when copy_on_read is enabled

2020-01-24 Thread Max Reitz
On 23.01.20 16:57, Peter Krempa wrote: > QEMU requires us to pass the topmost node(-name) in the backing chain as > the 'device' argument for the blockdev-mirror/block-commit commands. > Otherwise QEMU complains: > > "Need a root block node" > > Since libvirt always puts the copy-on-read driver

Re: [libvirt PATCHv2 05/10] conf: add virtiofs-related elements and attributes

2020-01-24 Thread Peter Krempa
On Thu, Jan 23, 2020 at 18:46:06 +0100, Ján Tomko wrote: > Add more elements for tuning the virtiofsd daemon > and the vhost-user-fs device: > > > /usr/libexec/virtiofsd > > > > > Signed-off-by: Ján Tomko > --- > docs/formatdomain.html.in | 18 ++- >

Re: [libvirt PATCHv2 10/10] docs: add virtiofs kbase

2020-01-24 Thread Peter Krempa
On Thu, Jan 23, 2020 at 18:46:11 +0100, Ján Tomko wrote: > Add a document describing the usage of virtiofs. > --- > docs/kbase.html.in | 3 + > docs/kbase/virtiofs.rst | 153 > 2 files changed, 156 insertions(+) > create mode 100644

Re: [libvirt PATCHv2 09/10] qemu: build vhost-user-fs device command line

2020-01-24 Thread Peter Krempa
On Thu, Jan 23, 2020 at 18:46:10 +0100, Ján Tomko wrote: > Format the 'vhost-user-fs' device on the QEMU command line. > > https://bugzilla.redhat.com/show_bug.cgi?id=1694166 Rather than posting this bugzilla link to a not very descriptive bug it would be worthwhile to describe what the device

Re: [libvirt PATCHv2 08/10] qemu: add code for handling virtiofsd

2020-01-24 Thread Peter Krempa
On Thu, Jan 23, 2020 at 18:46:09 +0100, Ján Tomko wrote: > Start virtiofsd for each device using it. > > Pre-create the socket for communication with QEMU and pass it > to virtiofsd. > > Note that virtiofsd needs to run as root. > > https://bugzilla.redhat.com/show_bug.cgi?id=1694166 > >

Re: [libvirt PATCHv2 07/10] qemu: validate virtiofs filesystems

2020-01-24 Thread Peter Krempa
On Thu, Jan 23, 2020 at 18:46:08 +0100, Ján Tomko wrote: > Reject unsupported configurations. > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_domain.c | 33 +++-- > 1 file changed, 31 insertions(+), 2 deletions(-) > > diff --git a/src/qemu/qemu_domain.c

Re: [libvirt PATCHv2 06/10] qemu: add virtiofs_debug to qemu.conf

2020-01-24 Thread Peter Krempa
On Thu, Jan 23, 2020 at 18:46:07 +0100, Ján Tomko wrote: > Add a 'virtiofs_debug' option for tuning whether to run virtiofsd > in debug mode. IMO the option should be "virtiofsd_debug" so that it's really clear that it's meant for the daemon. In case of gluster which you put it close to the

Re: [libvirt PATCHv2 05/10] conf: add virtiofs-related elements and attributes

2020-01-24 Thread Peter Krempa
On Thu, Jan 23, 2020 at 18:46:06 +0100, Ján Tomko wrote: > Add more elements for tuning the virtiofsd daemon > and the vhost-user-fs device: > > > /usr/libexec/virtiofsd > > > > > Signed-off-by: Ján Tomko > --- > docs/formatdomain.html.in | 18 ++- >

Re: [libvirt PATCHv2 04/10] conf: qemu: add virtiofs fsdriver type

2020-01-24 Thread Peter Krempa
On Thu, Jan 23, 2020 at 18:46:05 +0100, Ján Tomko wrote: > Introduce a new 'virtiofs' driver type for filesystem. > > > > > > > > > Signed-off-by: Ján Tomko > --- > docs/formatdomain.html.in | 7 ++ > docs/schemas/domaincommon.rng | 16 >