Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-28 Thread Bjoern Walk
Michal Privoznik [2019-11-26, 09:48AM +0100]: > That's exactly what I find horrible. Just consider the following example: > > print(f'a={f(x,n):d}, b={g(x,n):d}') > > IMO the following is more readable: > > print("a=%d, b=%d" % (f(x,n), g(x,n))) First of all, the format specifiers (i.e, ":

Re: [libvirt] RFC: stop clearing QEMU emulator capabilities

2019-11-28 Thread Laine Stump
On 11/28/19 8:16 AM, Richard W.M. Jones wrote: On Thu, Nov 28, 2019 at 01:04:00PM +, Daniel P. Berrangé wrote: We have an RFE from libguestfs to provide a way to run as root *with* capabilities. I looked integrating this into the DAC security manager as a new flag in the security label, but

[libvirt] Availability of libvirt 5.1.0 Release Candidate 2

2019-11-28 Thread Daniel Veillard
I just tagged RC2 in git and pushed signed tarball and source rpm to the usual place: http://libvirt.org/sources/ Looks fine in my minimal testing, but please it a try especially on other platforms and systems. I will likely push the final version on Monday, thanks, Daniel -- D

[libvirt] [PATCH] storage: backend_disk: Implement the deletePool function

2019-11-28 Thread Erik Skultety
This is a very simple and straightforward implementation of the opposite what buildPool does for the disk backend. The background for this change comes from an existing test case in TCK which does use the delete method for a pool of type disk, but it truly could not have ever worked since the imple

Re: [libvirt] [PATCH] qemu: make 'xz' image compression viable by using -3

2019-11-28 Thread Michal Privoznik
On 11/28/19 1:27 PM, Daniel P. Berrangé wrote: For managed save we can choose between various compression methods. I randomly tested the 'xz' program on a 8 GB guest and was surprised to have to wait > 50 minutes for it to finish compressing, with 'xz' burning 100% cpu for the entire time. Despit

Re: [libvirt] [PATCH for 5.10.0] nss: Don't fail on empty files

2019-11-28 Thread Daniel P . Berrangé
On Thu, Nov 28, 2019 at 02:40:55PM +0100, Michal Privoznik wrote: > Before we rewrote nss plugin so that it doesn't use libvirt's > internal functions it used virLeaseReadCustomLeaseFile() to parse > .status files. After the rewrite it's using read() + yajl_parse() > + yajl_complete_parse(). There'

Re: [libvirt] [PATCH for 5.10.0] nss: Don't fail on empty files

2019-11-28 Thread Michal Privoznik
On 11/28/19 2:40 PM, Michal Privoznik wrote: Before we rewrote nss plugin so that it doesn't use libvirt's internal functions it used virLeaseReadCustomLeaseFile() to parse .status files. After the rewrite it's using read() + yajl_parse() + yajl_complete_parse(). There's one catch though, virLeas

[libvirt] [PATCH for 5.10.0] nss: Don't fail on empty files

2019-11-28 Thread Michal Privoznik
Before we rewrote nss plugin so that it doesn't use libvirt's internal functions it used virLeaseReadCustomLeaseFile() to parse .status files. After the rewrite it's using read() + yajl_parse() + yajl_complete_parse(). There's one catch though, virLeaseReadCustomLeaseFile() skipped over empty files

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-28 Thread Ján Tomko
On Thu, Nov 28, 2019 at 11:43:01AM +0100, Martin Kletzander wrote: The advantage of "".format() is that you cannot make one mistake that can happen with the currently used version and that is that sometimes you might need to make sure the variable is in a tuple, i.e. difference between `params` a

Re: [libvirt] RFC: stop clearing QEMU emulator capabilities

2019-11-28 Thread Richard W.M. Jones
On Thu, Nov 28, 2019 at 01:04:00PM +, Daniel P. Berrangé wrote: > We have an RFE from libguestfs to provide a way to run as root > *with* capabilities. I looked integrating this into the DAC security > manager as a new flag in the security label, but then I started > thinking about the whole id

[libvirt] RFC: stop clearing QEMU emulator capabilities

2019-11-28 Thread Daniel P . Berrangé
We have an RFE from libguestfs to provide a way to run as root *with* capabilities. I looked integrating this into the DAC security manager as a new flag in the security label, but then I started thinking about the whole idea of clearing capabilities https://bugzilla.redhat.com/show_bug.cgi?id=1

Re: [libvirt] [PATCH] qemu: Fix migration without parameters

2019-11-28 Thread Erik Skultety
On Thu, Nov 28, 2019 at 11:24:04AM +0100, Jiri Denemark wrote: > The virTypedParamsFilter function doesn't mind params == NULL if nparams > is zero. And there's no need to check for params == NULL && nparams > 0 > because this is checked higher in the stack. > > In fact all the virCheckNonNull* che

