Re: [libvirt] RFC: remove qemu commandline parsing?

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 06:16:03PM -0400, Cole Robinson wrote: qemu/qemu_parse_command.c powers 'sudo virsh domxml-from-native qemu-argv', parsing a qemu command line and attempting to turn it into libvirt domain XML. Some history: RFE: https://www.redhat.com/archives/libvir-list/2009-April/msg0

Re: [libvirt] RFC: remove qemu commandline parsing?

2019-04-09 Thread Andrea Bolognani
On Mon, 2019-04-08 at 18:16 -0400, Cole Robinson wrote: [...] > I don't think it's > debatable that the code is largely unused, and it hasn't seen many > material improvements in the last 5 years, with zero plans to improve it > on the horizon. It's 2000+ lines of text processing code living in eve

Re: [libvirt] [PATCH] util: Fix uninitalized variable to avoid garbage

2019-04-09 Thread Erik Skultety
On Mon, Apr 08, 2019 at 05:32:14PM -0300, Julio Faracco wrote: > This commit fixes an unitialized variable to avoid garbage value > when virNetDevBridgeGet method returns error. When, that method fails > before initialize 'val' variable, it can cause problems related to > that. > > Signed-off-by: J

[libvirt] [PATCH] vmx: Define VMX_CONFIG_FORMAT_ARGV to replace vmware/esx argv str

2019-04-09 Thread Han Han
Signed-off-by: Han Han --- src/esx/esx_driver.c | 4 ++-- src/vmware/vmware_driver.c | 2 +- src/vmx/vmx.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 08d33b6f3b..d80fef0a58 100644 --- a/src/esx/esx_dr

Re: [libvirt] [PATCH 3/3] vmware: Use VMX_CONFIG_FORMAT_ARGV for vmware naive argv

2019-04-09 Thread Han Han
On Thu, Apr 4, 2019 at 5:16 AM Cole Robinson wrote: > *native in the subject > > On 3/28/19 1:57 AM, Han Han wrote: > > Signed-off-by: Han Han > > --- > > src/vmware/vmware_conf.c | 2 +- > > src/vmware/vmware_driver.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff

Re: [libvirt] [PATCH] test_driver: provide virDomainGetTime implementation

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 01:43:17AM +0200, Ilias Stamatis wrote: Implement testDomainGetTime by returning the current time. Signed-off-by: Ilias Stamatis --- I initially implemented this using clock_gettime, but Pavel suggested that this might not be a good idea since it isn't a cross-platform f

Re: [libvirt] [PATCH 06/36] cpu_x86: Introduce virCPUx86DataItem container struct

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:10AM +0200, Jiri Denemark wrote: The following patches introduce CPU features read from MSR in addition to those queried via CPUID instruction. Let's introduce a container struct which will be able to describe either feature type. Signed-off-by: Jiri Denemark --- s

Re: [libvirt] [PATCH 07/36] cpu_x86: Rename virCPUx86Vendor.cpuid

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:11AM +0200, Jiri Denemark wrote: Although vendor string is always reported by CPUID, the container struct is used for consistency and thus "cpuid" name is not a good fit anymore. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 18 +- 1 file chan

Re: [libvirt] [PATCH 08/36] cpu_x86: Rename virCPUx86DataItem variables

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:12AM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 128 +++--- 1 file changed, 64 insertions(+), 64 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature --

Re: [libvirt] [PATCH 09/36] cpu_x86: Rename x86DataCpuidNext function

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:13AM +0200, Jiri Denemark wrote: The function is now called virCPUx86DataNext to reflect its purpose: it is an iterator over CPU data (both CPUID and MSR in the near future). Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 18 +- 1 file changed,

Re: [libvirt] [PATCH 10/36] cpu_x86: Rename x86DataCpuid

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:14AM +0200, Jiri Denemark wrote: It is now called virCPUx86DataGet. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PG

Re: [libvirt] [PATCH 11/36] cpu_x86: Rename virCPUx86CPUIDSorter

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:15AM +0200, Jiri Denemark wrote: It is called virCPUx86DataSorter since the function will work on any CPU data type. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Ján Tomko Jano signa

