Re: [libvirt PATCH 05/10] conf: parse/format

2020-02-19 Thread Laine Stump
On 2/18/20 10:14 PM, Laine Stump wrote: On 2/18/20 12:39 PM, Ján Tomko wrote: On Sun, Feb 16, 2020 at 11:22:54PM -0500, Laine Stump wrote: This is a very simple thing to parse and format, but needs to be done in 4 places, so two trivial utility functions have been made that can be called from a

Re: [PATCH 3/4] lxc: Implement virtual /proc/cpuinfo via LXC fuse

2020-02-19 Thread Julio Faracco
Em qua., 19 de fev. de 2020 às 09:27, Daniel Henrique Barboza escreveu: > > > > On 2/16/20 2:11 PM, Julio Faracco wrote: > > This commit tries to fix a lots of issues related to LXC VCPUs. One of > > Extra 'a' there. "tries to fix lots of issues ..." > > > > them is related to /proc/cpuinfo conten

[PATCH] storage: Add support to set{uid,gid} and sticky bit

2020-02-19 Thread Julio Faracco
This commit add more features to storages that supports setuid, setgid and sticky bit. This extend some permission levels of volumes when you run an hypervisor using a specific user that can run but cannot delete volumes for instance. Additionally, when you create a directory without `pool-build` c

Re: [PATCH 8/9] virStorageFileGetMetadataRecurse: Allow format probing under special circumstances

2020-02-19 Thread Eric Blake
[adding qemu] On 2/19/20 12:57 PM, Peter Krempa wrote: Namely a user creates an overlay on top of single raw/qcow2 image and expects it to work. And it's not just random users, libguestfs and openstack also neglected to set the backing format. Yes, and they are getting patched. Belatedly, b

Re: [PATCH 8/9] virStorageFileGetMetadataRecurse: Allow format probing under special circumstances

2020-02-19 Thread Peter Krempa
On Wed, Feb 19, 2020 at 11:07:09 -0600, Eric Blake wrote: > On 2/19/20 10:40 AM, Peter Krempa wrote: [] > > Namely a user creates an overlay on top of single raw/qcow2 image and > > expects it to work. And it's not just random users, libguestfs and > > openstack also neglected to set the back

Re: [PATCH 8/9] virStorageFileGetMetadataRecurse: Allow format probing under special circumstances

2020-02-19 Thread Eric Blake
On 2/19/20 10:40 AM, Peter Krempa wrote: 1b: base.raw probes as qcow2 (because of whatever the guest wrote there), using it as qcow2 is wrong - the guest will see corrupted data. What's more, if the probe sees it as qcow2 with backing file, and we open the backing file, it also has security impl

Re: [PATCH 8/9] virStorageFileGetMetadataRecurse: Allow format probing under special circumstances

2020-02-19 Thread Peter Krempa
On Wed, Feb 19, 2020 at 17:40:34 +0100, Peter Krempa wrote: > On Wed, Feb 19, 2020 at 10:21:00 -0600, Eric Blake wrote: > > On 2/17/20 11:13 AM, Peter Krempa wrote: [...] > > > With pre-blockdev configurations this will restore the previous > > > behaviour for the images mentioned above as qemu w

Re: [PATCH 9/9] WIP: Add tool for probing images

2020-02-19 Thread Peter Krempa
On Wed, Feb 19, 2020 at 10:31:18 -0600, Eric Blake wrote: > On 2/17/20 11:13 AM, Peter Krempa wrote: > > Note that this is not finished yet, but allows to test the image > > detection patches: > > "allows to ${verb}" is not idiomatic; you want "allows ${verb}ing" or > "allows $subject to ${verb}".

Re: [PATCH 8/9] virStorageFileGetMetadataRecurse: Allow format probing under special circumstances

