[PATCH v2 4/7] qemu: check iotune params same for all disk in group

2020-01-28 Thread Michal Privoznik
From: Nikolay Shirokovskiy Currently it is possible to start a domain which have disks in same iotune group and at the same time having different iotune params. Both params set are passed to qemu in command line and the one that is passed later down command line is get actually set. Let's

[PATCH v2 5/7] qemu: fix using defaults when setting persistent iotune params

2020-01-28 Thread Michal Privoznik
From: Nikolay Shirokovskiy virDomainSetBlockIoTune not simply sets the iotune params given in API but use current settings for all the omitted params. Unfortunately it uses current settings for active config when setting inactive params. Let's fix it. Signed-off-by: Nikolay Shirokovskiy

[PATCH v2 1/7] qemu: Move qemuDiskConfigBlkdeviotuneHas* to conf

2020-01-28 Thread Michal Privoznik
From: Nikolay Shirokovskiy And introduce virDomainBlockIoTuneInfoHasAny. Signed-off-by: Nikolay Shirokovskiy Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 46 + src/conf/domain_conf.h | 12 ++ src/libvirt_private.syms | 4

[PATCH v2 3/7] qemu: propagate iotune settings to all disks in the group

2020-01-28 Thread Michal Privoznik
From: Nikolay Shirokovskiy Currently upon successfull call to qemu's implementation of virDomainSetBlockIoTune iotune settings are changed only for the disk given in API if the disk is in iotune group while we need to change the settings for all disks in the group. Signed-off-by: Nikolay

[PATCH v2 6/7] qemu: get defaults from iotune group we move disk into

2020-01-28 Thread Michal Privoznik
From: Nikolay Shirokovskiy For example if disk is not in the group and we want to move it there then it makes sense to specify only the group name in API call. Currently the destination group iotune settings will be overwritten with the disk settings which I would say is not what one would

[PATCH v2 7/7] qemu: when leaving iotune group update xml properly

2020-01-28 Thread Michal Privoznik
From: Nikolay Shirokovskiy Currently when disk is removed from iotune group (by setting all tunables to zero) group name is leaved in config. Let's fix it. Given iotune defaults are taken from the destination group setting tunables to zero may require different set of zero settings in API call.

[PATCH v2 2/7] conf: expand iotune params if only group name is given

2020-01-28 Thread Michal Privoznik
From: Nikolay Shirokovskiy Currently, if only iotune group name is given for some disk and no any params then later start of domain will fail. I guess it will be convenient to allow such configuration if there is another disk in the same iotune group with iotune params set. The meaning is that

[PATCH v2 0/7] qemu: block iotune group fixes/improvements

2020-01-28 Thread Michal Privoznik
This series was originally posted by Nikolay here: https://www.redhat.com/archives/libvir-list/2020-January/msg00283.html I've delayed review too much. Sorry for that. To make it up to you, I've fixed some patches and resending the series. Basically, I want to know whether you agree with my

Re: [libvirt] [PATCH 0/7] qemu: block iotune group fixes/improvements

2020-01-28 Thread Nikolay Shirokovskiy
On 29.01.2020 10:14, Michal Privoznik wrote: > On 1/8/20 7:49 AM, Nikolay Shirokovskiy wrote: >> Currently iotune group impl has several bugs/oddities this patchset >> aims to fix. Also patches (2) and (3) add/change functionality so >> that group iotune became easier/saner to use. >> >> TODO:

Re: [libvirt] [PATCH 0/7] qemu: block iotune group fixes/improvements

2020-01-28 Thread Michal Privoznik
On 1/8/20 7:49 AM, Nikolay Shirokovskiy wrote: Currently iotune group impl has several bugs/oddities this patchset aims to fix. Also patches (2) and (3) add/change functionality so that group iotune became easier/saner to use. TODO: add docs to API/virsh in respect to using iotune group

Re: [libvirt PATCH 09/10] Add a space before ending a comment

2020-01-28 Thread Peter Krempa
On Tue, Jan 28, 2020 at 13:22:26 +0100, Ján Tomko wrote: > On Tue, Jan 28, 2020 at 12:13:14PM +0100, Peter Krempa wrote: > > On Tue, Jan 28, 2020 at 11:31:25 +0100, Ján Tomko wrote: > > > > It also adds space after the start of the comment in many cases. > > > > > Signed-off-by: Ján Tomko > > >

[PATCH v3 1/4] lxc: refactor lxcNetworkParseData pointers to use new structures