Re: [libvirt] [PATCH 13/36] cpu_x86: Rename virCPUx86DataAddCPUID

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:17AM +0200, Jiri Denemark wrote: It's called virCPUx86DataAdd now. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 46 +- src/cpu/cpu_x86.h | 4 +-- src/libvirt_private.syms | 2 +- src/libxl/libxl

Re: [libvirt] [PATCH 12/36] cpu_x86: Rename virCPUx86DataAddCPUIDInt

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:16AM +0200, Jiri Denemark wrote: The new name is virCPUx86DataAddItem. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP s

Re: [libvirt] [PATCH 14/36] cpu_x86: Rename virCPUx86VendorToCPUID

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:18AM +0200, Jiri Denemark wrote: Renamed as virCPUx86VendorToData. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-

[libvirt] [PATCH] cpu_map: rename x86_EPYC-IBRS file to x86_EPYC-IBPB

2019-04-09 Thread Pavel Hrdina
The later is the correct CPU model name. Signed-off-by: Pavel Hrdina --- Pushed under trivial rule. And yes, there is a typo s/later/latter/. src/cpu_map/Makefile.inc.am | 2 +- src/cpu_map/index.xml| 2 +- src/cpu_map/{x86_EPYC-IBRS.xm

Re: [libvirt] [PATCH 15/36] cpu_x86: Simplify x86DataAdd

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:19AM +0200, Jiri Denemark wrote: The while loop just copied half of virCPUx86DataAddItem. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Descr

Re: [libvirt] [PATCH v2 5/6] cgroup: Get kernel memory entry from CGroup V1

2019-04-09 Thread Pavel Hrdina
On Mon, Apr 08, 2019 at 04:38:58PM -0300, Julio Faracco wrote: > This commit implements two methods to get kernel memory using CGroup V1. > One of them get the Hard Limit of kernel memory and the other one get > the current kernel memory usage from that current container. For V2, it > will return e

Re: [libvirt] [PATCH 16/36] cpu_x86: Introduce virCPUx86DataCmp

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:20AM +0200, Jiri Denemark wrote: virCPUx86DataSorter already compares two virCPUx86DataItem structs. Let's add a tiny wrapper around it called virCPUx86DataCmp and use it instead of open coded comparisons. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 13 +++

Re: [libvirt] [PATCH 17/36] cpu_x86: Make x86cpuidSetBits more general

2019-04-09 Thread Ján Tomko
[/me salutes] On Mon, Apr 08, 2019 at 10:42:21AM +0200, Jiri Denemark wrote: The function is renamed as virCPUx86DataItemSetBits and it works on virCPUx86DataItem now. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) Revi

Re: [libvirt] [PATCH 18/36] cpu_x86: Make x86cpuidClearBits more general

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:22AM +0200, Jiri Denemark wrote: The parameters changed from virCPUx86CPUID to virCPUx86DataItem and the function is now called virCPUx86DataItemClearBits. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 20 ++-- 1 file changed, 10 insertions(+)

Re: [libvirt] [PATCH 19/36] cpu_x86: Make x86cpuidAndBits more general

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:23AM +0200, Jiri Denemark wrote: The function now works on virCPUx86DataItem and it's renamed as virCPUx86DataItemAndBits. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Ján Tom

Re: [libvirt] [PATCH 20/36] cpu_x86: Make x86cpuidMatchMasked more general

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:24AM +0200, Jiri Denemark wrote: The function is renamed as virCPUx86DataItemMatchMasked to reflect the change in parameter types. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) Revi

Re: [libvirt] [PATCH 21/36] cpu_x86: Make x86cpuidMatch more general

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:25AM +0200, Jiri Denemark wrote: The function now works on virtCPUx86DataItem and it's called s/virt/vir/ virCPUx86DataItemMatch. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-)