[libvirt] [PATCH] qemu: make 'xz' image compression viable by using -3

2019-11-28 Thread Daniel P . Berrangé
For managed save we can choose between various compression methods. I randomly tested the 'xz' program on a 8 GB guest and was surprised to have to wait > 50 minutes for it to finish compressing, with 'xz' burning 100% cpu for the entire time. Despite the impressive compression, this is completely

Re: [libvirt] [PATCH] remote_daemon_stream: Hold an extra reference to stream in daemonStreamFilter

2019-11-28 Thread Lance Liu
Michal Privoznik 下午5:58 (1小时前) 发送至 我、 libvir-list On 11/28/19 4:09 AM, Lance Liu wrote: > Hi, Michal: > I think the daemonFreeClientStream(NULL, stream); in your patch > should line above virMutexUnlock(&stream->priv->lock), or else there > is issue WAW. I'm sorry, I don't know what WAW is

Re: [libvirt] [PATCH] qemu: Fix migration without parameters

2019-11-28 Thread Daniel Henrique Barboza
On 11/28/19 7:24 AM, Jiri Denemark wrote: The virTypedParamsFilter function doesn't mind params == NULL if nparams is zero. And there's no need to check for params == NULL && nparams > 0 because this is checked higher in the stack. In fact all the virCheckNonNull* checks in virTypedParamsFilt

Re: [libvirt] [PATCH 1/1] qemu: sync blockjob finishing in qemuDomainGetBlockJobInfo

2019-11-28 Thread Nikolay Shirokovskiy
On 28.11.2019 14:11, Peter Krempa wrote: > On Thu, Nov 28, 2019 at 10:51:56 +, Nikolay Shirokovskiy wrote: >> >> >> On 28.11.2019 12:05, Peter Krempa wrote: >>> On Thu, Nov 28, 2019 at 07:29:08 +, Nikolay Shirokovskiy wrote: On 27.11.2019 17:56, Peter Krempa wrote: > O

Re: [libvirt] [PATCH 1/1] qemu: sync blockjob finishing in qemuDomainGetBlockJobInfo

2019-11-28 Thread Peter Krempa
On Thu, Nov 28, 2019 at 10:51:56 +, Nikolay Shirokovskiy wrote: > > > On 28.11.2019 12:05, Peter Krempa wrote: > > On Thu, Nov 28, 2019 at 07:29:08 +, Nikolay Shirokovskiy wrote: > >> > >> > >> On 27.11.2019 17:56, Peter Krempa wrote: > >>> On Wed, Nov 27, 2019 at 17:19:18 +0300, Nikolay

Re: [libvirt] [PATCH 1/1] qemu: sync blockjob finishing in qemuDomainGetBlockJobInfo

2019-11-28 Thread Nikolay Shirokovskiy
On 28.11.2019 12:05, Peter Krempa wrote: > On Thu, Nov 28, 2019 at 07:29:08 +, Nikolay Shirokovskiy wrote: >> >> >> On 27.11.2019 17:56, Peter Krempa wrote: >>> On Wed, Nov 27, 2019 at 17:19:18 +0300, Nikolay Shirokovskiy wrote: Due to race qemuDomainGetBlockJobInfo can return there is

Re: [libvirt] [go PATCH 2/2] Add support for virDomainAgentSetResponseTimeout API

2019-11-28 Thread Pavel Hrdina
On Thu, Nov 28, 2019 at 10:42:06AM +, Daniel P. Berrangé wrote: > On Thu, Nov 28, 2019 at 11:30:32AM +0100, Pavel Hrdina wrote: > > Signed-off-by: Pavel Hrdina > > --- > > domain.go | 23 +++ > > domain_compat.h | 14 ++ > > domain_wrapper.go | 17 +++

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-28 Thread Martin Kletzander
On Tue, Nov 26, 2019 at 10:29:14AM +, Daniel P. Berrangé wrote: On Tue, Nov 26, 2019 at 11:25:28AM +0100, Pavel Hrdina wrote: On Tue, Nov 26, 2019 at 10:01:11AM +, Daniel P. Berrangé wrote: > On Tue, Nov 26, 2019 at 09:48:31AM +0100, Michal Privoznik wrote: > > On 11/26/19 9:24 AM, Erik

Re: [libvirt] [go PATCH 2/2] Add support for virDomainAgentSetResponseTimeout API

2019-11-28 Thread Daniel P . Berrangé
On Thu, Nov 28, 2019 at 11:30:32AM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > domain.go | 23 +++ > domain_compat.h | 14 ++ > domain_wrapper.go | 17 + > domain_wrapper.h | 6 ++ > 4 files changed, 60 insertion

Re: [libvirt] [go PATCH 1/2] Add VIR_FROM_BPF error constant