2020-01-28 Thread Julio Faracco
Struct lxcNetworkParseData is being used as a single pointer which iterates through LXC config lines. It means that it will be applied as a network each time that a new type appears. After, the same struct is used to populate a new network interface. This commit changes this logic to multiple

[PATCH v3 2/4] lxc: add LXC version 3 network parser

2020-01-28 Thread Julio Faracco
LXC version 3 or higher introduced indexes for network interfaces. Libvirt should be able to parse entries like `lxc.net.2.KEY`. This commit adds functions to parse this type of field. That's why array structures are so important this time. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c

[PATCH v3 3/4] lxc: remove domain definition from lxc network struct

2020-01-28 Thread Julio Faracco
Domain definition is useless now inside network structure. This pointer was required because new network definition was being added each time that a new network type appeared. So, this should be processed into old function `lxcNetworkParseDataType()`. Now, as it was moved to an array, it can be

[PATCH v3 4/4] tests: update LXC config dataset to support V3 indexes

2020-01-28 Thread Julio Faracco
LXC version 3 config files are still using network old style definition. So, as LXC supports it now, they can be converted to use this new definition. Signed-off-by: Julio Faracco --- .../lxcconf2xml-ethernet-v3.config | 16 .../lxcconf2xml-fstab-v3.config

[PATCH v3 0/4] lxc: Add suport to network indexes for LXC 3.X

2020-01-28 Thread Julio Faracco
This series implement support for network syntax settings for LXC 3.X. Now, indexes are part of the settings to define network interfaces. Each interface has its own index. The old style uses 'type' tag to differentiate each interface and with this, it could use one single structure. Now, network

Re: [libvirt PATCH v2 32/56] bootstrap: remove 18 more gnulib modules

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:13PM +, Daniel P. Berrangé wrote: > * chown: use is conditionally compiled > * configmake: functionality imported to Makefile.am > * getaddrinfo: we have no portability problems > with Windows impl > * getpass: simplified impl is imported > * mgetgroups:

Re: [libvirt PATCH v2 31/56] src: conditionalize EAI_ADDRFAMILY

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:12PM +, Daniel P. Berrangé wrote: > The EAI_ADDRFAMILY constant has been removed from FreeBSD > headers, supposedly because it is deprecated by new RFC > drafts. > > Previously GNULIB was providing a replacement because > MinGW lacked it too. The replacement

Re: [libvirt PATCH v2 29/56] src: convert all code to use virsocket.h

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:10PM +, Daniel P. Berrangé wrote: > There are a large number of different header files that > are related to the sockets APIs. The virsocket.h header > includes all of the relevant headers for Windows and UNIX > in one convenient place. If virsocketaddr.h is

Re: [libvirt PATCH v2 30/56] tests: conditionalize use of SIGPIPE

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:11PM +, Daniel P. Berrangé wrote: > SIGPIPE is not available on the Windows platform. > > Signed-off-by: Daniel P. Berrangé > --- > tests/virauthconfigtest.c | 2 ++ > tests/virkeyfiletest.c| 2 ++ > tests/virlockspacetest.c | 2 ++ >

Re: [libvirt PATCH v2 28/56] src: conditionalize use of chown & stat constants

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:09PM +, Daniel P. Berrangé wrote: > chown and some stat constants are not available on > the Windows platform. > > Signed-off-by: Daniel P. Berrangé > --- > src/security/security_dac.c | 4 > src/storage/storage_util.c | 3 +++ > src/util/virfile.c

Re: [libvirt PATCH v2 27/56] src: conditionalize use of O_BINARY

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:08PM +, Daniel P. Berrangé wrote: > The O_BINARY flag is not defined on all platforms so we must > conditionalize its use once we remove GNULIB. > > Signed-off-by: Daniel P. Berrangé > --- > src/util/virfdstream.c | 5 - > 1 file changed, 4 insertions(+), 1

Re: [libvirt PATCH v2 26/56] src: conditionalize use of O_DIRECT

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:07PM +, Daniel P. Berrangé wrote: > The O_DIRECT flag is not available on all platforms, so we > must introduce a compat define the same way gnulib does. > > Signed-off-by: Daniel P. Berrangé > --- > src/util/iohelper.c | 4 > src/util/virfile.c | 4

[PATCH v2 3/4] lxc: remove domain definition from lxc network struct

2020-01-28 Thread Julio Faracco
Domain definition is useless now inside network structure. This pointer was required because new network definition was being added each time that a new network type appeared. So, this should be processed into old function `lxcNetworkParseDataType()`. Now, as it was moved to an array, it can be