Re: [libvirt] [PATCH 22/36] cpu_x86: Store virCPUx86DataItem content in union

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:26AM +0200, Jiri Denemark wrote: The structure can only be used for CPUID data now. Adding a type indicator and moving the data into a union will let us store alternative data types. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 202

Re: [libvirt] [PATCH] test_driver: provide virDomainGetTime implementation

2019-04-09 Thread Pavel Hrdina
On Tue, Apr 09, 2019 at 12:16:22PM +0200, Ján Tomko wrote: > On Mon, Apr 08, 2019 at 01:43:17AM +0200, Ilias Stamatis wrote: > > Implement testDomainGetTime by returning the current time. > > > > Signed-off-by: Ilias Stamatis > > --- > > I initially implemented this using clock_gettime, but Pavel

[libvirt] [PATCH 6/6] m4: readline: Add gross kludge for include path

2019-04-09 Thread Andrea Bolognani
Unfortunately the data reported by pkg-config is not completely accurate, so until the issue has been fixed in readline we need to work around it in libvirt. The good news is that we only need the fix to land in FreeBSD ports and macOS homebrew before we can drop the kludge, so we're talking month

[libvirt] [PATCH 4/6] m4: readline: Drop extra_LIBS machinery

2019-04-09 Thread Andrea Bolognani
The first implementation of this logic was introduced with commit 2ec759fc58f all the way back in 2007; looking at the build logs from our CI environment, however, it's apparent that none of the platforms we currently target are actually using it, so we can assume whatever issue it was working arou

[libvirt] [PATCH 5/6] m4: readline: Use pkg-config

2019-04-09 Thread Andrea Bolognani
With the 7.0 release, readline has finally started shipping pkg-config support in the form of a readline.pc file. Unfortunately, most downstreams have yet to catch up with this change: among Linux distributions in particular, Fedora Rawhide seems to be the only one installing it at the moment. No

[libvirt] [PATCH 1/6] tools: vsh: Drop obsolete readline compatibility code

2019-04-09 Thread Andrea Bolognani
This code is needed to use readline older than 4.1, but all our target platforms ship with at least 6.0 these days so we can safely get rid of it. Signed-off-by: Andrea Bolognani --- tools/vsh.c | 17 - 1 file changed, 17 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index

[libvirt] [PATCH 2/6] m4: readline: Extract code setting -D_FUNCTION_DEF

2019-04-09 Thread Andrea Bolognani
The current code is a bit awkward, and we're going to need to share it later anyway. We can drop the call to AC_SUBST() while we're at it, since LIBVIRT_CHECK_LIB() already marks READLINE_CFLAGS for substitution. The new code goes to some extra length to avoid setting -D_FUNCTION_DEF twice: this i

[libvirt] [PATCH 3/6] m4: readline: Stop looking for rl_completion_quote_character()

2019-04-09 Thread Andrea Bolognani
The function was introduced in readline 5.0, and all our target platforms ship with at least 6.0 these days. The check is also used as part of the extra_LIBS machinery, but we're going to drop that too next anyway. Signed-off-by: Andrea Bolognani --- m4/virt-readline.m4 | 13 - 1 fi

[libvirt] [PATCH 0/6] readline: Drop obsolete code, add pkg-config support

2019-04-09 Thread Andrea Bolognani
This series drops a bunch of compatibility code that's no longer necessary to support our target platforms and introduces support for getting readline's CFLAGS and LIBS via pkg-config, which in turn makes it possible to automatically enable the feature on FreeBSD. There are a couple of caveats:

Re: [libvirt] [PATCH 23/36] cpu_x86: Add support for storing MSR features in CPU map

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:27AM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 127 + src/cpu/cpu_x86_data.h | 10 +++ tests/cputestdata/cpu-cpuid.py | 3 +- 3 files changed, 127 insertions(+), 13 deletions

Re: [libvirt] [PATCH 24/36] cpu_x86: Move *CheckFeature functions

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:28AM +0200, Jiri Denemark wrote: They are static and we will need to call them a little bit closer to the beginning of the file. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 69 --- 1 file changed, 35 insertions(+)

