[libvirt PATCH 2/2] docs: update nodedev driver docs for new mdev features

2021-09-15 Thread Jonathon Jongsma
Add up-to-date information about creating and defining mediated devices in libvirt. Signed-off-by: Jonathon Jongsma --- docs/drvnodedev.html.in | 83 ++--- 1 file changed, 62 insertions(+), 21 deletions(-) diff --git a/docs/drvnodedev.html.in

[libvirt PATCH 1/2] docs: Expand manpage documentation for nodedev commands

2021-09-15 Thread Jonathon Jongsma
Bring the documentation for nodedev-list up to date with the latest code, especially documenting the --active and -all options. Also add documentation for the nodedev-define, nodedev-undefine, and nodedev-start commands. Signed-off-by: Jonathon Jongsma --- docs/manpages/virsh.rst | 48

[PATCH RFC 3/5] qapi: Move compat policy from QObject to generic visitor

2021-09-15 Thread Markus Armbruster
The next commit needs to access compat policy from the generic visitor core. Move it there from qobject input and output visitor. Signed-off-by: Markus Armbruster --- include/qapi/qobject-input-visitor.h | 4 include/qapi/qobject-output-visitor.h | 4 include/qapi/visitor-impl.h

[PATCH RFC 5/5] block: Deprecate transaction type drive-backup

2021-09-15 Thread Markus Armbruster
Several moons ago, Vladimir posted Subject: [PATCH v2 3/3] qapi: deprecate drive-backup Date: Wed, 5 May 2021 16:58:03 +0300 Message-Id: <20210505135803.67896-4-vsement...@virtuozzo.com> https://lists.gnu.org/archive/html/qemu-devel/2021-05/msg01394.html with this TODO: We

[PATCH RFC 1/5] qapi: Enable enum member introspection to show more than name

2021-09-15 Thread Markus Armbruster
The next commit will add feature flags to enum members. There's a problem, though: query-qmp-schema shows an enum type's members as an array of member names (SchemaInfoEnum member @values). If it showed an array of objects with a name member, we could simply add more members to these objects.

[PATCH RFC 0/5] Subject: [PATCH RFC 0/5] qapi: Add feature flags to enum members

2021-09-15 Thread Markus Armbruster
PATCH 1+2 add feature flags to enum members. Awkward due to an introspection design mistake; see PATCH 1 for details. Feedback welcome, in particular from management application guys. PATCH 3+4 implement policy deprecated-input={reject,crash} for enum values. Policy deprecated-output=hide is

Re: [PATCH v2 3/3] qapi: deprecate drive-backup

2021-09-15 Thread Markus Armbruster
Markus Armbruster writes: > Vladimir Sementsov-Ogievskiy writes: > >> 08.06.2021 14:12, Markus Armbruster wrote: >>> Vladimir Sementsov-Ogievskiy writes: >>> >>> [...] >>> TODO: We also need to deprecate drive-backup transaction action.. But union members in QAPI doesn't support

[PATCH RFC 2/5] qapi: Add feature flags to enum members

2021-09-15 Thread Markus Armbruster
This is quite similar to commit 84ab008687 "qapi: Add feature flags to struct members", only for enums instead of structs. Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.rst | 4 +++- qapi/compat.json | 2 ++ qapi/introspect.json

[PATCH RFC 4/5] qapi: Implement deprecated-input={reject, crash} for enum values

2021-09-15 Thread Markus Armbruster
This copies the code implementing the policy from qapi/qmp-dispatch.c to qapi/qobject-input-visitor.c. I hope to avoid that in a future revision. Signed-off-by: Markus Armbruster --- qapi/compat.json | 3 ++- include/qapi/util.h| 6 +- qapi/qapi-visit-core.c | 18

Re: [libvirt PATCH] virsh: Make code flow in cmdManagedSaveRemove more straightforward

2021-09-15 Thread Jonathon Jongsma
Reviewed-by: Jonathon Jongsma On Wed, Sep 15, 2021 at 10:16 AM Jiri Denemark wrote: > > By doing so we can get rid of the code which violates our coding style > guidelines. > > Signed-off-by: Jiri Denemark > --- > tools/virsh-domain.c | 21 +++-- > 1 file changed, 11