[PATCH v2 4/4] tests: update LXC config dataset to support V3 indexes

2020-01-28 Thread Julio Faracco
LXC version 3 config files are still using network old style definition. So, as LXC supports it now, they can be converted to use this new definition. Signed-off-by: Julio Faracco --- .../lxcconf2xml-ethernet-v3.config | 16 .../lxcconf2xml-fstab-v3.config

Re: [libvirt PATCH v2 25/56] src: conditionalize use of F_DUPFD_CLOEXEC

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:06PM +, Daniel P. Berrangé wrote: > The F_DUPFD_CLOEXEC functionality is not available on > some platformms. We must thus explicitly call the > virSetCloexec function once we remove GNULIB's equiv > fix for this. > > Signed-off-by: Daniel P. Berrangé > --- >

[PATCH v2 1/4] lxc: refactor lxcNetworkParseData pointers to use new structures

2020-01-28 Thread Julio Faracco
Struct lxcNetworkParseData is being used as a single pointer which iterates through LXC config lines. It means that it will be applied as a network each time that a new type appears. After, the same struct is used to populate a new network interface. This commit changes this logic to multiple

[PATCH v2 0/4] lxc: Add suport to network indexes for LXC 3.X

2020-01-28 Thread Julio Faracco
This series implement support for network syntax settings for LXC 3.X. Now, indexes are part of the settings to define network interfaces. Each interface has its own index. The old style uses 'type' tag to differentiate each interface and with this, it could use one single structure. Now, network

[PATCH v2 2/4] lxc: add LXC version 3 network parser

2020-01-28 Thread Julio Faracco
LXC version 3 or higher introduced indexes for network interfaces. Libvirt should be able to parse entries like `lxc.net.2.KEY`. This commit adds functions to parse this type of field. That's why array structures are so important this time. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c

Re: [libvirt PATCH v2 24/56] src: ensure O_CLOEXEC is defined on Windows

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:05PM +, Daniel P. Berrangé wrote: > Windows uses _O_NOINHERIT as the name for its O_CLOEXEC > equivalent. Define O_CLOEXEC to match this to fix > portability when we remove GNULIB. > > Signed-off-by: Daniel P. Berrangé > --- > src/internal.h | 6 ++ > 1

Re: [libvirt PATCH v2 19/56] src: conditionalize use of net/if.h

2020-01-28 Thread Daniel P . Berrangé
On Tue, Jan 28, 2020 at 05:42:47PM +0100, Pavel Hrdina wrote: > On Tue, Jan 28, 2020 at 01:11:00PM +, Daniel P. Berrangé wrote: > > The net/if.h is not portable so we must check for its > > existance and avoid using it when missing. Some use > > of net/if.h was redundant and could be removed.

Re: [libvirt PATCH v2 23/56] src: stop using O_DIRECTORY in resctrl

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:04PM +, Daniel P. Berrangé wrote: > The O_DIRECTORY flag causes open() to return an error > if the filename is a directory. There's no obvious > reason why resctrl needs to use this, while the rest of > libvirt code does not. Removing it avoids build issues > on

Re: [libvirt PATCH v2 22/56] configure: request system specific extensions

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:03PM +, Daniel P. Berrangé wrote: > The AC_USE_SYSTEM_EXTENSIONS macro causes things like > "USE_GNU" to be defined, which enables access to OS > specific extensions to POSIX. We currently got this > indirectly via GNULIB's 'extensions' module which is > a

Re: [libvirt PATCH v2 21/56] src: conditionalize use of S_ISSOCK macro

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:02PM +, Daniel P. Berrangé wrote: > The S_ISSOCK macro is not available on Windows platforms. > > Signed-off-by: Daniel P. Berrangé > --- > src/libvirt-domain.c| 2 ++ > src/security/security_manager.c | 2 ++ > 2 files changed, 4 insertions(+)

Re: [libvirt PATCH v2 20/56] configure: add check for sys/ioctl.h

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:01PM +, Daniel P. Berrangé wrote: > We currently get the sys/ioctl.h check indirectly > via GNULIB, but this will soon stop happening. > > Signed-off-by: Daniel P. Berrangé > --- > configure.ac | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Pavel Hrdina

Re: [libvirt PATCH v2 19/56] src: conditionalize use of net/if.h

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:11:00PM +, Daniel P. Berrangé wrote: > The net/if.h is not portable so we must check for its > existance and avoid using it when missing. Some use > of net/if.h was redundant and could be removed. > > Signed-off-by: Daniel P. Berrangé > --- >