2020-02-19 Thread Eric Blake
On 2/19/20 10:21 AM, Eric Blake wrote: It took me a few minutes of thinking about this. Scenario 1: base.raw <- wrap.qcow2 where wrap.qcow2 specifies backing of base.raw but not the format.  If we probe, we can have a couple of outcomes: 1a: base.raw probes as raw (the probed image has no

Re: [PATCH 8/9] virStorageFileGetMetadataRecurse: Allow format probing under special circumstances

2020-02-19 Thread Peter Krempa
On Wed, Feb 19, 2020 at 10:21:00 -0600, Eric Blake wrote: > On 2/17/20 11:13 AM, Peter Krempa wrote: > > Allow format probing to work around lazy clients which did not specify > > their format in the overlay. Format probing will be allowed only, if we > > s/only, if/only if/ > > > are able to pro

Re: [PATCH 9/9] WIP: Add tool for probing images

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: Note that this is not finished yet, but allows to test the image detection patches: "allows to ${verb}" is not idiomatic; you want "allows ${verb}ing" or "allows $subject to ${verb}". Here, I would go with "allows testing of the image detection patche

Re: [PATCH 8/9] virStorageFileGetMetadataRecurse: Allow format probing under special circumstances

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: Allow format probing to work around lazy clients which did not specify their format in the overlay. Format probing will be allowed only, if we s/only, if/only if/ are able to probe the image, the probing result was successful and the probed image does

Re: [PATCH 7/9] virStorageFileGetMetadataRecurse: Remove 'cleanup' label

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: There's nothing to clean up. Make it obvious what is returned. Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 50 +++ 1 file changed, 19 insertions(+), 31 deletions(-) Reviewed-by: Eric Blake -- Er

Re: [PATCH 6/9] virStorageFileGetMetadataRecurse: Extract storage access

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: Extract the code that directly deals with storage. This allows further simplification and clarification of virStorageFileGetMetadataRecurse. Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 71 ++- 1 file

Re: [PATCH 5/9] virStorageFileGetMetadataRecurse: Use virHashHasEntry instead of fake pointers

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: Replacing virHashLookup by virHashHasEntry allows to use NULL as the allows us to payload of the hash table rather than putting a fake '1' pointer into the table. Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 4 ++-- 1 file changed,

Re: [PATCH 4/9] virStorageFileGetMetadataRecurse: Expect NULL src->path

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: The path can be NULL e.g. for NBD disks. Use NULLSTR to prevent use of NULL in %s. Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake diff --git a/src/util/

Re: [PATCH 3/9] virStorageFileGetMetadataRecurse: Shuffle around assignment of backing chain depth

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: Move the assignment to a place where we know that the backing store is present rather than having to check in the cleanup section. Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-)

Re: [PATCH 2/9] virStorageFileGetMetadataRecurse: Remove impossible error report

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: We call virStorageFileSupportsBackingChainTraversal which already checks that the 'storageFileRead' callback is non-NULL, which in turn means that virStorageFileRead will not return -2. Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 9 +---

Re: [PATCH 1/9] util: storagefile: Drop image format probing by file suffix

2020-02-19 Thread Peter Krempa
On Wed, Feb 19, 2020 at 09:18:40 -0600, Eric Blake wrote: > On 2/17/20 11:13 AM, Peter Krempa wrote: > > Probing by file suffix was meant to be a last resort if probing by > > contents fails or is not supported. For most formats we never specified > > any suffix. There's a few formats implementing

Re: [PATCH 1/9] util: storagefile: Drop image format probing by file suffix

2020-02-19 Thread Eric Blake
On 2/17/20 11:13 AM, Peter Krempa wrote: Probing by file suffix was meant to be a last resort if probing by contents fails or is not supported. For most formats we never specified any suffix. There's a few formats implementing both magic bytes and suffix and finally DMG which had only suffix prob

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

2020-02-19 Thread Eric Blake
On 2/19/20 4:53 AM, Max Reitz wrote: On 31.01.20 18:11, Eric Blake wrote: ping Do you want further review or is Ján’s sufficient for you? Commit 0bc16997 has already landed, so no further review will show in git history. But you're always welcome to raise issues that might result in follow

Re: [libvirt PATCH 1/2] qemuxml2xmltest: Add case for host-model vendor_id

2020-02-19 Thread Ján Tomko
On Wed, Feb 19, 2020 at 02:09:03PM +0100, Jiri Denemark wrote: This patch show a bug in our code: the s/show/shows/ element present in the source XML is lost when the parsed CPU definition is formatted back to XML. https://bugzilla.redhat.com/show_bug.cgi?id=1804549 Signed-off-by: Jiri Den

Re: [libvirt PATCH 2/2] cpu_conf: Format vendor_id for host-model CPUs

2020-02-19 Thread Ján Tomko
On Wed, Feb 19, 2020 at 02:09:04PM +0100, Jiri Denemark wrote: In commit v5.9.0-400-gaf8e39921a I removed printing model's fallback and vendor_id attributes when no model is specified. However, vendor_id makes sense even without a specific CPU model (for host-model CPUs). https://bugzilla.redhat

[libvirt PATCH 2/2] cpu_conf: Format vendor_id for host-model CPUs

2020-02-19 Thread Jiri Denemark
In commit v5.9.0-400-gaf8e39921a I removed printing model's fallback and vendor_id attributes when no model is specified. However, vendor_id makes sense even without a specific CPU model (for host-model CPUs). https://bugzilla.redhat.com/show_bug.cgi?id=1804549 Signed-off-by: Jiri Denemark ---