[PATCH v4 10/11] test_driver: Introduce testDomainGetStatsIOThread

2021-09-15 Thread Luke Yue
Introduce testDomainGetStatsIOThread to add support for testConnectGetAllDomainStats to get IOThread infos. Signed-off-by: Luke Yue --- src/test/test_driver.c | 44 +- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/test/test_driver.c

[PATCH v4 11/11] tests: Test IOThread related functions for test driver

2021-09-15 Thread Luke Yue
testIOThreadAdd tests iothreadinfo and iothreadadd testIOThreadDel tests iothreadinfo and iothreaddel testIOThreadSet tests domstats and iothreadset testIOThreadPin tests iothreadadd, iothreadinfo and iothreadpin Above tests should cover the IOThreads related APIs for test driver Signed-off-by:

[PATCH v4 05/11] domain_driver.c: Introduce and use virDomainDriverGetIOThreadsConfig()

2021-09-15 Thread Luke Yue
The test driver can share the same code with qemu driver when implement testDomainGetIOThreadsConfig, so extract it for test driver to use. Also add a new parameter `bitmap_size` to the function, it's used for specifying the bitmap size of the bitmap to generate, it would be helpful for test

[PATCH v4 00/11] Implement IOThreads related APIs for test driver

2021-09-15 Thread Luke Yue
v4: - Rebase to current master branch - Add the forgotten virObjectUnlock(vm) in PATCH 09/11 - Refine tests CI link: https://gitlab.com/lukedyue/libvirt/-/pipelines/371315349 Luke Yue (11): domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck() test_driver: Introduce

[PATCH v4 09/11] test_driver: Implement virConnectGetAllDomainStats

2021-09-15 Thread Luke Yue
Implement virConnectGetAllDomainStats in a modular way just like QEMU driver, though remove some params in GetStatsWorker that we don't need in test driver currently. Only add the worker to get state so far, more worker will be added in the future. Signed-off-by: Luke Yue ---

[PATCH v4 07/11] test_driver: Implement virDomainPinIOThread

2021-09-15 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0971661c89..43c0822c87 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@

[PATCH v4 08/11] test_driver: Implement testDomainSetIOThreadParams

2021-09-15 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 90 ++ 1 file changed, 90 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 43c0822c87..7cff26776a 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@

[PATCH v4 06/11] test_driver: Implement virDomainGetIOThreadInfo

2021-09-15 Thread Luke Yue
If we use test driver on different machines, and use 0 as bitmap_size for virDomainDriverGetIOThreadsConfig(), we would get different results for the `CPU Affinity`, because it's depending on the host CPU's bitmap. In order to get a stable result for testing, use result of virDomainDefGetVcpus()

[PATCH v4 04/11] test_driver: Implement virDomainDelIOThread

2021-09-15 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index e0b7ace4ed..b588bbc32e 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@

[PATCH v4 03/11] test_driver: Implement virDomainAddIOThread

2021-09-15 Thread Luke Yue
Introduce testDomainChgIOThread at the same time, could be used for virDomainDelIOThread etc. Signed-off-by: Luke Yue --- src/test/test_driver.c | 76 ++ 1 file changed, 76 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index

[PATCH v4 01/11] domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck()

2021-09-15 Thread Luke Yue
The test driver can share the same code with qemu driver when implement testDomainAddIOThreadCheck and testDomainDelIOThreadCheck, so extract them for test driver to use. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 64 ++

[PATCH v4 02/11] test_driver: Introduce testIOThreadInfo and generate IOThread infos

2021-09-15 Thread Luke Yue
Introduce testIOThreadInfo to store IOThread infos: iothread_id, poll_max_ns, poll_grow and poll_shrink for future usage. Add an example of IOThread configuration to testdomfc4.xml, we also want to generate default testIOThreadInfo for the IOThread configured in the xml, so introduce

[libvirt PATCH] virsh: Make code flow in cmdManagedSaveRemove more straightforward