Re: [libvirt PATCH v2 18/56] util: conditionalize virProcess APIs on Windows

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:10:59PM +, Daniel P. Berrangé wrote: > Many of the virProcess APIs are relying on GNULIB providing > POSIX API stubs. Even with these stubs the APIs don't do > anything useful once compiled. We can thus conditionalize > the code so that we don't compile anything at

Re: [libvirt PATCH v2 17/56] src: remove all traces of Cygwin support

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:10:58PM +, Daniel P. Berrangé wrote: > Cygwin is not a supported build platform for libvirt and > has no testing coverage in our CI systems. Stop pretending > the code is usable and remove it so there is less to port > to Meson. > > Signed-off-by: Daniel P. Berrangé

Re: [libvirt PATCH v2 16/56] util: conditionalize more of virCommand on WIN32

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:10:57PM +, Daniel P. Berrangé wrote: > A large part of the virCommand code is still built on > WIN32, despite the fact that the core fork() & execve() > functions are not available. So despite succesfully > building most of the code, at runtime the APIs are > none

Re: [PATCH 2/4] lxc: add LXC version 3 network parser

2020-01-28 Thread Julio Faracco
Op... You are right! Let me send a V2. Thanks to point it out, Daniel. -- Julio Cesar Faracco Em ter., 28 de jan. de 2020 às 11:44, Daniel P. Berrangé escreveu: > > On Mon, Jan 27, 2020 at 11:25:47AM -0300, Julio Faracco wrote: > > LXC version 3 or higher introduced indexes for network

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 10:39:21AM -0500, Laine Stump wrote: > and the QEMU backend implementation using virtio failover. > > Signed-off-by: Laine Stump > --- > docs/formatdomain.html.in | 100 ++ > docs/news.xml | 28 +++ > 2 files

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 10:39:20AM -0500, Laine Stump wrote: > 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

Re: [libvirt PATCH v2 4/6] qemu: allow migration with assigned PCI hostdev if is set

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 10:39:19AM -0500, Laine Stump wrote: > Normally a PCI hostdev can't be migrated, so > qemuMigrationSrcIsAllowedHostdev() won't permit it. In the case of a a > hostdev network interface that has set, > QEMU will automatically unplug the device prior to migration, and >

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 10:39:18AM -0500, Laine Stump wrote: > The QEMU driver uses the persistent='blah'/> 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

Re: [libvirt PATCH v2 15/56] m4: disable polkit build on Windows

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:10:56PM +, Daniel P. Berrangé wrote: > polkit is only useful on Linux systems > > Signed-off-by: Daniel P. Berrangé > --- > m4/virt-polkit.m4 | 4 > 1 file changed, 4 insertions(+) Reviewed-by: Pavel Hrdina signature.asc Description: PGP signature

Re: [libvirt PATCH v2 14/56] src: replace mkdir() with g_mkdir()

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:10:55PM +, Daniel P. Berrangé wrote: > g_mkdir() provides portability to Windows platforms. > > Signed-off-by: Daniel P. Berrangé > --- > src/util/virfile.c | 2 +- > tests/virlockspacetest.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-)

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

2020-01-28 Thread Daniel P . Berrangé
On Mon, Jan 27, 2020 at 02:16:43PM +0100, Peter Krempa wrote: > On Mon, Jan 27, 2020 at 09:59:01 +0100, Peter Krempa wrote: > > On Fri, Jan 24, 2020 at 10:41:00 -0600, Eric Blake wrote: > > > On 1/24/20 10:08 AM, Peter Krempa wrote: > > > > Discourage passing secrets as commandline arguments. > >

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 05:08:40PM +0100, Peter Krempa wrote: > 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|

Re: [libvirt PATCH v2 13/56] src: only import sys/uio.h when journald is built

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:10:54PM +, Daniel P. Berrangé wrote: > The sys/uio.h header is only needed when building logging > code with journald support enabled. Conditionally include > it so that we avoid break on platforms which lack this > header. > > Signed-off-by: Daniel P. Berrangé >

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 05:08:39PM +0100, Peter Krempa wrote: > 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

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 05:08:38PM +0100, Peter Krempa wrote: > 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

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 05:08:37PM +0100, Peter Krempa wrote: > 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

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 05:08:36PM +0100, Peter Krempa wrote: > 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 > --- >

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 05:08:34PM +0100, Peter Krempa wrote: > 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(-)

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 05:08:35PM +0100, Peter Krempa wrote: > 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(-)

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

