[PATCH] Fix the dupliacated cpus used in different cells issue

2022-02-09 Thread Jing Qi
Signed-off-by: Jing Qi --- docs/formatdomain.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 24611f0f09..f69957d8c3 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1662,14 +1662,13 @@ ACPI

[PATCH] Fix the dupliacated cpus used in different cells issue

2022-02-09 Thread Jing Qi
Signed-off-by: Jing Qi --- docs/formatdomain.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index f69957d8c3..47b41d257e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1669,6 +1669,7 @@ ACPI Heterogeneous Memory Attribute

Re: [PATCH] virhostcpu: fix getting CPU freq for Apple Silicon

2022-02-09 Thread Andrea Bolognani
On Mon, Feb 07, 2022 at 04:48:06PM +0800, Menci wrote: > The current implementation of virHostCPUGetInfo for macOS (__APPLE__) > reads "hw.cpufrequency" from sysctl, which is available only on x86_64 > architecture. > > On Apple Silicon ARM Macs, it's not available: > > $ sysctl hw.cpufrequency

Re: [PATCH 01/27] scripts/moc-noinline: Use full name of the required annotation in error message

2022-02-09 Thread Ján Tomko
s/moc/mock/ On a Wednesday in 2022, Peter Krempa wrote: Signed-off-by: Peter Krempa --- scripts/mock-noinline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

[PATCH 24/27] qemu: Honour 'virtlogd' use when hotplugging chardevs

2022-02-09 Thread Peter Krempa
Setup the chardev similarly to how we do it on startup so that virtlogd is properly used with chardevs which are hotplugged to a VM. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 3 +-- src/qemu/qemu_hotplug.c | 25 ++--- src/qemu/qemu_hotplug.h | 2 +-

[PATCH 12/27] qemuHotplugRemoveFDSet: Prepare for proper FD unplug handling

2022-02-09 Thread Peter Krempa
For now we have only one code path ('vdpa' interface) which actually cleans up the fdset after it's done, but there are more device types using fdsets. In order to unify the handling of fdsets the removal code will now be able to remove fdsets based on a prefix of the 'opaque' field, which we'll

[PATCH 09/27] qemu: Introduce helper functions for passing FDs to qemu

2022-02-09 Thread Peter Krempa
The existing helpers we have are very clumsy and there's no integration with the monitor. This patch introduces new helpers to bridge the gap and simplify handing of fdsets and classic FD passing when generating commandline/hotplug arguments. Signed-off-by: Peter Krempa --- po/POTFILES.in

[PATCH 27/27] qemuBuildTPMCommandLine: Use 'qemuPassFD' infrastructure

2022-02-09 Thread Peter Krempa
Remove the last code path using hardcoded fdsets. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 140 +- .../tpm-passthrough-crb.x86_64-latest.args| 6 +- .../tpm-passthrough.x86_64-latest.args| 6 +- 3 files changed, 45

[PATCH 19/27] qemuMonitorJSONTestAttachChardev: Add logfile to some tests

2022-02-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 434677f25f..8fbb199a59 100644 --- a/tests/qemumonitorjsontest.c +++

[PATCH 17/27] qemumonitorjsontest: Refactor chardev hotplug testing

2022-02-09 Thread Peter Krempa
The main objective of this patch is to use a proper instance of virDomainChrSourceDef allocated with the private data. To achieve this the test cases are grouped into blocks by how much they fill in the chardev definition. Some test cases are moved around so that the resulting sequence doesn't

[PATCH 23/27] qemu: process: Add a hotplug version of qemuProcessPrepareHostBackendChardev

2022-02-09 Thread Peter Krempa
When hotplugging a chardev we need the same form of setup for the character device. Export a version which takes a 'virDomainDeviceDef'. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 27 +++ src/qemu/qemu_process.h | 6 ++ 2 files changed, 33

[PATCH 26/27] qemuBuildTPMOpenBackendFDs: Construct 'cancel_path' internally

