Re: [libvirt PATCH 00/14] qemu: Improve swtpm internal API

2022-02-04 Thread Ján Tomko
On a Friday in 2022, Andrea Bolognani wrote: Clean up inconsistencies to make navigating the module easier. Andrea Bolognani (14): qemu: Rename qemuExtTPMStartEmulator() qemu: Fully document qemuTPMEmulatorStart() qemu: Rename qemuTPM{Create,Delete}EmulatorStorage() qemu: Document

[libvirt PATCH 14/14] qemu: Move high-level actions close together

2022-02-04 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 245 +++- 1 file changed, 128 insertions(+), 117 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 4c0b42e7ff..50f9caabf3 100644 --- a/src/qemu/qemu_tpm.c +++

[libvirt PATCH 13/14] qemu: Move entry points close together

2022-02-04 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 133 +++- 1 file changed, 71 insertions(+), 62 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 264b9b1d60..4c0b42e7ff 100644 --- a/src/qemu/qemu_tpm.c +++

[libvirt PATCH 10/14] qemu: Call virDomainDefGetShortName() less frequently

2022-02-04 Thread Andrea Bolognani
When looping over TPM devices for a domain, we can avoid calling this function for each iteration and call it once per domain instead. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 41 +++-- 1 file changed, 19 insertions(+), 22 deletions(-) diff

[libvirt PATCH 09/14] qemu: Rename path-building functions

2022-02-04 Thread Andrea Bolognani
Using the word "create" can give users the impression that disk operations will be performed, when in reality all these functions do is string formatting. Follow the naming convention established by virBuildPath(), virFileBuildPath() and virPidFileBuildPath(). Signed-off-by: Andrea Bolognani

[libvirt PATCH 06/14] qemu: Make qemuTPMEmulatorCreateStorage() take a virDomainTPMDef*

2022-02-04 Thread Andrea Bolognani
This matches how qemuTPMEmulatorDeleteStorage() expects to be called. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 127a2c80be..2196b5c567 100644 ---

[libvirt PATCH 00/14] qemu: Improve swtpm internal API

2022-02-04 Thread Andrea Bolognani
Clean up inconsistencies to make navigating the module easier. Andrea Bolognani (14): qemu: Rename qemuExtTPMStartEmulator() qemu: Fully document qemuTPMEmulatorStart() qemu: Rename qemuTPM{Create,Delete}EmulatorStorage() qemu: Document qemuTPMEmulatorDeleteStorage() qemu: Drop

[libvirt PATCH 08/14] qemu: Introduce qemuTPMEmulatorCleanupHost()

2022-02-04 Thread Andrea Bolognani
This leaves qemuExtTPMCleanupHost() to only deal with looping over TPM devices, same as other qemuExtTPMDoThing() functions. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_tpm.c

[libvirt PATCH 02/14] qemu: Fully document qemuTPMEmulatorStart()

2022-02-04 Thread Andrea Bolognani
The @tpm argument was not mentioned. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index c82e5921d7..627c7e631d 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -879,6 +879,7 @@

[libvirt PATCH 07/14] qemu: Introduce qemuExtTPMEmulatorSetupCgroup()

2022-02-04 Thread Andrea Bolognani
This leaves qemuExtTPMSetupCgroup() to only deal with looping over TPM devices, same as other qemuExtTPMDoThing() functions. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 41 - 1 file changed, 32 insertions(+), 9 deletions(-) diff --git

[libvirt PATCH 04/14] qemu: Document qemuTPMEmulatorDeleteStorage()

2022-02-04 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 8d66a2127e..182209bda6 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -166,6 +166,12 @@

[libvirt PATCH 12/14] qemu: Move utility functions close together

2022-02-04 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 124 ++-- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index c0e875627d..264b9b1d60 100644 --- a/src/qemu/qemu_tpm.c +++

[libvirt PATCH 11/14] qemu: Fix description of swtpmStateDir

2022-02-04 Thread Andrea Bolognani
This directory contains runtime state, not persistent state. The latter goes into swtpmStorageDir. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index

[libvirt PATCH 05/14] qemu: Drop qemuTPMEmulatorInitStorage()

2022-02-04 Thread Andrea Bolognani
Absorb it into qemuTPMEmulatorCreateStorage(), its only caller. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 31 ++- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 182209bda6..127a2c80be

[libvirt PATCH 03/14] qemu: Rename qemuTPM{Create, Delete}EmulatorStorage()

2022-02-04 Thread Andrea Bolognani
Other functions that operate on a single TPM emulator follow the qemuTPMEmulatorDoThing() naming convention. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c

[libvirt PATCH 01/14] qemu: Rename qemuExtTPMStartEmulator()

2022-02-04 Thread Andrea Bolognani
Its counterpart is qemuTPMEmulatorStop(). Signed-off-by: Andrea Bolognani --- src/qemu/qemu_tpm.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 9c5d1ffed4..c82e5921d7 100644 --- a/src/qemu/qemu_tpm.c +++