2020-01-28 Thread Daniel P . Berrangé
On Fri, Jan 24, 2020 at 05:08:33PM +0100, Peter Krempa wrote: > 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. > >

Re: [PATCH 4/4] tests: update LXC config dataset to support V3 indexes

2020-01-28 Thread Daniel P . Berrangé
On Mon, Jan 27, 2020 at 11:25:49AM -0300, Julio Faracco wrote: > LXC version 3 config files are still using network old style definition. > So, as LXC supports it now, they can be converted to use this new > definition. > > Signed-off-by: Julio Faracco > --- > .../lxcconf2xml-ethernet-v3.config

Re: [PATCH 3/4] lxc: remove domain definition from lxc network struct

2020-01-28 Thread Daniel P . Berrangé
On Mon, Jan 27, 2020 at 11:25:48AM -0300, Julio Faracco wrote: > Domain definition is useless now inside network structure. This pointer > was required because new network definition was being added each time > that a new network type appeared. So, this should be processed into > old function

Re: [PATCH 2/4] lxc: add LXC version 3 network parser

2020-01-28 Thread Daniel P . Berrangé
On Mon, Jan 27, 2020 at 11:25:47AM -0300, Julio Faracco wrote: > LXC version 3 or higher introduced indexes for network interfaces. > Libvirt should be able to parse entries like `lxc.net.2.KEY`. This > commit adds functions to parse this type of field. That's why array > structures are so

Re: [PATCH 1/4] lxc: refactor lxcNetworkParseData pointers to use new structures

2020-01-28 Thread Daniel P . Berrangé
On Mon, Jan 27, 2020 at 11:25:45AM -0300, Julio Faracco wrote: > Struct lxcNetworkParseData is being used as a single pointer which > iterates through LXC config lines. It means that it will be applied as a > network each time that a new type appears. After, the same struct is > used to populate a

Re: [libvirt PATCH v2 12/56] rpc: conditionalize signal handling

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:10:53PM +, Daniel P. Berrangé wrote: > The Windows platform does not have the signal handling > support we need, so it must be disabled in several parts > of the codebase. > > Signed-off-by: Daniel P. Berrangé > --- > src/rpc/virnetclient.c | 33

Re: [RFC PATCH 12/16] tests: qemublock: Add synthetic snapshot+checkpoint test data

2020-01-28 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: Add a faked qemu output which would simulate scenario where libvirt would take a snapshot and checkpoint simultaneously. This is visible in libvirt-2-format node where bitmap 'c' appears, but bitmap 'b' which is active in the previous layer is not present.

Re: [libvirt] [PATCH 7/7] qemu: when leaving iotune group update xml properly

2020-01-28 Thread Daniel P . Berrangé
On Wed, Jan 08, 2020 at 09:49:31AM +0300, Nikolay Shirokovskiy wrote: > Currently when disk is removed from iotune group (by setting > all tunables to zero) group name is leaved in config. Let's fix > it. > > Given iotune defaults are taken from the destination group setting > tunables to zero

Re: [libvirt] [PATCH 6/7] qemu: get defaults from iotune group we move disk into

2020-01-28 Thread Daniel P . Berrangé
On Wed, Jan 08, 2020 at 09:49:30AM +0300, Nikolay Shirokovskiy wrote: > For example if disk is not in the group and we want to move it > there then it makes sense to specify only the group name in API call. > Currently the destination group iotune settings will be overwritten > with the disk

Re: [libvirt] [PATCH 5/7] qemu: propagate iotune settings to all disks in the group

2020-01-28 Thread Daniel P . Berrangé
On Wed, Jan 08, 2020 at 09:49:29AM +0300, Nikolay Shirokovskiy wrote: > Currently upon successfull call to qemu's implementation of > virDomainSetBlockIoTune iotune settings are changed only for the > disk given in API if the disk is in iotune group while we need > to change the settings for all

Re: [libvirt] [PATCH 4/7] qemu: fix using defaults when setting persistent iotune params

2020-01-28 Thread Daniel P . Berrangé
On Wed, Jan 08, 2020 at 09:49:28AM +0300, Nikolay Shirokovskiy wrote: > virDomainSetBlockIoTune not simply sets the iotune params given in API > but use current settings for all the omitted params. Unfortunately > it uses current settings for active config when setting inactive > params. Let's fix

Re: [libvirt] [PATCH 2/7] conf: expand iotune params if only group name is given

2020-01-28 Thread Daniel P . Berrangé
On Wed, Jan 08, 2020 at 09:49:26AM +0300, Nikolay Shirokovskiy wrote: > Currenly if only iotune group name is given for some disk and > no any params then later start of domain will fail. I guess it will > be convinient to allow such configuration if there is another convenient > disk in the