2019-11-28 Thread Daniel P . Berrangé
On Thu, Nov 28, 2019 at 11:30:31AM +0100, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > error.go | 3 +++ > error_compat.h | 6 ++ > 2 files changed, 9 insertions(+) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |: https://berrange.com -o-https://www.flick

[libvirt] [go PATCH 2/2] Add support for virDomainAgentSetResponseTimeout API

2019-11-28 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- domain.go | 23 +++ domain_compat.h | 14 ++ domain_wrapper.go | 17 + domain_wrapper.h | 6 ++ 4 files changed, 60 insertions(+) diff --git a/domain.go b/domain.go index 360659d..7901d8d 100644 --- a

[libvirt] [go PATCH 1/2] Add VIR_FROM_BPF error constant

2019-11-28 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- error.go | 3 +++ error_compat.h | 6 ++ 2 files changed, 9 insertions(+) diff --git a/error.go b/error.go index d6b02e0..4b057fb 100644 --- a/error.go +++ b/error.go @@ -596,6 +596,9 @@ const ( // Error from TPM FROM_TPM = ErrorDomain(

[libvirt] [go PATCH 0/2] add missing API and constants

2019-11-28 Thread Pavel Hrdina
Pavel Hrdina (2): Add VIR_FROM_BPF error constant Add support for virDomainAgentSetResponseTimeout API domain.go | 23 +++ domain_compat.h | 14 ++ domain_wrapper.go | 17 + domain_wrapper.h | 6 ++ error.go | 3 +++ er

[libvirt] [PATCH] qemu: Fix migration without parameters

2019-11-28 Thread Jiri Denemark
The virTypedParamsFilter function doesn't mind params == NULL if nparams is zero. And there's no need to check for params == NULL && nparams > 0 because this is checked higher in the stack. In fact all the virCheckNonNull* checks in virTypedParamsFilter are useless. https://bugzilla.redhat.com/sh

Re: [libvirt] [PATCH] tests: improve build time for qemuxml2argvtest

2019-11-28 Thread Daniel P . Berrangé
On Thu, Nov 28, 2019 at 11:06:12AM +0100, Michal Privoznik wrote: > On 11/27/19 8:38 PM, Ján Tomko wrote: > > On Wed, Nov 27, 2019 at 04:22:42PM +, Daniel P. Berrangé wrote: > > > On Fedora 31 with GCC 9.2.1, compiling qemuxml2argvtest takes > > > about 36 seconds since > > > > > >  commit 30c

Re: [libvirt] [PATCH] selinux: Drop needless getfilecon()-s

2019-11-28 Thread Daniel P . Berrangé
On Thu, Nov 28, 2019 at 09:49:46AM +0100, Michal Privoznik wrote: > When SELinux support was first introduced the libselinux library > wasn't that advanced and setfilecon_raw() or fsetfilecon_raw() > could fail even when the target context was set. Looking at the > current code [1][2] this is no lo

Re: [libvirt] Change virQEMUDriverConfig defaults?

2019-11-28 Thread Daniel P . Berrangé
On Thu, Nov 28, 2019 at 09:34:36AM +0100, Michal Privoznik wrote: > Dear list, > > lately I was confronted with the way how KubeVirt uses libvirt. They run it > inside a docker container with UID mapping and some capabilities dropped. > See [1] for more info. Problem is that because of the way we

Re: [libvirt] [PATCH] tests: improve build time for qemuxml2argvtest

2019-11-28 Thread Michal Privoznik
On 11/27/19 8:38 PM, Ján Tomko wrote: On Wed, Nov 27, 2019 at 04:22:42PM +, Daniel P. Berrangé wrote: On Fedora 31 with GCC 9.2.1, compiling qemuxml2argvtest takes about 36 seconds since  commit 30c6d99209cd36bba8e14795622f658827698522  Author: Jiri Denemark  Date:   Thu Oct 24 17:51:42 20

Re: [libvirt] [PATCH for 5.10.0] docs: don't run xmllint when generating API HTML files

2019-11-28 Thread Michal Privoznik
On 11/27/19 3:06 PM, Daniel P. Berrangé wrote: After generating the API HTML files we run xmllint in docs/html/*.html to validate the correctness. Since commit 0aa8536f14b08dfb5188d0bb3aba532680500d38 Author: Daniel P. Berrangé Date: Wed Nov 20 14:49:26 2019 + docs: generat

Re: [libvirt] [PATCH] remote_daemon_stream: Hold an extra reference to stream in daemonStreamFilter

2019-11-28 Thread Michal Privoznik
On 11/28/19 4:09 AM, Lance Liu wrote: Hi, Michal:     I think  the daemonFreeClientStream(NULL, stream);  in your patch should line above  virMutexUnlock(&stream->priv->lock), or else there is issue WAW. I'm sorry, I don't know what WAW is. That is two threads may sub stream-> Lance Liu m

Re: [libvirt] [python PATCH] generator.py: add mapping for VIR_DOMAIN_QEMU_AGENT_COMMAND_*

2019-11-28 Thread Peter Krempa
On Thu, Nov 28, 2019 at 10:50:38 +0100, Pavel Hrdina wrote: > On Thu, Nov 28, 2019 at 10:44:31AM +0100, Peter Krempa wrote: > > On Thu, Nov 28, 2019 at 09:38:18 +0100, Pavel Hrdina wrote: > > > Libvirt commit <95f5ac9ae52455e9da47afc95fa31c9456ac27ae> changed the > > > VIR_DOMAIN_QEMU_AGENT_COMMAND

Re: [libvirt] [python PATCH] generator.py: add mapping for VIR_DOMAIN_QEMU_AGENT_COMMAND_*

2019-11-28 Thread Pavel Hrdina
On Thu, Nov 28, 2019 at 10:44:31AM +0100, Peter Krempa wrote: > On Thu, Nov 28, 2019 at 09:38:18 +0100, Pavel Hrdina wrote: > > Libvirt commit <95f5ac9ae52455e9da47afc95fa31c9456ac27ae> changed the > > VIR_DOMAIN_QEMU_AGENT_COMMAND_* enum values to use different enum values > > instead of direct nu

Re: [libvirt] [PATCH] Fix bug libvirt daemon segfault when new force console vm session break down existed console session. When force console vm command arrived, libvirtd will break down existed cons

2019-11-28 Thread Lance Liu
Ok, thanks. Michal Privoznik 于2019年11月28日周四 下午5:21写道: > On 11/28/19 4:03 AM, Lance Liu wrote: > > Ok, I'll check it out. > > > > Look like your patch is still not in master branch。May you commit it? > > I'll check out it and test for force console case > > Unfortunately, it did not receive any A

Re: [libvirt] [python PATCH] generator.py: add mapping for VIR_DOMAIN_QEMU_AGENT_COMMAND_*

2019-11-28 Thread Peter Krempa
On Thu, Nov 28, 2019 at 09:38:18 +0100, Pavel Hrdina wrote: > Libvirt commit <95f5ac9ae52455e9da47afc95fa31c9456ac27ae> changed the > VIR_DOMAIN_QEMU_AGENT_COMMAND_* enum values to use different enum values > instead of direct numbers. We need to translate it back. > > Traceback (most recent call

Re: [libvirt] [PATCH] Fix bug libvirt daemon segfault when new force console vm session break down existed console session. When force console vm command arrived, libvirtd will break down existed cons

2019-11-28 Thread Michal Privoznik
On 11/28/19 4:03 AM, Lance Liu wrote: Ok, I'll check it out. Look like your patch is still not in master branch。May you commit it? I'll check out it and test for force console case Unfortunately, it did not receive any ACK from a contributor with commit rights (which is required for any patc

Re: [libvirt] [PATCH 1/1] qemu: sync blockjob finishing in qemuDomainGetBlockJobInfo

2019-11-28 Thread Peter Krempa
On Thu, Nov 28, 2019 at 07:29:08 +, Nikolay Shirokovskiy wrote: > > > On 27.11.2019 17:56, Peter Krempa wrote: > > On Wed, Nov 27, 2019 at 17:19:18 +0300, Nikolay Shirokovskiy wrote: > >> Due to race qemuDomainGetBlockJobInfo can return there is > >> no block job for disk but later call to sp

[libvirt] [PATCH] selinux: Drop needless getfilecon()-s

2019-11-28 Thread Michal Privoznik
When SELinux support was first introduced the libselinux library wasn't that advanced and setfilecon_raw() or fsetfilecon_raw() could fail even when the target context was set. Looking at the current code [1][2] this is no longer the case. We can drop our workarounds. 1: https://github.com/SELinu

[libvirt] [python PATCH] generator.py: add mapping for VIR_DOMAIN_QEMU_AGENT_COMMAND_*

2019-11-28 Thread Pavel Hrdina
Libvirt commit <95f5ac9ae52455e9da47afc95fa31c9456ac27ae> changed the VIR_DOMAIN_QEMU_AGENT_COMMAND_* enum values to use different enum values instead of direct numbers. We need to translate it back. Traceback (most recent call last): File "generator.py", line 2143, in qemuBuildWrappers(sy

[libvirt] Change virQEMUDriverConfig defaults?

2019-11-28 Thread Michal Privoznik
Dear list, lately I was confronted with the way how KubeVirt uses libvirt. They run it inside a docker container with UID mapping and some capabilities dropped. See [1] for more info. Problem is that because of the way we initialize our defaults they had to disable some features. Specifically,