Re: [libvirt] [PATCH 26/36] cputest: Generalize function names in cpu-cpuid.py

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:30AM +0200, Jiri Denemark wrote: The function will have to deal with both CPUID and MSR features. Signed-off-by: Jiri Denemark --- tests/cputestdata/cpu-cpuid.py | 40 +- 1 file changed, 20 insertions(+), 20 deletions(-) Reviewed-b

Re: [libvirt] [PATCH 25/36] cputest: Drop support for old QEMU from cpu-parse.sh

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:29AM +0200, Jiri Denemark wrote: We don't really need to parse CPU data from QEMU older than 2.9 (i.e., before query-cpu-model-expansion) at this point. But even if there's a need to do so, we can always use an older version of this script to do the conversion. Sign

Re: [libvirt] [PATCH 28/36] cputest: Rename in_e[ac]x as e[ac]x_in in cpu-cpuid.py

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:32AM +0200, Jiri Denemark wrote: This will let us simplify the code since the dictionary keys will match attribute names in various XMLs. Signed-off-by: Jiri Denemark --- tests/cputestdata/cpu-cpuid.py | 39 -- 1 file changed, 18 inse

Re: [libvirt] [PATCH 29/36] cputest: Prepare cpu-cpuid.py for MSR features

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:33AM +0200, Jiri Denemark wrote: Let's make sure the current CPUID specific code is only applied to CPUID features. Signed-off-by: Jiri Denemark --- tests/cputestdata/cpu-cpuid.py | 36 +++--- 1 file changed, 29 insertions(+), 7 deletions

Re: [libvirt] [PATCH 27/36] cputest: Fix comparison in checkCPUIDFeature in cpu-cpuid.py

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:31AM +0200, Jiri Denemark wrote: leaf["eax"] & eax > 0 check works correctly only if there's at most 1 bit set in eax. Luckily that's been always the case, but fixing this could save us from future surprises. Signed-off-by: Jiri Denemark --- tests/cputestdata/cpu-c

Re: [libvirt] [PATCH 0/6] readline: Drop obsolete code, add pkg-config support

2019-04-09 Thread Andrea Bolognani
On Tue, 2019-04-09 at 15:10 +0200, Andrea Bolognani wrote: [...] > * autodetection on macOS still doesn't work because of a > downstream packaging issue, but that's not any worse than the > current situation anyway. Actually this breaks compilation on macOS, because now when the pkg-conf

Re: [libvirt] [PATCH 30/36] cputest: Generalize feature parsing in cpu-cpuid.py

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:34AM +0200, Jiri Denemark wrote: The parseMapFeature for parsing features from CPU map XML can be easily generalized to support more feature types. Signed-off-by: Jiri Denemark --- tests/cputestdata/cpu-cpuid.py | 22 +- 1 file changed, 13 insert