2021-09-15 Thread Jiri Denemark
By doing so we can get rid of the code which violates our coding style guidelines. Signed-off-by: Jiri Denemark --- tools/virsh-domain.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index

[PATCH] docs: fix migration_features element name in formatcaps.html.in

2021-09-15 Thread Andrea Bolognani
From: Robin Lee Signed-off-by: Robin Lee Reviewed-by: Andrea Bolognani --- Taken from https://gitlab.com/libvirt/libvirt/-/merge_requests/106 I've pushed it already. docs/formatcaps.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatcaps.html.in

Re: [PATCH] virsh: Add QMP command wrapping for 'qemu-monitor-command'

2021-09-15 Thread Daniel P . Berrangé
On Tue, Sep 14, 2021 at 05:16:11PM +0200, Peter Krempa wrote: > Issuing simple QMP commands is pain as they need to be wrapped by the > JSON wrapper: > > { "execute": "COMMAND" } > > and optionally also: > > { "execute": "COMMAND", "arguments":...} > > For simple commands without arguments

Re: [PATCH] virsh: Add QMP command wrapping for 'qemu-monitor-command'

2021-09-15 Thread Jonathon Jongsma
On Tue, 14 Sep 2021 17:16:11 +0200 Peter Krempa wrote: > Issuing simple QMP commands is pain as they need to be wrapped by the > JSON wrapper: > > { "execute": "COMMAND" } > > and optionally also: > > { "execute": "COMMAND", "arguments":...} > > For simple commands without arguments we can

Re: [PATCH v5 05/16] qemu: Build command line for virtio-mem

2021-09-15 Thread Michal Prívozník
On 9/15/21 1:26 PM, Jing Qi wrote: > Hi Michal, > The domain xml is attached. Thank you. I was able to reproduce but the problem is not in these patches. I can reproduce even without them. I have a fix that I will post shortly. Michal

[PATCH] tools/virsh-pool: refactor smaller functions

2021-09-15 Thread Kristina Hanicova
I think these functions look much more readable with just simple if conditions. Signed-off-by: Kristina Hanicova --- tools/virsh-pool.c | 68 -- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c

Re: [libvirt PATCH v2] news: mention new nodedev API

2021-09-15 Thread Erik Skultety
On Wed, Sep 15, 2021 at 08:21:13AM -0500, Jonathon Jongsma wrote: > Add news item about the new API for node devices. > > Signed-off-by: Jonathon Jongsma > --- > NEWS.rst | 12 > 1 file changed, 12 insertions(+) > > diff --git a/NEWS.rst b/NEWS.rst > index 4521499db7..fd20e50d18

Re: [PATCH 0/2] virsh: Fix fallback code path for vcpuinfo

2021-09-15 Thread Jonathon Jongsma
ACK both patches Reviewed-by: Jonathon Jongsma On Wed, Sep 15, 2021 at 8:21 AM Peter Krempa wrote: > > Peter Krempa (2): > virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path > virshDomainGetVcpuBitmap: Refactor cleanup > > tools/virsh-domain.c | 15 +++ > 1

Re: [PATCH 0/2] virsh: Fix fallback code path for vcpuinfo

2021-09-15 Thread Pavel Hrdina
On Wed, Sep 15, 2021 at 03:21:10PM +0200, Peter Krempa wrote: > Peter Krempa (2): > virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path > virshDomainGetVcpuBitmap: Refactor cleanup Reviewed-by: Pavel Hrdina signature.asc Description: PGP signature

Re: [PATCH 0/2] virsh: Fix fallback code path for vcpuinfo

2021-09-15 Thread Jiri Denemark
On Wed, Sep 15, 2021 at 15:21:10 +0200, Peter Krempa wrote: > Peter Krempa (2): > virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path > virshDomainGetVcpuBitmap: Refactor cleanup > > tools/virsh-domain.c | 15 +++ > 1 file changed, 7 insertions(+), 8

[PATCH 2/2] virshDomainGetVcpuBitmap: Refactor cleanup

2021-09-15 Thread Peter Krempa
Rename the temp variable that is being returned and use automatic pointer clearing for it. Signed-off-by: Peter Krempa --- tools/virsh-domain.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index