Re: [RFC PATCH 11/16] tests: qemublock: Add few more test cases for checkpoint deletion

2020-01-28 Thread Eric Blake
On 1/9/20 12:21 PM, Peter Krempa wrote: Add all intermediate steps and deletion of the current checkpoint on a flat (single-image) disk image. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 4 +++ .../checkpointdelete/basic-current-out.json | 29

Re: [libvirt] [PATCH 3/7] qemu: check iotune params same for all disk in group

2020-01-28 Thread Daniel P . Berrangé
On Wed, Jan 08, 2020 at 09:49:27AM +0300, Nikolay Shirokovskiy wrote: > Currently it is possible to start a domain which have disks > in same iotune group and at the same time having different iotune > params. Both params set are passed to qemu in command line and the one > that is passed later

Re: [libvirt] [PATCH 1/7] conf: refactor virDomainBlockIoTuneInfoHas*

2020-01-28 Thread Daniel P . Berrangé
On Wed, Jan 08, 2020 at 09:49:25AM +0300, Nikolay Shirokovskiy wrote: > And introduce virDomainBlockIoTuneInfoHasAny. > > Signed-off-by: Nikolay Shirokovskiy > --- > src/conf/domain_conf.c | 46 + > src/conf/domain_conf.h | 12 ++ >

Re: [libvirt PATCH v2 00/56] the gnulib saga: the season finale

2020-01-28 Thread Pavel Hrdina
On Tue, Jan 28, 2020 at 01:10:41PM +, Daniel P. Berrangé wrote: > This is a followup to > > v1: https://www.redhat.com/archives/libvir-list/2020-January/msg00900.html > > At the end of this series we have 100% eliminated use of GNULIB > from libvirt. > > The first 10 or so patches have

[libvirt PATCH v2 17/56] src: remove all traces of Cygwin support

2020-01-28 Thread Daniel P . Berrangé
Cygwin is not a supported build platform for libvirt and has no testing coverage in our CI systems. Stop pretending the code is usable and remove it so there is less to port to Meson. Signed-off-by: Daniel P. Berrangé --- configure.ac| 11 ++- m4/virt-compile-pie.m4

[libvirt PATCH v2 54/56] src: ensure use of g_printf / g_fprintf functions

2020-01-28 Thread Daniel P . Berrangé
The printf/fprintf function impls provided on Windows do not follow the normal syntax for format specifiers as the UNIX hosts. Currently we use GNULIB to provide a portability fix for this. GLib has also imported the GNULIB impl for this same reason, and thus we can rely on the g_printf /

[libvirt PATCH v2 45/56] configure: request 64-bit APIs on 32-bit platforms

2020-01-28 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index b1f75fa751..0964ab8d51 100644 --- a/configure.ac +++ b/configure.ac @@ -155,6 +155,9 @@ fi gl_EARLY gl_INIT +dnl get 64-int interfaces on 32-bit

[libvirt PATCH v2 32/56] bootstrap: remove 18 more gnulib modules

2020-01-28 Thread Daniel P . Berrangé
* chown: use is conditionally compiled * configmake: functionality imported to Makefile.am * getaddrinfo: we have no portability problems with Windows impl * getpass: simplified impl is imported * mgetgroups: getgrouplist is used directly * net_if: header includes are conditionalized * netdb:

[libvirt PATCH v2 55/56] src: remove virFilePrintf in favour of g_fprintf

2020-01-28 Thread Daniel P . Berrangé
The virFilePrintf function was a wrapper for fprintf() to provide Windows portability, since gnulib's fprintf() replacement was license restricted. This is no longer needed now we have the g_fprintf function available. Signed-off-by: Daniel P. Berrangé --- src/libvirt_private.syms | 1 -

[libvirt PATCH v2 56/56] gnulib: delete all gnulib integration

2020-01-28 Thread Daniel P . Berrangé
This deletes all trace of gnulib from libvirt. We still have the keycodemapdb submodule to deal with. The simple solution taken was to update it when running autogen.sh. Previously gnulib could auto-trigger refresh when running 'make' too. We could figure out a solution for this, but with the

[libvirt PATCH v2 52/56] src: add define of ENOMSG for MinGW

2020-01-28 Thread Daniel P . Berrangé
MinGW lacks ENOMSG until version 6.0.0 (Fedora 31). Signed-off-by: Daniel P. Berrangé --- src/internal.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/internal.h b/src/internal.h index 8c9322ec1e..96a43113cb 100644 --- a/src/internal.h +++ b/src/internal.h @@ -482,3 +482,9 @@