2022-02-09 Thread Peter Krempa
Since 'cancel_path' is constructed from the 'tpmdev' argument, we can push it down into the function opening the FDs. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 15 +++ src/qemu/qemu_command.h | 4 +--- tests/qemuxml2argvmock.c | 1 - 3 files changed, 8

[PATCH 13/27] qemuBuildInterfaceCommandLine: Use new pattern for naming the VDPA fdset

2022-02-09 Thread Peter Krempa
Prefix the file descriptor name with the alias of the network device so that it's similar to other upcoming use. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c| 4 ++-- tests/qemuxml2argvdata/net-vdpa.x86_64-latest.args | 2 +- 2 files changed, 3

[PATCH 21/27] tests: Move testPrepareHostBackendChardevOne into test utils

2022-02-09 Thread Peter Krempa
Move the function doing the fake setup of chardev backend for FD passing into the collection of qemu test helpers so that it can be used in qemumonitorjsontest. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 93 +- tests/testutilsqemu.c| 106

[PATCH 22/27] qemuMonitorJSONTestAttachChardev: Add tests for FD passing of file backend

2022-02-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 13 + 1 file changed, 13 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 8fbb199a59..278d7ba765 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@

[PATCH 25/27] virTPMCreateCancelPath: Refactor value returning

2022-02-09 Thread Peter Krempa
Automatically free 'path' inside the loop which fills it and return the values directly. Signed-off-by: Peter Krempa --- src/util/virtpm.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index c02b42f948..8005708522 100644

[PATCH 14/27] qemu: Rewrite chardev startup code to use qemuFDPass

2022-02-09 Thread Peter Krempa
Rewrite the parts which already pass FDs via fdset or directly to use the new infrastructure. Apart from simpler code this also adds the appropriate names to the fds in the fdsets which will allow us to properly remove the fdsets won hot-unplug of chardevs, which we didn't do for now and resulted

[PATCH 20/27] qemuMonitorJSONAttachCharDevGetProps: Properly handle private data

2022-02-09 Thread Peter Krempa
FD passing and TLS is normally setup via private data for the chardev source. The monitor implementation didn't support it. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 71 +++- 1 file changed, 54 insertions(+), 17 deletions(-) diff --git

[PATCH 16/27] qemumonitorjsontest: chardev: Remove need to allow unused commands

2022-02-09 Thread Peter Krempa
Don't add the command to the test monitor when we don't expect to invoke it rather than bypassing the test monitor. Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/qemumonitorjsontest.c

[PATCH 18/27] qemuMonitorJSONTestAttachChardev: Add test for TLS-secured TCP chardev

2022-02-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index d42ccefece..434677f25f 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@

[PATCH 11/27] qemu: hotplug: Extract code for unplugging fdsets

2022-02-09 Thread Peter Krempa
The code unplugging the fdset for a 'vdpa' network device can be later reused. Extract it into 'qemuHotplugRemoveFDSet'. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 69 +++-- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git

[PATCH 08/27] qemu: domain: Add helper for generating 'fdset' ids for VM startup

2022-02-09 Thread Peter Krempa
When starting a VM we must assign unique IDs for fdsets we add via '-add-fd'. For now it was done by using the index of the filedescriptor passed to the virCommand. That approach is not very flexible, because you need to have already passed the 'fd' to virCommand before generating the fdset path,

[PATCH 15/27] qemuDomainRemoveChrDevice: Detach fdset after chardev hot-unplug

2022-02-09 Thread Peter Krempa
Our code uses fdsets for the pipe passed from virtlogd to qemu, but the chardev hot-unplug code neglected to detach the fdset after the chardev was removed. This kept the FDs open by qemu even after they were not used any more. After the refactor to use qemuFDPass for chardevs we now configure

[PATCH 05/27] qemuMonitorRemoveFdset: Convert @fdset to unsigned int to avoid error

2022-02-09 Thread Peter Krempa
'qemuMonitorRemoveFdset' validatest that the 'fdset' argument isn't less than 0. We can turn it to unsigned and thus avoid the error message completely. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 14 -- src/qemu/qemu_monitor.h | 2 +-