[PATCH 0/2] virsh: Fix fallback code path for vcpuinfo

2021-09-15 Thread Peter Krempa
Peter Krempa (2): virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path virshDomainGetVcpuBitmap: Refactor cleanup tools/virsh-domain.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.31.1

[libvirt PATCH v2] news: mention new nodedev API

2021-09-15 Thread Jonathon Jongsma
Add news item about the new API for node devices. Signed-off-by: Jonathon Jongsma --- NEWS.rst | 12 1 file changed, 12 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 4521499db7..fd20e50d18 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -17,6 +17,18 @@ v7.8.0 (unreleased) *

[PATCH 1/2] virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path

2021-09-15 Thread Peter Krempa
In case the specific VCPU states are not present in the XML we were taking a fallback code path just noting that all cpus of the VM are enabled. This was broken by a mistake in a recent refactor where a 'goto cleanup' was mistakenly replaced by a 'return NULL'. This broke reporting of cpus and

Re: [PATCH] qemu: validate: Allow 'preserve' action for on_crash lifecycle action

2021-09-15 Thread Boris Fiuczynski
On 9/15/21 1:14 PM, Peter Krempa wrote: In fact keeping the VM around for debugging is a desirable configuration and actually the implementation has no code as we keep the VM around. Remove the validation and add a note that it's actually used. Fixes:

Re: [PATCH v5 05/16] qemu: Build command line for virtio-mem

2021-09-15 Thread Jing Qi
Hi Michal, The domain xml is attached. Regards, Jing Qi On Wed, Sep 15, 2021 at 7:14 PM Michal Prívozník wrote: > On 9/14/21 3:05 PM, David Hildenbrand wrote: > > On 13.09.21 16:52, Michal Privoznik wrote: > >> Nothing special is happening here. All important changes were > >> done when for

Re: [PATCH] qemu: validate: Allow 'preserve' action for on_crash lifecycle action

2021-09-15 Thread Christian Borntraeger
On 15.09.21 13:14, Peter Krempa wrote: In fact keeping the VM around for debugging is a desirable configuration and actually the implementation has no code as we keep the VM around. Remove the validation and add a note that it's actually used. Fixes: b1b85a475fb251b9068b75f629479f5c452f1b43

[PATCH] qemu: validate: Allow 'preserve' action for on_crash lifecycle action

2021-09-15 Thread Peter Krempa
In fact keeping the VM around for debugging is a desirable configuration and actually the implementation has no code as we keep the VM around. Remove the validation and add a note that it's actually used. Fixes: b1b85a475fb251b9068b75f629479f5c452f1b43 Reported-by: Christian Borntraeger

Re: [PATCH v5 05/16] qemu: Build command line for virtio-mem

2021-09-15 Thread Michal Prívozník
On 9/15/21 8:16 AM, Jing Qi wrote: > Hi Michal, > I tried to test the virtio-mem with upstream version v7.7.0-136-g9b49c2c6d3 > adding the current patch > (with qemu-6.1.0-7.fc36.x86_64) - Hey, thanks for that! > > > 8388608 > 1179648 > 1179648 > > > > > > qemu64 >

Re: [PATCH v5 05/16] qemu: Build command line for virtio-mem