[libvirt PATCH v2 49/56] tools: conditionalize use of O_SYNC flag

2020-01-28 Thread Daniel P . Berrangé
The O_SYNC flag is not defined on Windows platforms. Signed-off-by: Daniel P. Berrangé --- tools/vsh.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/vsh.c b/tools/vsh.c index 2cf3dab054..cd473ef1d6 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2152,7 +2152,11

[libvirt PATCH v2 47/56] src: introduce a wrapper for the pipe2() system call

2020-01-28 Thread Daniel P . Berrangé
This hides the differences between Windows and UNIX, and adds standard error reporting. Signed-off-by: Daniel P. Berrangé --- configure.ac | 1 + src/libvirt_private.syms | 3 ++ src/util/virutil.c | 64 src/util/virutil.h | 34

[libvirt PATCH v2 46/56] examples: remove obsolete workaround for mingw

2020-01-28 Thread Daniel P . Berrangé
The build still succeeds with the workaround removed, so whatever was causing the problem no longer exists. Signed-off-by: Daniel P. Berrangé --- examples/c/domain/domtop.c | 15 --- examples/c/domain/suspend.c | 14 -- 2 files changed, 29 deletions(-) diff --git

[libvirt PATCH v2 51/56] src: assume sys/sysmacros.h always exists on Linux

2020-01-28 Thread Daniel P . Berrangé
All our supported Linux distros now have this header. It has never existed on FreeBSD / macOS / Mingw. Signed-off-by: Daniel P. Berrangé --- src/conf/domain_audit.c | 4 +--- src/lxc/lxc_controller.c | 4 +--- src/lxc/lxc_driver.c | 4 +--- src/qemu/qemu_domain.c | 4 +---

[libvirt PATCH v2 44/56] src: remove sys/wait.h from many files

2020-01-28 Thread Daniel P . Berrangé
Most code now uses the virProcess / virCommand APIs, so the need for sys/wait.h is quite limited. Removing this include removes the dependency on GNULIB providing a dummy sys/wait.h for Windows. Signed-off-by: Daniel P. Berrangé --- src/libvirt.c | 1 -

[libvirt PATCH v2 41/56] util: delete the poll() based event loop impl

2020-01-28 Thread Daniel P . Berrangé
It is no longer require since switching to the GLib based event loop impl. Signed-off-by: Daniel P. Berrangé --- po/POTFILES.in | 1 - src/libvirt_private.syms | 13 - src/util/Makefile.inc.am | 2 - src/util/vireventpoll.c | 772 ---

[libvirt PATCH v2 28/56] src: conditionalize use of chown & stat constants

2020-01-28 Thread Daniel P . Berrangé
chown and some stat constants are not available on the Windows platform. Signed-off-by: Daniel P. Berrangé --- src/security/security_dac.c | 4 src/storage/storage_util.c | 3 +++ src/util/virfile.c | 44 + 3 files changed, 47 insertions(+),

[libvirt PATCH v2 34/56] rpc: convert RPC client to use GMainLoop instead of poll

2020-01-28 Thread Daniel P . Berrangé
To eliminate the dependancy on GNULIB's poll impl, we need to change the RPC client code to use GMainLoop. We don't really want to use GIOChannel, but it provides the most convenient way to do socket event watches with Windows portability. The other alternative would be to use GSocket but that is

[libvirt PATCH v2 33/56] src: introduce helper API for creating GSource for socket

2020-01-28 Thread Daniel P . Berrangé
We need to be able to create event loop watches using the GSource API for sockets. GIOChannel is able todo this, but we don't want to use the GIOChannel APIs for reading/writing, and testing shows just using its GSource APIs is unreliable on Windows. This patch thus creates a standalone helper

[libvirt PATCH v2 43/56] util: conditionalize FD stream to exclude WIN32

2020-01-28 Thread Daniel P . Berrangé
Almost none of the virFDStream code will actually work on WIN32 builds, nor is it used except for in the virtualbox driver for screenshots. It is simpler to wrap it all in a '#ifndef WIN32'. Signed-off-by: Daniel P. Berrangé --- src/util/virfdstream.c | 122

[libvirt PATCH v2 48/56] src: convert code to use virPipe APIs

2020-01-28 Thread Daniel P . Berrangé
This addreses portability to Windows and standardizes error reporting. This fixes a number of places which failed to set O_CLOEXEC or failed to report errors. Signed-off-by: Daniel P. Berrangé --- src/libxl/libxl_migration.c | 6 ++ src/locking/lock_daemon.c | 2 +-

