[libvirt PATCH v3 7/7] virsh: add nodedev-info

2021-08-20 Thread Jonathon Jongsma
This is currently the only way to view the 'autostart' property for a node device in virsh. Signed-off-by: Jonathon Jongsma Reviewed-by: Daniel P. Berrangé --- docs/manpages/virsh.rst | 12 tools/virsh-nodedev.c | 68 + 2 files changed, 80 inse

[libvirt PATCH v3 6/7] nodedev: Implement virNodeDeviceIsPersistent()/IsActive()

2021-08-20 Thread Jonathon Jongsma
Implement these new API functions in the nodedev driver. Signed-off-by: Jonathon Jongsma Reviewed-by: Daniel P. Berrangé --- src/node_device/node_device_driver.c | 50 src/node_device/node_device_driver.h | 6 src/node_device/node_device_udev.c | 10 --

[libvirt PATCH v3 4/7] virsh: add nodedev-autostart

2021-08-20 Thread Jonathon Jongsma
Add ability to set node devices to autostart on boot or parent device availability. Signed-off-by: Jonathon Jongsma Reviewed-by: Daniel P. Berrangé --- docs/manpages/virsh.rst | 15 + tools/virsh-nodedev.c | 71 + 2 files changed, 86 insertions(

[libvirt PATCH v3 3/7] nodedev: Add tests for mdevctl autostart command

2021-08-20 Thread Jonathon Jongsma
Signed-off-by: Jonathon Jongsma Reviewed-by: Daniel P. Berrangé --- .../nodedevmdevctldata/mdevctl-autostart.argv | 8 +++ tests/nodedevmdevctltest.c| 55 +++ 2 files changed, 63 insertions(+) create mode 100644 tests/nodedevmdevctldata/mdevctl-autostart.arg

[libvirt PATCH v3 2/7] nodedev: implement virNodeDevice(Get|Set)Autostart()

2021-08-20 Thread Jonathon Jongsma
Implement autostart functionality for mediated devices. Signed-off-by: Jonathon Jongsma --- src/conf/node_device_conf.h | 1 + src/conf/virnodedeviceobj.c | 16 +++ src/conf/virnodedeviceobj.h | 6 ++ src/libvirt_private.syms | 2 + src/node_device/n

[libvirt PATCH v3 5/7] api: add virNodeDeviceIsPersistent()/IsActive()

2021-08-20 Thread Jonathon Jongsma
These two public APIs are implemented for almost all other objects that have a concept of persistent definition and activatability. Now that we have node devices (mdevs) that can be defined and inactive, it will be useful to query the persistent/active state of node devices as well. Signed-off-by:

[libvirt PATCH v3 1/7] api: add virNodeDevice(Get|Set)Autostart()

2021-08-20 Thread Jonathon Jongsma
This will allow persistent mediated devices to be configured to be restarted automatically when the host reboots. Signed-off-by: Jonathon Jongsma Reviewed-by: Daniel P. Berrangé --- include/libvirt/libvirt-nodedev.h | 6 +++ src/driver-nodedev.h | 10 src/libvirt-nodedev.c

[libvirt PATCH v3 0/7] Enable autostarting mediated devices

2021-08-20 Thread Jonathon Jongsma
This first version of this series was reviewed quite a while ago and all patches were ACKed except the second one. I posted a second series with changes noted below but it was never ACKed and I dropped the ball for a little while. Subsequently there were questions about whether physical devices (e

Re: [PATCH 2/2] qemu: never unlink() the core dump output file

2021-08-20 Thread Simon Rowe
I have an alternative patch which does this, I'll submit that instead. Simon From: Michal Prívozník Sent: 20 August 2021 16:09 To: Simon Rowe ; libvir-list@redhat.com Subject: Re: [PATCH 2/2] qemu: never unlink() the core dump output file On 8/20/21 10:39 AM, S

Re: [PATCH 1/2] iohelper: skip lseek() and ftruncate() on block devices

2021-08-20 Thread Simon Rowe
I can change to doing this if it preferred, Simon From: Michal Prívozník Sent: 20 August 2021 16:09 To: Simon Rowe ; libvir-list@redhat.com Subject: Re: [PATCH 1/2] iohelper: skip lseek() and ftruncate() on block devices On 8/20/21 10:39 AM, Simon Rowe wrote: >

Re: [PATCH 2/2] qemu: never unlink() the core dump output file

2021-08-20 Thread Michal Prívozník
On 8/20/21 10:39 AM, Simon Rowe wrote: > The comment above virQEMUFileOpenAs() implies any result should be > left intact. > > Signed-off-by: Simon Rowe > --- > src/qemu/qemu_driver.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > ind

Re: [PATCH 1/2] iohelper: skip lseek() and ftruncate() on block devices

2021-08-20 Thread Michal Prívozník
On 8/20/21 10:39 AM, Simon Rowe wrote: > Signed-off-by: Simon Rowe > --- > src/util/iohelper.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/src/util/iohelper.c b/src/util/iohelper.c > index b8810d16d3..e6eb178fde 100644 > --- a/src/util/iohelper.c > +++ b/s

Re: [libvirt PATCH 0/9] tests: cputest: use g_auto more (glib chronicles)

2021-08-20 Thread Michal Prívozník
On 8/20/21 4:48 PM, Ján Tomko wrote: > Also improve the compilation times (unoptimized optimization routines > take too long when there are too many branches in a function, which > is the case of cputest's main) and switch qemuxml2* to use the same > approach. > > Ján Tomko (9): > qemu: monitor:

[libvirt PATCH 9/9] tests: qemuxml2*test: switch to virRunTestLog

2021-08-20 Thread Ján Tomko
This essentially reverts: commit ca5c8e1dc7801854d856cfc62f2054ae753a40c3 qemuxml2argvtest: Avoid conditions in test macro Signed-off-by: Ján Tomko --- tests/qemustatusxml2xmltest.c | 3 +-- tests/qemuxml2argvtest.c | 10 ++ tests/qemuxml2xmltest.c | 9 +++-- tests/t

[libvirt PATCH 6/9] tests: cputest: use g_autofree

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/cputest.c | 58 - 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 9fd5b38b78..2dc7e2e5ae 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -138,8 +138,8 @

[libvirt PATCH 7/9] tests: cputest: remove unnecessary labels

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/cputest.c | 72 +++-- 1 file changed, 22 insertions(+), 50 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 2dc7e2e5ae..c8030be093 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -140,21 +140,17

[libvirt PATCH 8/9] tests: cputests: introduce and use virTestRunLog

2021-08-20 Thread Ján Tomko
A helper that resets the log before each test and prints it on failure. It also takes the return variable as an argument, so it can be used to eliminate number of branches the compiler has to consider in the main function. Signed-off-by: Ján Tomko --- tests/cputest.c | 14 +- test

[libvirt PATCH 3/9] tests: cputest: use g_auto for virQEMUCaps

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/cputest.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index a87aaa64d0..78521a5cf9 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -514,7 +514,7 @@ static int cpuTestGetCPUModels(const s

[libvirt PATCH 1/9] qemu: monitor: define cleanup function for qemuMonitorCPUModelInfo

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/qemu/qemu_monitor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index f2659d650e..8af271dc96 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1214,6 +1214,7 @@ int qemuMonitorGetCPUMod

[libvirt PATCH 5/9] tests: cputest: use g_auto for virCPUDef

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/cputest.c | 36 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 5cf6db9be3..9fd5b38b78 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -193,8 +193,8 @@ cpuTestComp

[libvirt PATCH 4/9] tests: cputest: use g_auto for virCPUData

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/cputest.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 78521a5cf9..5cf6db9be3 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -404,7 +404,7 @@ cpuTestHasFeature(const void *

[libvirt PATCH 2/9] tests: use g_auto in cpuTestMakeQEMUCaps

2021-08-20 Thread Ján Tomko
Refactor to use automatic cleanup and remove the goto's. Signed-off-by: Ján Tomko --- tests/cputest.c | 31 ++- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 7816de87f7..a87aaa64d0 100644 --- a/tests/cputest.c

[libvirt PATCH 0/9] tests: cputest: use g_auto more (glib chronicles)

2021-08-20 Thread Ján Tomko
Also improve the compilation times (unoptimized optimization routines take too long when there are too many branches in a function, which is the case of cputest's main) and switch qemuxml2* to use the same approach. Ján Tomko (9): qemu: monitor: define cleanup function for qemuMonitorCPUModelInf

Re: [libvirt PATCH 0/5] virnetdevopenvswitch: fix overindented label (glib chronicles)

2021-08-20 Thread Michal Prívozník
On 8/20/21 3:15 PM, Ján Tomko wrote: > By removing it, of course. > > Patch 1/5 also has the potential to fix the build on FreeBSD, but > it failed with an internal server error for me. > > Ján Tomko (5): > build: only build virnetdevopenvswitchtest on Linux > tests: virnetdevopenvswitch: use

Re: [PATCH 1/6] api: add public virNWFilterDefineXMLFlags() and remote protocol

2021-08-20 Thread Michal Prívozník
On 8/20/21 1:57 PM, Kristina Hanicova wrote: > This new API function allows to define nwfilter with given flags. > > Signed-off-by: Kristina Hanicova > --- > include/libvirt/libvirt-nwfilter.h | 3 +++ > src/driver-nwfilter.h | 6 + > src/libvirt-nwfilter.c | 43 ++

Re: [PATCH 2/6] nwfilter: add nwfilterDefineXMLFlags()

2021-08-20 Thread Michal Prívozník
On 8/20/21 1:57 PM, Kristina Hanicova wrote: > I have added a new driver function which allows to define > nwfilter with given flags. I have also replaced definition of > nwfilterDefineXML() with function call to the new function. > > Signed-off-by: Kristina Hanicova > --- > src/nwfilter/nwfilte

Re: [PATCH 3/6] api: add virNWFilterDefineFlags

2021-08-20 Thread Michal Prívozník
On 8/20/21 1:57 PM, Kristina Hanicova wrote: > Signed-off-by: Kristina Hanicova > --- > include/libvirt/libvirt-nwfilter.h | 4 > src/libvirt-nwfilter.c | 4 ++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/include/libvirt/libvirt-nwfilter.h > b/include/

Re: [PATCH 0/6] nwfilter define: add support for validation against schema

2021-08-20 Thread Michal Prívozník
On 8/20/21 1:57 PM, Kristina Hanicova wrote: > > Kristina Hanicova (6): > api: add public virNWFilterDefineXMLFlags() and remote protocol > nwfilter: add nwfilterDefineXMLFlags() > api: add virNWFilterDefineFlags > nwfilter_conf: add validation against schema in define > nwfilter_driver:

Re: [PATCH 2/4] conf: add validation and propagate flags into virInterfaceDefParse()

2021-08-20 Thread Ján Tomko
On a Friday in 2021, Kristina Hanicova wrote: We need to know if validation flag is present in order to validate given XML against schema in virXMLParse(). Signed-off-by: Kristina Hanicova --- src/conf/interface_conf.c | 14 -- src/conf/interface_conf.h |

Re: [PATCH 0/4] interface define: add support for validation against schema

2021-08-20 Thread Ján Tomko
On a Friday in 2021, Kristina Hanicova wrote: Kristina Hanicova (4): api: add virInterfaceDefineFlags conf: add validation and propagate flags into virInterfaceDefParse() src: allow validation flag in interface define virsh: add support for '--validate' option in define interface docs/manpa

Re: [PATCH 0/4] secret define: add support for validation against schema

2021-08-20 Thread Ján Tomko
On a Friday in 2021, Kristina Hanicova wrote: Kristina Hanicova (4): api: add virSecretDefineFlags secret_conf: add validation against schema in define secret_driver: allow VIR_SECRET_DEFINE_VALIDATE flag virsh: add support for '--validate' option in define secret docs/manpages/virsh.rst

[libvirt PATCH 2/5] tests: virnetdevopenvswitch: use g_auto

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/virnetdevopenvswitchtest.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/virnetdevopenvswitchtest.c b/tests/virnetdevopenvswitchtest.c index 8c5034a5c6..89ffc1e4b5 100644 --- a/tests/virnetdevopenvswitchtest.c +++ b/tests

[libvirt PATCH 4/5] tests: introduce testVirNetDevBandwidthParse

2021-08-20 Thread Ján Tomko
The 'PARSE' macro does not use '#' or '##' directives, or anything from outside of the macro other than the cleanup label. Turn it into a function. Signed-off-by: Ján Tomko --- tests/virnetdevbandwidthtest.c | 44 tests/virnetdevopenvswitchtest.c | 44

[libvirt PATCH 5/5] tests: virnetdev*: remove unnecessary labels

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/virnetdevbandwidthtest.c | 9 +++-- tests/virnetdevopenvswitchtest.c | 18 ++ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index a17737ec40..eb4f47dfce 1006

[libvirt PATCH 3/5] tests: virnetdevbandwidthtest: use g_auto

2021-08-20 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/virnetdevbandwidthtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index 83e7b2089f..197d936479 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidth

[libvirt PATCH 1/5] build: only build virnetdevopenvswitchtest on Linux

2021-08-20 Thread Ján Tomko
Now that it uses virnetdevbandwidthmock which we only build on Linux. Fixes: eb55e8a897a8c9d68664daa213b1a76b0cb3c05d Signed-off-by: Ján Tomko --- tests/meson.build | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/meson.build b/tests/meson.build index 3c73cbe3b5..df

[libvirt PATCH 0/5] virnetdevopenvswitch: fix overindented label (glib chronicles)

2021-08-20 Thread Ján Tomko
By removing it, of course. Patch 1/5 also has the potential to fix the build on FreeBSD, but it failed with an internal server error for me. Ján Tomko (5): build: only build virnetdevopenvswitchtest on Linux tests: virnetdevopenvswitch: use g_auto tests: virnetdevbandwidthtest: use g_auto

Re: [RFC PATCH 05/10] qemu_capabilities: Added capability for qemu's "ebpf_rss_fds".

2021-08-20 Thread Michal Prívozník
On 8/20/21 2:57 PM, Michal Prívozník wrote: > On 7/28/21 10:17 AM, Andrew Melnychenko wrote: >> Added check for qemu virtio-net "ebpf_rss_fds" property. >> This property allows to pass eBPF program/map file descriptors for RSS >> program. >> In other patches, libvirt may launch qemu-ebpf-rss-helpe

Re: [RFC PATCH 01/10] domain_conf: Added configs for RSS and Hash report.

2021-08-20 Thread Michal Prívozník
On 7/28/21 10:17 AM, Andrew Melnychenko wrote: > Added "rss" and "rss_hash_report" configuration that should be used with > qemu virtio RSS. > Both options are triswitches. Used as "driver" options and affects only NIC > with model type "virtio". > In other patches - options should turn on virtio-n

Re: [RFC PATCH 02/10] qemu_capabilities: Added capabilites for qemu's "rss" and "hash".

2021-08-20 Thread Michal Prívozník
On 7/28/21 10:17 AM, Andrew Melnychenko wrote: > Added qemu's property check for virtio-net. > And added capability QEMU_CAPS_VIRTIO_RSS. > With "rss" and "rss_hash_report" from domain config, > qemu should enable "rss" and "hash" for virtio-net. > > Signed-off-by: Andrew Melnychenko > --- > src

Re: [RFC PATCH 03/10] qemu_command: Added "rss" and "hash" properties.

2021-08-20 Thread Michal Prívozník
On 7/28/21 10:17 AM, Andrew Melnychenko wrote: > If domain config contains "rss" and/or "rss_hash_report" options for driver. > Also if the qemu has device capabilities for RSS. Libvirt will create an NIC > device > command line with enabled "rss"/"hash". > > Signed-off-by: Andrew Melnychenko >

Re: [RFC PATCH 06/10] qemu_capabilities: Added capability for ebpf helper path.

2021-08-20 Thread Michal Prívozník
On 7/28/21 10:17 AM, Andrew Melnychenko wrote: > Added qmp call to receive helper path. > Also added monitor functions. > For virQEMUCaps added field for helper path. > Libvirt queries "query-helper-paths" from qmp and saves in qemuCaps. > The qemu and the helper should be "sync" and the helper sho

Re: [RFC PATCH 07/10] qemu_interface: Added ebpf helper call.

2021-08-20 Thread Michal Prívozník
On 7/28/21 10:17 AM, Andrew Melnychenko wrote: > New function to call "qemu-ebpf-rss-helper". > The helper passes few fds through unix socket. > Technically libvirt should not be aware how many and what those fds. > The helper should return fds that should be passed to the qemu as is and in > same

Re: [RFC PATCH 04/10] virsocket: Added receive for multiple fds.

2021-08-20 Thread Michal Prívozník
On 7/28/21 10:17 AM, Andrew Melnychenko wrote: > Similar to virSocketRecvFD() added virSocketRecvMultipleFDs(). > This function returns multiple fds through unix socket. > New function is required for "qemu-ebpf-rss-helper" program. > The helper may pass few file descriptors - eBPF program and maps

Re: [RFC PATCH 05/10] qemu_capabilities: Added capability for qemu's "ebpf_rss_fds".

2021-08-20 Thread Michal Prívozník
On 7/28/21 10:17 AM, Andrew Melnychenko wrote: > Added check for qemu virtio-net "ebpf_rss_fds" property. > This property allows to pass eBPF program/map file descriptors for RSS > program. > In other patches, libvirt may launch qemu-ebpf-rss-helper and pass fds > to virtio-net qemu. > > Signed-o

Re: [RFC PATCH 08/10] qemu_command: Added ebpf RSS helper call for NIC creation.

2021-08-20 Thread Michal Prívozník
On 7/28/21 10:17 AM, Andrew Melnychenko wrote: > The helper called before NIC string creation. EBPF fds passed to the child > process. > The helper called if qemu supports "ebpf_rss_fds" and returns the helper path. > If libvirt can't retrieve fds from the helper, qemu will be launched > without "

[PATCH v2 04/12] test_driver: Implement virDomainDetachDeviceAlias

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 5e4d6d37ef..6cabf78e7c 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9737,6 +9737,16 @@ testDomainDetach

[PATCH v2 01/12] conf: Introduce virDomainInputDefRemove and fix memory leak

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 12 src/conf/domain_conf.h | 2 ++ src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 10effd

[PATCH v2 09/12] test_driver: add memballoon support for testDomainDetachDeviceLiveAndConfig

2021-08-20 Thread Luke Yue
As the memballoon device shouldn't be hot-(un)pluggable, so error if try to remove it on a running domain, for removing from config, it's fine. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 18 ++ src/hypervisor/domain_driver.h | 3 +++ src/libvirt_private.syms

[PATCH v2 08/12] conf: Add a memballoon helper for future use

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 24 src/conf/domain_conf.h | 4 src/libvirt_private.syms | 1 + 3 files changed, 29 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7f3d207a3e..62bb6669e8 100644 --- a/src/co

[PATCH v2 03/12] test_driver: Implement virDomainDetachDeviceFlags

2021-08-20 Thread Luke Yue
Introduce testDomainChgDevice for further development (just like what we did for IOThread). And introduce testDomainDetachDeviceLiveAndConfig for detaching devices. Signed-off-by: Luke Yue --- src/test/test_driver.c | 201 + 1 file changed, 201 insertions(

[PATCH v2 00/12] Implement detach device related APIs for test driver

2021-08-20 Thread Luke Yue
v2: - Extract DetachXXXDeviceConfig functions from drivers and use them - Add a trial implementation of detach memballoon and TPM, if they are fine, more device support will be added to test driver in the future - Add expectError to testCompareOutputLit for some "fail on purpose" tests - Refine tes

[PATCH v2 11/12] virshtest: add expectError parameter to testCompareOutputLit

2021-08-20 Thread Luke Yue
Add expectError so that we can failed some test on purpose and compare the error message. There are some problems though, if the command raise an internal error, the test would fail. And when testing command is failed on purpose, the error message will be printed even the test passed. Signed-off-

[PATCH v2 12/12] tests: Test detach-device and detach-device-alias for test driver

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- tests/virshtest.c | 78 +++ 1 file changed, 78 insertions(+) diff --git a/tests/virshtest.c b/tests/virshtest.c index 0d2ffd960a..c37d24e900 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -159,6 +159,8 @@ static c

[PATCH v2 10/12] examples: xml: test: add xml for testing devices related APIs

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- examples/xml/test/testdevcontroller.xml | 1 + examples/xml/test/testdevdiskcdrom.xml | 5 +++ examples/xml/test/testdevfs.xml | 6 +++ examples/xml/test/testdevhostdev.xml| 5 +++ examples/xml/test/testdevif.xml | 6 +++ examples/xml/test/tes

[PATCH v2 07/12] test_driver: add TPM support for testDomainDetachDeviceLiveAndConfig

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 18 ++ src/hypervisor/domain_driver.h | 3 +++ src/libvirt_private.syms | 1 + src/test/test_driver.c | 7 ++- 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/hypervisor/domain_dri

[PATCH v2 06/12] conf: Add tpm helpers for future use

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 67 src/conf/domain_conf.h | 6 src/libvirt_private.syms | 2 ++ 3 files changed, 75 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6667426b9a..7f3d207a3e 10

[PATCH v2 05/12] test_driver: Implement virDomainDetachDevice

2021-08-20 Thread Luke Yue
Signed-off-by: Luke Yue --- src/test/test_driver.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6cabf78e7c..c6aead09c9 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9747,6 +9747,14 @@ testDomainDetachDevi

[PATCH v2 02/12] domain_driver: extract DetachXXXDeviceConfig related functions and use them

2021-08-20 Thread Luke Yue
libxl / lxc / qemu drivers share some common codes in their DomainDetachDeviceConfig functions, so extract them to domain_driver and reuse them. Signed-off-by: Luke Yue --- src/hypervisor/domain_driver.c | 267 + src/hypervisor/domain_driver.h | 41 + src/lib

[PATCH 1/4] api: add virSecretDefineFlags

2021-08-20 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- include/libvirt/libvirt-secret.h | 5 + src/libvirt-secret.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-secret.h b/include/libvirt/libvirt-secret.h index e5aaac9450..b8e53674d8 100644 --- a/inc

[PATCH 4/4] virsh: add support for '--validate' option in define secret

2021-08-20 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- docs/manpages/virsh.rst | 4 +++- tools/virsh-secret.c| 10 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 3eb310d02e..de6d6ee1c2 100644 --- a/docs/manpages/virsh.rst +++

[PATCH 3/4] secret_driver: allow VIR_SECRET_DEFINE_VALIDATE flag

2021-08-20 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/secret/secret_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 6b3f0711aa..43aeae9568 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@

[PATCH 2/4] secret_conf: add validation against schema in define

2021-08-20 Thread Kristina Hanicova
We need to validate the XML against schema if option '--validate' was passed to the virsh command. This patch also includes propagation of flags into the virSecretDefParse() function. Signed-off-by: Kristina Hanicova --- src/conf/secret_conf.c | 13 - src/conf/secret_conf.h |

[PATCH 0/4] secret define: add support for validation against schema

2021-08-20 Thread Kristina Hanicova
Kristina Hanicova (4): api: add virSecretDefineFlags secret_conf: add validation against schema in define secret_driver: allow VIR_SECRET_DEFINE_VALIDATE flag virsh: add support for '--validate' option in define secret docs/manpages/virsh.rst | 4 +++- include/libvirt/libvirt-

Re: [libvirt PATCH 0/2] tests: use g_auto more (glib chronicles)

2021-08-20 Thread Martin Kletzander
On Fri, Aug 20, 2021 at 01:57:53PM +0200, Ján Tomko wrote: Convert two more functions to use automatic cleanup. Ján Tomko (2): tests: use g_auto in testQemuGetCaps tests: use g_auto in qemuTestParseCapabilitiesArch tests/qemucaps2xmltest.c | 16 ++-- tests/testutilsqemu.c| 10 +

Re: [libvirt PATCH 0/2] tests: use g_auto more (glib chronicles)

2021-08-20 Thread Kristina Hanicova
On Fri, Aug 20, 2021 at 2:01 PM Ján Tomko wrote: > Convert two more functions to use automatic cleanup. > > Ján Tomko (2): > tests: use g_auto in testQemuGetCaps > tests: use g_auto in qemuTestParseCapabilitiesArch > > tests/qemucaps2xmltest.c | 16 ++-- > tests/testutilsqemu.c

[libvirt PATCH 2/2] tests: use g_auto in qemuTestParseCapabilitiesArch

2021-08-20 Thread Ján Tomko
Refactor qemuTestParseCapabilitiesArch to use g_auto fro cleanup. Signed-off-by: Ján Tomko --- tests/testutilsqemu.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 81d4a44f9a..ea9a283297 100644 --- a/tests/testut

[PATCH 6/6] virsh: add support for '--validate' option in define nwfilter

2021-08-20 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- docs/manpages/virsh.rst | 5 - tools/virsh-nwfilter.c | 13 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 3eb310d02e..0326a7d015 100644 --- a/docs/manpages/virsh.rst

[PATCH 2/6] nwfilter: add nwfilterDefineXMLFlags()

2021-08-20 Thread Kristina Hanicova
I have added a new driver function which allows to define nwfilter with given flags. I have also replaced definition of nwfilterDefineXML() with function call to the new function. Signed-off-by: Kristina Hanicova --- src/nwfilter/nwfilter_driver.c | 19 --- 1 file changed, 16 ins

[PATCH 0/6] nwfilter define: add support for validation against schema

2021-08-20 Thread Kristina Hanicova
Kristina Hanicova (6): api: add public virNWFilterDefineXMLFlags() and remote protocol nwfilter: add nwfilterDefineXMLFlags() api: add virNWFilterDefineFlags nwfilter_conf: add validation against schema in define nwfilter_driver: allow VIR_NWFILTER_DEFINE_VALIDATE flag virsh: add supp

[libvirt PATCH 1/2] tests: use g_auto in testQemuGetCaps

2021-08-20 Thread Ján Tomko
Refactor testQemuGetCaps to use g_auto for cleanup, remove the error label and use g_steal_pointer for the successful return path. Signed-off-by: Ján Tomko --- tests/qemucaps2xmltest.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/qemucaps2xmltest.c

[libvirt PATCH 0/2] tests: use g_auto more (glib chronicles)

2021-08-20 Thread Ján Tomko
Convert two more functions to use automatic cleanup. Ján Tomko (2): tests: use g_auto in testQemuGetCaps tests: use g_auto in qemuTestParseCapabilitiesArch tests/qemucaps2xmltest.c | 16 ++-- tests/testutilsqemu.c| 10 +++--- 2 files changed, 9 insertions(+), 17 deletions

[PATCH 5/6] nwfilter_driver: allow VIR_NWFILTER_DEFINE_VALIDATE flag

2021-08-20 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/nwfilter/nwfilter_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 4cfdd42a37..d38c5b78e3 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/n

[PATCH 4/6] nwfilter_conf: add validation against schema in define

2021-08-20 Thread Kristina Hanicova
This patch also includes propagation of flags into the virNWFilterDefParse(). Signed-off-by: Kristina Hanicova --- src/conf/nwfilter_conf.c | 13 - src/conf/nwfilter_conf.h | 3 ++- src/nwfilter/nwfilter_driver.c | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-)

[PATCH 3/6] api: add virNWFilterDefineFlags

2021-08-20 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- include/libvirt/libvirt-nwfilter.h | 4 src/libvirt-nwfilter.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/libvirt/libvirt-nwfilter.h b/include/libvirt/libvirt-nwfilter.h index 041b1fc33b..9897df6df6 10064

[PATCH 1/6] api: add public virNWFilterDefineXMLFlags() and remote protocol

2021-08-20 Thread Kristina Hanicova
This new API function allows to define nwfilter with given flags. Signed-off-by: Kristina Hanicova --- include/libvirt/libvirt-nwfilter.h | 3 +++ src/driver-nwfilter.h | 6 + src/libvirt-nwfilter.c | 43 ++ src/libvirt_public.syms

Re: [PATCH 0/2] qemu: block: Use correct format name when formatting overlay of qcow2+luks

2021-08-20 Thread Ján Tomko
On a Friday in 2021, Peter Krempa wrote: see 1/2 saw both Peter Krempa (2): qemu: block: Use correct format name when formatting overlay of qcow2+luks qemublocktest: Add test for creating a qcow2 on top of an luks-encrypted qcow2 src/qemu/qemu_block.c |

Re: [PATCH] virsocket: Don't preserve errno in virSocketRecvFD()

2021-08-20 Thread Ján Tomko
On a Friday in 2021, Michal Privoznik wrote: When setting O_CLOEXEC flag on received FD fails the FD is closed using VIR_FORCE_CLOSE(). But the call is wrapped in errno save which is not necessary because VIR_FORCE_CLOSE() preservers errno *preserves value. Signed-off-by: Michal Privoznik -

[PATCH 2/2] qemublocktest: Add test for creating a qcow2 on top of an luks-encrypted qcow2

2021-08-20 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 1 + .../imagecreate/qcow2-backing-qcow2luks.json | 15 +++ .../imagecreate/qcow2-backing-qcow2luks.xml | 1 + 3 files changed, 17 insertions(+) create mode 100644 tests/qemublocktestdat

[PATCH 1/2] qemu: block: Use correct format name when formatting overlay of qcow2+luks

2021-08-20 Thread Peter Krempa
A logic bug in the code creating overlays on existing images resulted into wrongly using "luks" instead of "qcow2" for the backing format if the backing image is an luks-encrypted qcow2. The special format munging is needed only for raw luks images. In practice the impact is not as critical as to

[PATCH 0/2] qemu: block: Use correct format name when formatting overlay of qcow2+luks

2021-08-20 Thread Peter Krempa
see 1/2 Peter Krempa (2): qemu: block: Use correct format name when formatting overlay of qcow2+luks qemublocktest: Add test for creating a qcow2 on top of an luks-encrypted qcow2 src/qemu/qemu_block.c | 3 ++- tests/qemublocktest.c

[PATCH 4/4] virsh: add support for '--validate' option in define interface

2021-08-20 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- docs/manpages/virsh.rst | 5 +++-- tools/virsh-interface.c | 10 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 3eb310d02e..da812ca5b7 100644 --- a/docs/manpages/virsh.rst +++

[PATCH 3/4] src: allow validation flag in interface define

2021-08-20 Thread Kristina Hanicova
We need to validate the XML against schema if option 'validate' was passed to the 'iface-define' virsh command. For that we need to allow validation flag and propagate flags to parse function. Signed-off-by: Kristina Hanicova --- src/interface/interface_backend_netcf.c | 4 ++-- src/test/test_dr

[PATCH 2/4] conf: add validation and propagate flags into virInterfaceDefParse()

2021-08-20 Thread Kristina Hanicova
We need to know if validation flag is present in order to validate given XML against schema in virXMLParse(). Signed-off-by: Kristina Hanicova --- src/conf/interface_conf.c | 14 -- src/conf/interface_conf.h | 3 ++- src/conf/virinterfaceobj.c

Re: [libvirt PATCH 01/13] security: add SELinux policy for virt

2021-08-20 Thread Daniel P . Berrangé
On Thu, Aug 19, 2021 at 05:23:48PM +0200, Vit Mojzis wrote: > > On 10. 08. 21 18:35, Daniel P. Berrangé wrote: > > On Tue, Aug 10, 2021 at 10:39:23AM +0200, Pavel Hrdina wrote: > > > On Fri, Aug 06, 2021 at 06:47:58PM +0100, Daniel P. Berrangé wrote: > > > > From: Nikola Knazekova > > > > > > >

[PATCH 1/4] api: add virInterfaceDefineFlags

2021-08-20 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- include/libvirt/libvirt-interface.h | 4 src/libvirt-interface.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-interface.h b/include/libvirt/libvirt-interface.h index 7591c6c7fb..803cb33ffe 1006

[PATCH 0/4] interface define: add support for validation against schema

2021-08-20 Thread Kristina Hanicova
Kristina Hanicova (4): api: add virInterfaceDefineFlags conf: add validation and propagate flags into virInterfaceDefParse() src: allow validation flag in interface define virsh: add support for '--validate' option in define interface docs/manpages/virsh.rst | 5 +++--

Re: [PATCH 2/2] docs/about: Unify the subject format

2021-08-20 Thread Cornelia Huck
On Fri, Aug 20 2021, Yanan Wang wrote: > Unify the subject format in deprecated.rst to "since X.Y". > Unify the subject format in removed-features.rst to "removed in X.Y". It seems unlikely that we will ever deprecate something in a stable release, and even more unlikely that we'll remove someth

RE: [PATCH RFC v6 08/12] target/riscv: Handle KVM_EXIT_RISCV_SBI exit

2021-08-20 Thread Jiangyifei
> -Original Message- > From: Qemu-riscv > [mailto:qemu-riscv-bounces+jiangyifei=huawei@nongnu.org] On Behalf Of > Alistair Francis > Sent: Thursday, August 19, 2021 2:14 PM > To: Jiangyifei > Cc: Anup Patel ; open list:RISC-V > ; open list:Overall ; > limingwang (A) ; libvir-list@red

[PATCH] virsocket: Don't preserve errno in virSocketRecvFD()

2021-08-20 Thread Michal Privoznik
When setting O_CLOEXEC flag on received FD fails the FD is closed using VIR_FORCE_CLOSE(). But the call is wrapped in errno save which is not necessary because VIR_FORCE_CLOSE() preservers errno value. Signed-off-by: Michal Privoznik --- src/util/virsocket.c | 2 -- 1 file changed, 2 deletions(-

[PATCH 1/2] iohelper: skip lseek() and ftruncate() on block devices

2021-08-20 Thread Simon Rowe
Signed-off-by: Simon Rowe --- src/util/iohelper.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/iohelper.c b/src/util/iohelper.c index b8810d16d3..e6eb178fde 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -28,6 +28,8 @@ #include #include

[PATCH 2/2] qemu: never unlink() the core dump output file

2021-08-20 Thread Simon Rowe
The comment above virQEMUFileOpenAs() implies any result should be left intact. Signed-off-by: Simon Rowe --- src/qemu/qemu_driver.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f31e13889e..b1ac1cb73b 100644 --- a/src/qemu/qemu_driver

[PATCH 0/2] Support VM core dump to block device

2021-08-20 Thread Simon Rowe
When the destination of a VM core dump is a block device (e.g. NBD) avoid file operations that are unnecessary. Simon Rowe (2): iohelper: skip lseek() and ftruncate() on block devices qemu: never unlink() the core dump output file src/qemu/qemu_driver.c | 2 -- src/util/iohelper.c| 10 +

Re: [libvirt][PATCH v6 6/6] add qemu capabilities version 5.2.0

2021-08-20 Thread Peter Krempa
On Fri, Aug 20, 2021 at 14:15:06 +0800, Haibin Huang wrote: > Signed-off-by: Haibin Huang > --- > docs/schemas/domaincaps.rng | 4 +- > .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 207 + > .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 201 + > tests/domaincapsdata/