Re: [libvirt] [PATCH 31/36] cputest: Add support for MSR features to cpu-gather.sh

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:35AM +0200, Jiri Denemark wrote: This patch adds an inline python code for reading MSR features. Since reading MSRs is a privileged operation, we have to read them from /dev/cpu/*/msr if it is readable (i.e., the script runs as root) or fallback to using KVM ioctl wh

Re: [libvirt] [PATCH 32/36] cputest: Add support for MSR features to cpu-parse.sh

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:36AM +0200, Jiri Denemark wrote: The script just parses whatever cpu-gather.sh printed out. Signed-off-by: Jiri Denemark --- tests/cputestdata/cpu-parse.sh| 9 ++--- tests/cputestdata/x86_64-cpuid-Xeon-Platinum-8268.xml | 1 + 2 files chan

Re: [libvirt] [PATCH 33/36] cputest: Add support for MSR features to cpu-cpuid.py

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:37AM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- tests/cputestdata/cpu-cpuid.py | 58 -- 1 file changed, 56 insertions(+), 2 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- l

Re: [libvirt] [PATCH 34/36] vircpuhost: Add support for reading MSRs

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:38AM +0200, Jiri Denemark wrote: The new virHostCPUGetMSR internal API will try to read the MSR from /dev/cpu/0/msr and if it is not possible (the device does not exist or libvirt is running unprivileged), it will fallback to asking KVM for the MSR using KVM_GET_MSRS

Re: [libvirt] [PATCH 35/36] cpu_x86: Read CPU features from IA32_ARCH_CAPABILITIES MSR

2019-04-09 Thread Ján Tomko
On Mon, Apr 08, 2019 at 10:42:39AM +0200, Jiri Denemark wrote: This is used by the host capabilities code to construct host CPU definition. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 24 1 file changed, 24 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu

[libvirt] [PATCH 2/3] vmx: write firmware back from autoselection

2019-04-09 Thread Pino Toscano
When writing the VMX file from the domain XML, write the firmware key according to the firmware autoselection. Though, at the moment only 'efi' is supported. Signed-off-by: Pino Toscano --- src/vmx/vmx.c | 4 tests/xml2vmxdata/xml2vmx-firmware-efi.vmx | 11 +++

[libvirt] [PATCH 3/3] docs: document firmware attribute for VMware guests

2019-04-09 Thread Pino Toscano
Signed-off-by: Pino Toscano --- docs/formatdomain.html.in | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0e3799061d..3d84ae0fcb 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -159,7 +15

[libvirt] [PATCH 1/3] vmx: convert firmware config for autoselection

2019-04-09 Thread Pino Toscano
Convert the firmware key to a type of autoselected firmware. Only the 'efi' firmware is allowed for now, in case the key is present. It seems VMware (at least ESXi) does not write the key in VMX files when setting BIOS as firmware. Signed-off-by: Pino Toscano --- src/vmx/vmx.c

[libvirt] [PATCH 0/3] vmx: add efi firmware attribute

2019-04-09 Thread Pino Toscano
Use the recently added infrastructure for firmware autoselection, and indicate which firmware is used by a VMware guest. Pino Toscano (3): vmx: convert firmware config for autoselection vmx: write firmware back from autoselection docs: document firmware attribute for VMware guests docs/for

Re: [libvirt] [PATCH] rpc: Refactor cleanup paths in virNetLibsshAuthenticatePassword

2019-04-09 Thread Ján Tomko
On Tue, Apr 02, 2019 at 05:37:40PM +0200, Peter Krempa wrote: Now that the memory disposal is handled automatically we can simplify the cleanup paths. In this case it's not as simple as sometimes the value of the called function is returned. While at it fix the initialization value of the return

[libvirt] [PATCH 3/4] qemu_cgroup: Make qemuSetupCpusetMems static

2019-04-09 Thread Michal Privoznik
This function is not used (nor going to be used) outside of qemu_cgroup.c file. Mark it as static. Signed-off-by: Michal Privoznik --- src/qemu/qemu_cgroup.c | 2 +- src/qemu/qemu_cgroup.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu

[libvirt] [PATCH 1/4] qemuSetupCpusetMems: Use VIR_AUTOFREE()

2019-04-09 Thread Michal Privoznik
There is one string that can be VIR_AUTOFREE used on. Signed-off-by: Michal Privoznik --- src/qemu/qemu_cgroup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index c23f0af2aa..689e0839cd 100644 --- a/src/qemu/qemu_cgroup

[libvirt] [PATCH 4/4] qemuSetupCpusetCgroup: Set up cpuset.mems before execing qemu

2019-04-09 Thread Michal Privoznik
It's funny how this went unnoticed for such a long time. Long story short, if a domain is configured with VIR_DOMAIN_NUMATUNE_MEM_STRICT libvirt doesn't really honour that. This is because of 7e72ac787848 after which libvirt allowed qemu to allocate memory just anywhere and only after that it used

[libvirt] [PATCH 0/4] qemu: Honor memory mode='strict'

2019-04-09 Thread Michal Privoznik
If there's a domain configured as: 4096 but there is not enough memory on NUMA node 1 the domain will start successfully because we allow it to allocate memory from other nodes. This is a result of some previous fix (v1.2.7-rc1~91). However, I've tested my fix successfully on a NUMA

[libvirt] [PATCH 2/4] qemuSetupCpusetMems: Create EMULATOR thread upfront

2019-04-09 Thread Michal Privoznik
This function is going to be called after fork() and before exec() of qemu to ensure that 'strict' mode of numatune is honored. This point is far before qemuProcessSetupEmulator() is called and thus CGroup for EMULATOR thread does not exist yet. Signed-off-by: Michal Privoznik --- src/qemu/qemu_

Re: [libvirt] [PATCH v1 4/4] domain capabilities: Expose firmware auto selection feature

2019-04-09 Thread Michal Privoznik
On 4/8/19 1:33 PM, Laszlo Ersek wrote: On 04/05/19 10:44, Michal Privoznik wrote: On 4/5/19 10:31 AM, Daniel P. Berrangé wrote: On Fri, Apr 05, 2019 at 09:19:48AM +0200, Michal Privoznik wrote: If a management application wants to use firmware auto selection feature it can't currently know if

[libvirt] [PATCH v2 0/7] readline: Drop obsolete code, add pkg-config support

2019-04-09 Thread Andrea Bolognani
Changes from [v1]: * ensure macOS builds don't break by picking up libedit instead of readline. [v1] https://www.redhat.com/archives/libvir-list/2019-April/msg00632.html Andrea Bolognani (7): tools: vsh: Drop obsolete readline compatibility code m4: readline: Fix indentation m4: read

[libvirt] [PATCH v2 3/7] m4: readline: Comment rl_completion_quote_character() check

2019-04-09 Thread Andrea Bolognani
The check was added in 74416b1d4849 without offering any explanation outside of the commit message. Introduce a comment to make digging through the git history unnecessary. Signed-off-by: Andrea Bolognani --- m4/virt-readline.m4 | 6 ++ 1 file changed, 6 insertions(+) diff --git a/m4/virt-r

[libvirt] [PATCH v2 4/7] m4: readline: Extract code setting -D_FUNCTION_DEF

2019-04-09 Thread Andrea Bolognani
The current code is a bit awkward, and we're going to need to share it later anyway. We can drop the call to AC_SUBST() while we're at it, since LIBVIRT_CHECK_LIB() already marks READLINE_CFLAGS for substitution. The new code goes to some extra length to avoid setting -D_FUNCTION_DEF twice: this i

[libvirt] [PATCH v2 2/7] m4: readline: Fix indentation

2019-04-09 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- m4/virt-readline.m4 | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/m4/virt-readline.m4 b/m4/virt-readline.m4 index 34b3ff3c4a..4823a27788 100644 --- a/m4/virt-readline.m4 +++ b/m4/virt-readline.m4 @@ -32,8 +32,7 @@ AC_DEFUN([LIB

[libvirt] [PATCH v2 1/7] tools: vsh: Drop obsolete readline compatibility code

2019-04-09 Thread Andrea Bolognani
This code is needed to use readline older than 4.1, but all our target platforms ship with at least 6.0 these days so we can safely get rid of it. Signed-off-by: Andrea Bolognani --- tools/vsh.c | 17 - 1 file changed, 17 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index

[libvirt] [PATCH v2 6/7] m4: readline: Use pkg-config where possible

2019-04-09 Thread Andrea Bolognani
With the 7.0 release, readline has finally started shipping pkg-config support in the form of a readline.pc file. Unfortunately, most downstreams have yet to catch up with this change: among Linux distributions in particular, Fedora Rawhide seems to be the only one installing it at the moment. No

[libvirt] [PATCH v2 5/7] m4: readline: Drop extra_LIBS machinery

2019-04-09 Thread Andrea Bolognani
The first implementation of this logic was introduced with commit 2ec759fc58fe all the way back in 2007; looking at the build logs from our CI environment, however, it's apparent that none of the platforms we currently target are actually using it, so we can assume whatever issue it was working aro

[libvirt] [PATCH v2 7/7] m4: readline: Add gross kludge for include path

2019-04-09 Thread Andrea Bolognani
Unfortunately the data reported by pkg-config is not completely accurate, so until the issue has been fixed in readline we need to work around it in libvirt. The good news is that we only need the fix to land in FreeBSD ports and macOS homebrew before we can drop the kludge, so we're talking month

Re: [libvirt] [PATCH 01/11] qemu: block: Introduce and use AUTOPTR func for qemuBlockStorageSourceAttachDataPtr

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:13PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 3 +-- src/qemu/qemu_block.h | 3 +++ src/qemu/qemu_command.c | 14 +++--- src/qemu/qemu_hotplug.c | 9 +++-- src/qemu/qemu_migration.c | 3 +-- 5 files ch

[libvirt] [PATCH v2 0/4] domain capabilities: Expose firmware auto selection feature

2019-04-09 Thread Michal Privoznik
v2 of: https://www.redhat.com/archives/libvir-list/2019-April/msg00460.html diff to v1: - Expose 'secure' too - Switch to uint64_t for qemuFirmwareGetSupported() Michal Prívozník (4): qemu_firmware: Separate firmware loading into a function qemu_firmware: Separate machine and arch matching i

[libvirt] [PATCH v2 1/4] qemu_firmware: Separate firmware loading into a function

2019-04-09 Thread Michal Privoznik
This piece of code will be reused later. Signed-off-by: Michal Privoznik --- src/qemu/qemu_firmware.c | 53 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 787b76b531..065e0d11aa 10

[libvirt] [PATCH v2 4/4] domain capabilities: Expose firmware auto selection feature

2019-04-09 Thread Michal Privoznik
If a management application wants to use firmware auto selection feature it can't currently know if the libvirtd it's talking to support is or not. Moreover, it doesn't know which values that are accepted for the @firmware attribute of when parsing will allow successful start of the domain later,

[libvirt] [PATCH v2 2/4] qemu_firmware: Separate machine and arch matching into a function

2019-04-09 Thread Michal Privoznik
This part of the code will be reused later. Signed-off-by: Michal Privoznik --- src/qemu/qemu_firmware.c | 47 +--- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 065e0d11aa..8e9a225982

[libvirt] [PATCH v2 3/4] qemu_firmware: Introduce qemuFirmwareGetSupported

2019-04-09 Thread Michal Privoznik
The point of this API is to fetch all FW descriptors, parse them and return list of supported interfaces and SMM feature for given combination of machine type and guest architecture. Signed-off-by: Michal Privoznik --- src/qemu/qemu_firmware.c | 71 ++- src/qe

Re: [libvirt] [PATCH] build-aux: ensure all scripts are included in EXTRA_DIST

2019-04-09 Thread Michal Privoznik
On 4/3/19 12:55 PM, Daniel P. Berrangé wrote: Few of the scripts in build-aux are included in EXTRA_DIST. This is not a serious problem since they are primarily tools intended for developers upstream, and downstream builds won't need them. Having them missing, however, complicates downstream patc

Re: [libvirt] [PATCH 02/11] qemu: block: Use VIR_AUTOPTR for virJSONValue

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:14PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 80 --- 1 file changed, 29 insertions(+), 51 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- li

Re: [libvirt] [PATCH 03/11] util: uri: Introduce VIR_AUTOPTR freeing function

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:15PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/util/viruri.h | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat

Re: [libvirt] [PATCH 04/11] qemu: block: Use VIR_AUTOPTR for virURIPtr

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:16PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing list libvir-list@redha

Re: [libvirt] [PATCH 05/11] qemu: block: Use VIR_AUTOPTR for virHashTablePtr

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:17PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing list libvir

Re: [libvirt] [PATCH 06/11] qemu: block: Use VIR_AUTOFREE for char *

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:18PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing li

Re: [libvirt] [PATCH 07/11] qemu: block: Add and use AUTOPTR func for qemuBlockNodeNameBackingChainData

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:19PM +0200, Peter Krempa wrote: This is a locally used helper struct but we can make use of automatic freeing for it. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jan

Re: [libvirt] [PATCH v2 2/4] qemu_firmware: Separate machine and arch matching into a function

2019-04-09 Thread Pino Toscano
On Tuesday, 9 April 2019 16:52:56 CEST Michal Privoznik wrote: > This part of the code will be reused later. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_firmware.c | 47 +--- > 1 file changed, 29 insertions(+), 18 deletions(-) > > diff --git a/s

Re: [libvirt] [PATCH 08/11] qemu: block: Remove unneeded cleanup jumps

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:20PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 206 +++--- 1 file changed, 72 insertions(+), 134 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- l

Re: [libvirt] [PATCH 09/11] internal: Introduce VIR_RETURN_PTR

2019-04-09 Thread Ján Tomko
On Fri, Apr 05, 2019 at 06:04:21PM +0200, Peter Krempa wrote: With the introduction of more and more internal data types which support VIR_AUTOPTR it's becoming common to see the following pattern: VIR_AUTOPTR(virSomething) some = NULL virSomethingPtr ret = NULL; ... (ret is not touched ) ..

[libvirt] [PATCH v2 1/3] adding QEMU_CAPS_QUERY_CURRENT_MACHINE and QEMU_CAPS_PM_WAKEUP_SUPPORT

2019-04-09 Thread Daniel Henrique Barboza
QEMU commit 46ea94ca9cf ("qmp: query-current-machine with wakeup-suspend-support") added a new QMP command called 'query-current-machine' that retrieves guest parameters that can vary in the same machine model (e.g. ACPI support for x86 VMs depends on the '--no-acpi' option). Currently, this API ha

[libvirt] [PATCH v2 3/3] qemuDomainPMSuspendForDuration: check for QEMU_CAPS_PM_WAKEUP_SUPPORT

2019-04-09 Thread Daniel Henrique Barboza
If the current QEMU guest can't wake up from suspend properly, avoid suspending the guest at all. This is done by checking the QEMU_CAPS_PM_WAKEUP_SUPPORT cap. The absence of the cap indicates that we're dealing with a QEMU version older than 4.0 (which implements the required QMP API). In this ca

[libvirt] [PATCH v2 2/3] qemu_process: setting QEMU_CAPS_QUERY_CURRENT_MACHINE caps

2019-04-09 Thread Daniel Henrique Barboza
The new QMP API query-current-machine reports VM capabilities that can vary depending on the VM configuration, in contrast to most QEMU caps that can be set once during libvirtd init as exposed in qemu_capabilities.c. As such, to properly set the runtime capabilities exposed by this API, we must q

[libvirt] [PATCH v2 0/3] introducing QEMU_CAPS_QUERY_CURRENT_MACHINE and QEMU_CAPS_PM_WAKEUP_SUPPORT

2019-04-09 Thread Daniel Henrique Barboza
v2: Fixed review problems found by Peter Krempa, most notably: - changed the cap name - made the code generic to be easier to add other caps from the query-current-machine API - changed unit tests accordingly Previous version can be found at: https://www.redhat.com/archives/libvir-list/2019-

Re: [libvirt] [PATCH] vmx: Define VMX_CONFIG_FORMAT_ARGV to replace vmware/esx argv str

2019-04-09 Thread Cole Robinson
You missed v2 in the subject. format-patch -v2 or send-email -v2 will add it. Patch subjects should be short, 50 chars is the goal though sometimes that's not practical. This is a good set of guidelines: https://chris.beams.io/posts/git-commit/ My commit messages aren't great either, but I pushed

Re: [libvirt] [PATCH 0/4] qemu: Honor memory mode='strict'

2019-04-09 Thread Daniel Henrique Barboza
Hi, On 4/9/19 11:10 AM, Michal Privoznik wrote: If there's a domain configured as: 4096 but there is not enough memory on NUMA node 1 the domain will start successfully because we allow it to allocate memory from other nodes. This is a result of some previous fix (v1.2.7-rc1~9