[PATCH 03/27] qemuProcessPrepareHostBackendChardev: Drop unneeded arguments

2022-02-09 Thread Peter Krempa
Caller passes 'driver->securityManager', and 'priv->qemuCaps' as arguments along with 'vm', but both aforementioned objects are accessible directly from 'vm'. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-)

[PATCH 04/27] qemuMonitorJSONQueryFdsetsParse: Don't check value passed to g_strdup

2022-02-09 Thread Peter Krempa
'g_strdup()' is NULL-tolerant. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 8e1501d91f..69ecc8a2d1 100644 --- a/src/qemu/qemu_monitor_json.c

[PATCH 06/27] qemu: monitor: Make 'id' in 'struct _qemuMonitorFdsetInfo' unsigned

2022-02-09 Thread Peter Krempa
Similarly to the 'qemuMonitorRemoveFdset', it doesn't make sense to store it as signed when only unsigned values are expected. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 10/27] qemuBuildInterfaceCommandLine: Use qemuFDPass for the vdpa fd

2022-02-09 Thread Peter Krempa
Use the new helpers for passing of the file descriptor needed for 'vdpa' interfaces. Apart from the simplification in this case it will allow further changes to unify all fdset handling. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 35 ---

[PATCH 07/27] qemu: domain: Move and unexport 'qemuDomainStorageIdReset'

2022-02-09 Thread Peter Krempa
It's used only inside qemu_domain.c. Move it before it's usage, along with the qemuDomainStorageIdNew counterpart and unexport it. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 54 +- src/qemu/qemu_domain.h | 1 - 2 files changed, 27

[PATCH 02/27] qemuProcessPrepareHostBackendChardevFileHelper: Always use FD passing

2022-02-09 Thread Peter Krempa
Code paths which don't wish to use FD passing are supposed to not call the function which sets up the chardev for FD passing. This is ensured by calling it only in the host prepare step. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 11 ---

[PATCH 00/27] qemu: Fix chardev hot(un)plug issues and sanitize use of /dev/fdset/N

2022-02-09 Thread Peter Krempa
This series addresses the following issues: - hot-unplug of chardevs leaks the FDset in qemu - hot-plug of chardev doesn't use virtlogd even when configured - the name of the FD used for vdpa doesn't really tie it to the device There's also improvement in the common code handling the FD passing

[PATCH 01/27] scripts/moc-noinline: Use full name of the required annotation in error message

2022-02-09 Thread Peter Krempa
Signed-off-by: Peter Krempa --- scripts/mock-noinline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mock-noinline.py b/scripts/mock-noinline.py index 69cf0b4b99..712550cb7a 100644 --- a/scripts/mock-noinline.py +++ b/scripts/mock-noinline.py @@ -73,7 +73,7 @@

[PULL 27/28] linux-user: Remove the deprecated ppc64abi32 target

2022-02-09 Thread Alex Bennée
From: Thomas Huth It's likely broken, and nobody cared for picking it up again during the deprecation phase, so let's remove this now. Since this is the last entry in deprecated_targets_list, remove the related code in the configure script, too. Signed-off-by: Thomas Huth Reviewed-by: Richard

Re: [PATCH] cpu_conf: unbreak XPath in virCPUDefParseXML()

2022-02-09 Thread Jiri Denemark
On Wed, Feb 09, 2022 at 14:28:29 +0100, Michal Prívozník wrote: > On 2/9/22 10:39, Daniel P. Berrangé wrote: > > On Tue, Feb 08, 2022 at 12:22:36PM +0100, Michal Privoznik wrote: > >> In one of my previous commits, I've changed an XPath in > >> virCPUDefParseXML() from "boolean(./counter...)" to >

Re: [PATCH] cpu_conf: unbreak XPath in virCPUDefParseXML()

2022-02-09 Thread Daniel P . Berrangé
On Wed, Feb 09, 2022 at 02:28:29PM +0100, Michal Prívozník wrote: > On 2/9/22 10:39, Daniel P. Berrangé wrote: > > On Tue, Feb 08, 2022 at 12:22:36PM +0100, Michal Privoznik wrote: > >> In one of my previous commits, I've changed an XPath in > >> virCPUDefParseXML() from "boolean(./counter...)" to