Re: [PATCH 3/3] nodedev: add parent_addr to mdev nodedev dumpxml

2022-02-04 Thread Jonathon Jongsma
On 2/4/22 9:32 AM, Boris Fiuczynski wrote: As the parent address is part of the mdev nodedev name lets expose the internally available parent address in the XML. What is the issue that you're trying to solve here? The mdev xml already has a reference to the name of the parent device. So

Re: [PATCH 0/3] Mdev test cleanup, completion and parent addr exposure

2022-02-04 Thread Michal Prívozník
On 2/4/22 16:32, Boris Fiuczynski wrote: > Clean up the testing json. Add a test for vfio-ccw mdev. > Expose the parent address in the XML when dumping a mdev nodedev as the > address is now part of the mdev nodedev name and users should not parse > and manipulate the mdev nodedev name to retrieve

[libvirt PATCH] docs: remove twitter from the website

2022-02-04 Thread Ján Tomko
Regardless of the platform being mostly advertising, trolling and promoting stupidity [0][1], the link points to the 'libvirt' hashtag which never gained traction or contained useful information. [0] https://news.mit.edu/2018/study-twitter-false-news-travels-faster-true-stories-0308 [1]

[PATCH 1/2] qemu_process: Be nicer to killing QEMU when probing caps

2022-02-04 Thread Michal Privoznik
The qemuProcessQMPStop() function is intended to kill this dummy QEMU process we started only for querying capabilities. Nevertheless, it may be not plain QEMU binary we executed, but in fact it may be a memcheck tool (e.g. valgrind) that executes QEMU later. By switching to

[PATCH 2/2] qemu_process: Start QEMU for caps probing more robustly

2022-02-04 Thread Michal Privoznik
When probing QEMU capabilities, we look at whatever was specified in the domain XML and execute it with couple of arguments (-daemonize being one of them) Then, we use virCommandSetErrorBuffer() to read stderr of the child process hoping to read possible error message just before the process

[PATCH 0/2] qemu_process: Start QEMU for caps probing more robustly

2022-02-04 Thread Michal Privoznik
I'm not going to lie, my true motive is to be able to have a very small bash wrapper that spawns QEMU under valgrind, e.g. like this: #!/bin/bash exec /usr/bin/valgrind --tool=memcheck --leak-check=full \ --track-fds=yes --log-file=/tmp/valgrind_qemu.log \

[PATCH 3/3] nodedev: add parent_addr to mdev nodedev dumpxml

2022-02-04 Thread Boris Fiuczynski
As the parent address is part of the mdev nodedev name lets expose the internally available parent address in the XML. Signed-off-by: Boris Fiuczynski --- docs/schemas/nodedev.rng | 5 + src/conf/node_device_conf.c| 2 ++

[PATCH 2/3] tests: adding vfio-ccw to nodedev tests

2022-02-04 Thread Boris Fiuczynski
Signed-off-by: Boris Fiuczynski --- ...52_9b13_9b13_9b13_cc23009b1326-create.argv | 5 +++ ...52_9b13_9b13_9b13_cc23009b1326-create.json | 1 + ...52_9b13_9b13_9b13_cc23009b1326-define.argv | 5 +++ ...52_9b13_9b13_9b13_cc23009b1326-define.json | 1 + .../mdevctl-list-multiple.json

[PATCH 0/3] Mdev test cleanup, completion and parent addr exposure

2022-02-04 Thread Boris Fiuczynski
Clean up the testing json. Add a test for vfio-ccw mdev. Expose the parent address in the XML when dumping a mdev nodedev as the address is now part of the mdev nodedev name and users should not parse and manipulate the mdev nodedev name to retrieve it. Boris Fiuczynski (3): tests: correct

[PATCH 1/3] tests: correct formating in mdevctl test

2022-02-04 Thread Boris Fiuczynski
Signed-off-by: Boris Fiuczynski --- .../mdevctl-list-multiple.json| 49 ++- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/tests/nodedevmdevctldata/mdevctl-list-multiple.json b/tests/nodedevmdevctldata/mdevctl-list-multiple.json index

Re: [PATCH] qemu: Validate domain definition even on migration

2022-02-04 Thread Peter Krempa
On Mon, Jan 31, 2022 at 13:34:29 +0100, Michal Privoznik wrote: > When we are about to spawn QEMU, we validate the domain > definition against qemuCaps. Except when domain is/was already > running before (i.e. on incoming migration, snapshots, resume > from a file). However, especially on incoming

Re: [PATCH v3 0/3] qemu_tpm: Get swtpm pid without binary validation

2022-02-04 Thread Michal Prívozník
On 2/3/22 18:56, Vasily Ulyanov wrote: > Hi Michal, > > On 03/02/2022 18:09, Michal Prívozník wrote: >> >> Apart from patch 2/3 this looks good. So here's what we are going to do. >> I've uploaded fixup commits onto my gitlab: >> >>