[libvirt PATCH 0/2] cpu_conf: Format vendor_id for host-model CPUs

2020-02-19 Thread Jiri Denemark
In commit v5.9.0-400-gaf8e39921a I removed printing model's fallback and vendor_id attributes when no model is specified. However, vendor_id makes sense even without a specific CPU model (for host-model CPUs). https://bugzilla.redhat.com/show_bug.cgi?id=1804549 Jiri Denemark (2): qemuxml2xmltes

[libvirt PATCH 1/2] qemuxml2xmltest: Add case for host-model vendor_id

2020-02-19 Thread Jiri Denemark
This patch show a bug in our code: the element present in the source XML is lost when the parsed CPU definition is formatted back to XML. https://bugzilla.redhat.com/show_bug.cgi?id=1804549 Signed-off-by: Jiri Denemark --- .../cpu-host-model-vendor.xml | 28 +++

Re: [libvirt RFC PATCH] util: vireventglibwatch: watch for G_IO_HUP and G_IO_ERR

2020-02-19 Thread Andrea Bolognani
On Wed, 2020-02-19 at 01:31 +0100, Ján Tomko wrote: > To more closely match the previous usage in virEventPollDispatchHandles, > where called the handle callback for any revents returned by poll. > > This should fix the virtlogd error on subsequent domain startup: > error: can't connect to virtl

Re: [PATCH 4/4] lxc: Count max VCPUs based on cpuset.cpus in native config.

2020-02-19 Thread Daniel Henrique Barboza
On 2/16/20 2:11 PM, Julio Faracco wrote: Native config files sometimes can setup cpuset.cpus to pin som CPUs. typo: s/som/some Everything else LGTM. Before this, LXC was using a fixed number of 1 VCPU. After this commit, XML definition will generate a dynamic number of VCPUs based on th

Re: [PATCH 3/4] lxc: Implement virtual /proc/cpuinfo via LXC fuse

2020-02-19 Thread Daniel Henrique Barboza
On 2/16/20 2:11 PM, Julio Faracco wrote: This commit tries to fix a lots of issues related to LXC VCPUs. One of Extra 'a' there. "tries to fix lots of issues ..." them is related to /proc/cpuinfo content. If only 1 VCPU is set, LXC containers will show all CPUs available for host. The sec

Re: [PATCH 1/4] lxc: Add Real Time Clock device into allowed devices

2020-02-19 Thread Daniel Henrique Barboza
On 2/16/20 2:11 PM, Julio Faracco wrote: This commit share host Real Time Clock device (rtc) into LXC containers to support hardware clock. This should be available setting up a `rtc` timer under clock section. Since this option is not emulated, it should be available only for `localtime` cloc

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

2020-02-19 Thread Max Reitz
On 31.01.20 18:11, Eric Blake wrote: > ping Do you want further review or is Ján’s sufficient for you? Also, I wonder whether it would make a good GSoC/Outreachy/... project to add partition reading support to the raw block driver, or whether that’s a bad idea. O:-) Max signature.asc Descript

Re: [libvirt PATCH 09/10] conf: extra validation for

2020-02-19 Thread Ján Tomko
On Tue, Feb 18, 2020 at 10:08:42PM -0500, Laine Stump wrote: On 2/18/20 12:52 PM, Ján Tomko wrote: On Sun, Feb 16, 2020 at 11:22:58PM -0500, Laine Stump wrote: During the hypervisor-agnostic validation of network devices, verify that the interface type is either "network" or "bridge", and that

Re: [PATCH] qemuDomainGetStatsIOThread: Don't leak array with 0 iothreads

2020-02-19 Thread Ján Tomko
On Wed, Feb 19, 2020 at 09:26:23AM +0100, Peter Krempa wrote: qemuMonitorGetIOThreads returns a NULL terminated list even when 0 NULL-terminated iothreads are present. The caller didn't perform cleanup if there were 0 iothreads leaking the array. https://bugzilla.redhat.com/show_bug.cgi?id=1

[PATCH] qemuDomainGetStatsIOThread: Don't leak array with 0 iothreads

2020-02-19 Thread Peter Krempa
qemuMonitorGetIOThreads returns a NULL terminated list even when 0 iothreads are present. The caller didn't perform cleanup if there were 0 iothreads leaking the array. https://bugzilla.redhat.com/show_bug.cgi?id=1804548 Reported-by: Jing Yan Signed-off-by: Peter Krempa --- src/qemu/qemu_drive