Re: [PATCH] cpu_conf: unbreak XPath in virCPUDefParseXML()

2022-02-09 Thread Michal Prívozník
On 2/9/22 10:39, Daniel P. Berrangé wrote: > On Tue, Feb 08, 2022 at 12:22:36PM +0100, Michal Privoznik wrote: >> In one of my previous commits, I've changed an XPath in >> virCPUDefParseXML() from "boolean(./counter...)" to >> "./counter...)". Notice the dangling closing bracket? Well, I >>

Re: [libvirt PATCH] docs: remove twitter from the website

2022-02-09 Thread Daniel P . Berrangé
On Wed, Feb 09, 2022 at 04:51:47AM -0800, Andrea Bolognani wrote: > On Wed, Feb 09, 2022 at 10:32:13AM +, Daniel P. Berrangé wrote: > > On Wed, Feb 09, 2022 at 01:46:50AM -0800, Andrea Bolognani wrote: > > > On Fri, Feb 04, 2022 at 05:01:54PM +0100, Ján Tomko wrote: > > > > Community > > > >

[PATCH] ch: Report VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER as supported

2022-02-09 Thread Michal Privoznik
Even though the CH driver doesn't implement virNetworkUpdate() API, when it does it will see the arguments in correct order. This is similar to other drivers that don't implement the API, like ESX, libxl, LXC, etc. Enabling this driver feature stops clients from swapping the arguments (see comment

Re: [libvirt PATCH] docs: remove twitter from the website

2022-02-09 Thread Andrea Bolognani
On Wed, Feb 09, 2022 at 10:32:13AM +, Daniel P. Berrangé wrote: > On Wed, Feb 09, 2022 at 01:46:50AM -0800, Andrea Bolognani wrote: > > On Fri, Feb 04, 2022 at 05:01:54PM +0100, Ján Tomko wrote: > > > Community > > > > > > - https://twitter.com/hashtag/libvirt;>twitter > > > > >

Re: [libvirt PATCH] qemu: Ignore missing vm.unprivileged_userfaultfd sysctl

2022-02-09 Thread Ján Tomko
On a Wednesday in 2022, Jiri Denemark wrote: Older kernels did not support this sysctl, but did not restrict userfaultfd in any way so everything worked as if vm.unprivileged_userfaultfd was set to 1. Thus we can safely ignore errors when setting the value. Signed-off-by: Jiri Denemark ---

Re: [libvirt PATCH] docs: remove twitter from the website

2022-02-09 Thread Daniel P . Berrangé
On Wed, Feb 09, 2022 at 01:46:50AM -0800, Andrea Bolognani wrote: > On Fri, Feb 04, 2022 at 05:01:54PM +0100, Ján Tomko wrote: > > Regardless of the platform being mostly advertising, trolling > > and promoting stupidity [0][1], > > > > [0] > >

[libvirt PATCH] qemu: Ignore missing vm.unprivileged_userfaultfd sysctl

2022-02-09 Thread Jiri Denemark
Older kernels did not support this sysctl, but did not restrict userfaultfd in any way so everything worked as if vm.unprivileged_userfaultfd was set to 1. Thus we can safely ignore errors when setting the value. Signed-off-by: Jiri Denemark --- src/qemu/postcopy-migration.sysctl | 2 +- 1 file

Re: [libvirt PATCH] docs: remove twitter from the website

2022-02-09 Thread Andrea Bolognani
On Fri, Feb 04, 2022 at 05:01:54PM +0100, Ján Tomko wrote: > Regardless of the platform being mostly advertising, trolling > and promoting stupidity [0][1], > > [0] > https://news.mit.edu/2018/study-twitter-false-news-travels-faster-true-stories-0308 > [1] >

Re: [PATCH 1/2] qemu_process.c: Fix VIR_QEMU_PROCESS_START_RESET_NVRAM value

2022-02-09 Thread Daniel P . Berrangé
On Wed, Feb 09, 2022 at 09:39:49AM +0100, Michal Privoznik wrote: > In one of recent commits qemuProcessStartFlags enum gained new > value: VIR_QEMU_PROCESS_START_RESET_NVRAM but due to a typo it > has the same value as another member of the enum. Fix that. > > Signed-off-by: Michal Privoznik >

Re: [PATCH] cpu_conf: unbreak XPath in virCPUDefParseXML()

2022-02-09 Thread Daniel P . Berrangé
On Tue, Feb 08, 2022 at 12:22:36PM +0100, Michal Privoznik wrote: > In one of my previous commits, I've changed an XPath in > virCPUDefParseXML() from "boolean(./counter...)" to > "./counter...)". Notice the dangling closing bracket? Well, I > didn't back then. Suggests we have missing test XML

Re: removing VMs logs

2022-02-09 Thread Daniel P . Berrangé
On Mon, Feb 07, 2022 at 02:04:14PM +0300, Nikolay Shirokovskiy wrote: > пн, 7 февр. 2022 г. в 13:29, Michal Prívozník : > > > On 2/7/22 09:22, Nikolay Shirokovskiy wrote: > > > Hi, all. > > > > > > Libvirt QEMU driver writes QEMU process log to > > > /var/log/libvirt/qemu/.log file. This file is

Re: [PATCH 2/2] qemu_process: Fix theoretical overflow in uint to bool typecast

2022-02-09 Thread Michal Prívozník
On 2/9/22 10:08, Peter Krempa wrote: > On Wed, Feb 09, 2022 at 09:39:50 +0100, Michal Privoznik wrote: >> The qemuPrepareNVRAM() function accepts three arguments and the >> last one being a boolean type. However, when the function is >> called from qemuProcessPrepareHost() the argument passed is a

Re: [PATCH 1/2] qemu_process.c: Fix VIR_QEMU_PROCESS_START_RESET_NVRAM value

2022-02-09 Thread Peter Krempa
On Wed, Feb 09, 2022 at 09:39:49 +0100, Michal Privoznik wrote: > In one of recent commits qemuProcessStartFlags enum gained new > value: VIR_QEMU_PROCESS_START_RESET_NVRAM but due to a typo it > has the same value as another member of the enum. Fix that. > > Signed-off-by: Michal Privoznik >

Re: [PATCH 2/2] qemu_process: Fix theoretical overflow in uint to bool typecast

2022-02-09 Thread Peter Krempa
On Wed, Feb 09, 2022 at 09:39:50 +0100, Michal Privoznik wrote: > The qemuPrepareNVRAM() function accepts three arguments and the > last one being a boolean type. However, when the function is > called from qemuProcessPrepareHost() the argument passed is a > result of logical and of @flags

[PATCH 1/2] qemu_process.c: Fix VIR_QEMU_PROCESS_START_RESET_NVRAM value

2022-02-09 Thread Michal Privoznik
In one of recent commits qemuProcessStartFlags enum gained new value: VIR_QEMU_PROCESS_START_RESET_NVRAM but due to a typo it has the same value as another member of the enum. Fix that. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/2] qemu_process: Fix theoretical overflow in uint to bool typecast

2022-02-09 Thread Michal Privoznik
The qemuPrepareNVRAM() function accepts three arguments and the last one being a boolean type. However, when the function is called from qemuProcessPrepareHost() the argument passed is a result of logical and of @flags (unsigned int) and VIR_QEMU_PROCESS_START_RESET_NVRAM value. In theory this is

[PATCH 0/2] qemu_process: Two trivial fixes aroung VIR_QEMU_PROCESS_START_RESET_NVRAM

2022-02-09 Thread Michal Privoznik
I've pushed both patches, because they are trivial. Michal Prívozník (2): qemu_process.c: Fix VIR_QEMU_PROCESS_START_RESET_NVRAM value qemu_process: Fix theoretical overflow in uint to bool typecast src/qemu/qemu_process.c | 2 +- src/qemu/qemu_process.h | 2 +- 2 files changed, 2