2021-09-15 Thread Michal Prívozník
On 9/14/21 3:05 PM, David Hildenbrand wrote: > On 13.09.21 16:52, Michal Privoznik wrote: >> Nothing special is happening here. All important changes were >> done when for 'virtio-pmem' (adjusting the code to put virtio >> memory on PCI bus, generating alias using >> qemuDomainDeviceAliasIndex().

[PATCH v2 2/5] src: add driver support for networkCreateXMLFlags()

2021-09-15 Thread Kristina Hanicova
I added new driver functions to handle creating network with given flags. I also replaced definitions of the functions without flags with function calls to the new ones. Signed-off-by: Kristina Hanicova --- src/network/bridge_driver.c | 18 +++--- src/test/test_driver.c | 13

[PATCH v2 4/5] network: allow VIR_NETWORK_CREATE_VALIDATE flag

2021-09-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/network/bridge_driver.c | 5 +++-- src/test/test_driver.c | 5 +++-- src/vbox/vbox_network.c | 6 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index

[PATCH v2 5/5] virsh: add support for '--validate' option in create network

2021-09-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- docs/manpages/virsh.rst | 4 +++- tools/virsh-network.c | 13 - 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index ce98283ae3..48d6ab54df 100644 --- a/docs/manpages/virsh.rst

[PATCH v2 3/5] api: add virNetworkCreateFlags

2021-09-15 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- include/libvirt/libvirt-network.h | 4 src/libvirt-network.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-network.h b/include/libvirt/libvirt-network.h index e505c3eb7e..398d8fccd4 100644 ---

[PATCH v2 1/5] api: add public virNetworkCreateXMLFlags() and remote protocol

2021-09-15 Thread Kristina Hanicova
This new API creates network with given flags. Signed-off-by: Kristina Hanicova --- include/libvirt/libvirt-network.h | 3 +++ src/driver-network.h | 6 + src/libvirt-network.c | 41 +++ src/libvirt_public.syms | 1 +

[PATCH v2 0/5] network create: add support for validation against schema

2021-09-15 Thread Kristina Hanicova
This is v2 of: https://listman.redhat.com/archives/libvir-list/2021-August/msg00871.html diff to v1: - rebased onto the current master - changed the way of working with flags to make the code more readable (suggested by Jano and Daniel). I added a comment in one case when it was not possible

Re: [PATCH 07/22] qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'

2021-09-15 Thread Peter Krempa
On Wed, Sep 15, 2021 at 10:57:23 +0100, Daniel P. Berrangé wrote: > On Wed, Sep 15, 2021 at 11:47:04AM +0200, Christian Borntraeger wrote: > > > > > > On 15.09.21 11:45, Christian Borntraeger wrote: > > > On 24.08.21 16:44, Peter Krempa wrote: > > > > The qemu driver didn't ever implement any

Re: [PATCH 07/22] qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'

2021-09-15 Thread Daniel P . Berrangé
On Wed, Sep 15, 2021 at 11:47:04AM +0200, Christian Borntraeger wrote: > > > On 15.09.21 11:45, Christian Borntraeger wrote: > > On 24.08.21 16:44, Peter Krempa wrote: > > > The qemu driver didn't ever implement any meaningful handling for the > > > 'preserve' action. > > > > > > Forbid the

Re: [PATCH 07/22] qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'

2021-09-15 Thread Christian Borntraeger
On 15.09.21 11:45, Christian Borntraeger wrote: On 24.08.21 16:44, Peter Krempa wrote: The qemu driver didn't ever implement any meaningful handling for the 'preserve' action. Forbid the flag in the qemu def validator and update the documentation to be factual. Signed-off-by: Peter Krempa

Re: [PATCH 07/22] qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'

2021-09-15 Thread Christian Borntraeger
On 24.08.21 16:44, Peter Krempa wrote: The qemu driver didn't ever implement any meaningful handling for the 'preserve' action. Forbid the flag in the qemu def validator and update the documentation to be factual. Signed-off-by: Peter Krempa NACK. It is a perfectly sane usecase to have

Re: [PATCH 1/1] qemu_tpm: Start swtpm(8) daemon with --terminate switch

2021-09-15 Thread Michal Prívozník
On 9/14/21 7:34 PM, Nick Chevsky wrote: > Hi Michal, > >> The patch is correct, but what we already have is qemuExtDevicesStop() >> being called from qemuProcessStop(). The former will eventually call >> qemuTPMEmulatorStop() which should kill the swtmp process, shouldn't it? > > I'd missed this

Re: [PATCH v5 05/16] qemu: Build command line for virtio-mem

2021-09-15 Thread Jing Qi
Hi Michal, I tried to test the virtio-mem with upstream version v7.7.0-136-g9b49c2c6d3 adding the current patch (with qemu-6.1.0-7.fc36.x86_64) - 8388608 1179648 1179648 qemu64 ... 0 2048 131072