[libvirt PATCH v2 53/56] src: optionally include xlocale.h header

2020-01-28 Thread Daniel P . Berrangé
On macOS some definitions are in xlocale.h, instead of in locale.h. GNULIB hides this difference by making the latter include the former. Signed-off-by: Daniel P. Berrangé --- configure.ac | 1 + src/util/virgettext.c | 3 +++ src/util/virstring.c | 3 +++ tests/vshtabletest.c | 3

[libvirt PATCH v2 50/56] m4: add check for pthread library

2020-01-28 Thread Daniel P . Berrangé
When we get rid of GNULIB, we need to check for -lpthread support. Signed-off-by: Daniel P. Berrangé --- m4/virt-pthread.m4 | 26 ++ src/Makefile.am| 2 -- tests/Makefile.am | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git

[libvirt PATCH v2 42/56] src: conditionalize / remove use of poll.h

2020-01-28 Thread Daniel P . Berrangé
Remove imports of poll.h which are redundant, and conditionalize remaining usage that needs to compile on Windows platforms. Signed-off-by: Daniel P. Berrangé --- src/util/virpolkit.c | 2 +- src/util/virutil.c| 1 - tests/commandhelper.c | 2 +- 3 files changed, 2 insertions(+), 3

[libvirt PATCH v2 35/56] tests: convert eventtest to use public event APIs

2020-01-28 Thread Daniel P . Berrangé
The event test directly calls the internal poll event impl APIs. It does not rely on any specific details of the poll impl, so it is better to use the public APIs. Signed-off-by: Daniel P. Berrangé --- tests/eventtest.c | 68 +++ 1 file changed, 34

[libvirt PATCH v2 37/56] tests: refactor event test to not run lock step

2020-01-28 Thread Daniel P . Berrangé
The current event loop test suite has two threads running in lockstep. This was just about viable when we have full control over the internal details of the event loop impl. When we're using the GLib event loop though there are things going on that we don't know about, such as use of eventfd()

[libvirt PATCH v2 40/56] util: switch to use the GLib event loop impl

2020-01-28 Thread Daniel P . Berrangé
This sets the GLib event loop as the impl when calling virEventRegisterDefaultImpl(). This remains a private impl detail of libvirt, so applications must *NOT* assume that a call to virEventRegisterDefaultImpl() results in a GLib based event loop. They should continue to use the libvirt-glib API

[libvirt PATCH v2 29/56] src: convert all code to use virsocket.h

2020-01-28 Thread Daniel P . Berrangé
There are a large number of different header files that are related to the sockets APIs. The virsocket.h header includes all of the relevant headers for Windows and UNIX in one convenient place. If virsocketaddr.h is already included, then there's no need for virsocket.h Signed-off-by: Daniel P.

[libvirt PATCH v2 31/56] src: conditionalize EAI_ADDRFAMILY

2020-01-28 Thread Daniel P . Berrangé
The EAI_ADDRFAMILY constant has been removed from FreeBSD headers, supposedly because it is deprecated by new RFC drafts. Previously GNULIB was providing a replacement because MinGW lacked it too. The replacement provided for MinGW was thus being used on FreeBSD too, but with a completely bogus

[libvirt PATCH v2 36/56] tests: remove event loop from command test

2020-01-28 Thread Daniel P . Berrangé
This effectively reverts commit 39c77fe586baccd0a4a9862e8cf7c78ac7af3494 Author: Michal Prívozník Date: Wed Jan 16 11:58:00 2013 +0100 Introduce event loop to commandtest because nothing in the current test suite needs this event loop. Signed-off-by: Daniel P. Berrangé ---

[libvirt PATCH v2 38/56] tools: convert to use g_poll instead of poll

2020-01-28 Thread Daniel P . Berrangé
g_poll is portable to Windows platforms. Signed-off-by: Daniel P. Berrangé --- tools/virsh-domain.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 1a48695b4e..04ba44d4f2 100644 --- a/tools/virsh-domain.c +++

[libvirt PATCH v2 39/56] util: import an event loop impl based on GMainContext

2020-01-28 Thread Daniel P . Berrangé
The libvirt-glib project has provided a GMainContext based event loop impl for applications. This imports it and sets it up for use by libvirt as the primary event loop. This remains a private impl detail of libvirt. IOW, applications must *NOT* assume that a call to "virEventRegisterDefaultImpl"

  1   2   >