[PATCH v2] Add VM info to improve error log message for qemu monitor

2021-12-22 Thread Rohit Kumar
This patch is to determine the VM which had IO or socket hangup error. Accessing directly vm->def->name inside qemuMonitorIO() or qemuMonitorSend() might leads to illegal access as we are out of 'vm' context and vm->def might not exist. Adding a field "domainName" inside mon object to access vm

Re: [PATCH v3 10/12] target/riscv: Add kvm_riscv_get/put_regs_timer

2021-12-22 Thread Anup Patel
On Mon, Dec 20, 2021 at 6:39 PM Yifei Jiang wrote: > > Add kvm_riscv_get/put_regs_timer to synchronize virtual time context > from KVM. > > To set register of RISCV_TIMER_REG(state) will occur a error from KVM > on kvm_timer_state == 0. It's better to adapt in KVM, but it doesn't matter > that

Re: [PATCH v3 07/12] target/riscv: Support setting external interrupt by KVM

2021-12-22 Thread Anup Patel
On Mon, Dec 20, 2021 at 6:39 PM Yifei Jiang wrote: > > When KVM is enabled, set the S-mode external interrupt through > kvm_riscv_set_irq function. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis Looks good to me. Reviewed-by: Anup Patel Regards,

Re: [PATCH v3 06/12] target/riscv: Support start kernel directly by KVM

2021-12-22 Thread Anup Patel
On Thu, Dec 23, 2021 at 11:33 AM Anup Patel wrote: > > On Mon, Dec 20, 2021 at 6:39 PM Yifei Jiang wrote: > > > > Get kernel and fdt start address in virt.c, and pass them to KVM > > when cpu reset. Add kvm_riscv.h to place riscv specific interface. > > > > In addition, PLIC is created without

Re: [PATCH v3 06/12] target/riscv: Support start kernel directly by KVM

2021-12-22 Thread Anup Patel
On Mon, Dec 20, 2021 at 6:39 PM Yifei Jiang wrote: > > Get kernel and fdt start address in virt.c, and pass them to KVM > when cpu reset. Add kvm_riscv.h to place riscv specific interface. > > In addition, PLIC is created without M-mode PLIC contexts when KVM > is enabled. > > Signed-off-by:

Re: [PATCH 0/5] tests: Tool for programatic modification of qemucapabilitiesdata/*.replies

2021-12-22 Thread Ján Tomko
On a Wednesday in 2021, Peter Krempa wrote: I was asked multiple times how to automate modification of the qemu capability dumps. I wrote a tool [1] that allowed doing that. Unfortunately as it wasn't in the repo it was not avalilable. Now I've finally set out to finish it. It masquerades as a

[libvirt PATCH v3 16/16] docs: document type dbus

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- NEWS.rst | 7 ++- docs/formatdomain.rst | 43 ++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index e7d53167219f..92042459653d 100644

[libvirt PATCH v3 15/16] qemu: add usbredir type 'dbus'

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau The USB device redirection works in a similar way as Spice. The underlying 'dbus' channel is set to "org.qemu.usbredir" by default for the client to identify the channel purpose (as specified in -display dbus documentation). Signed-off-by: Marc-André Lureau ---

[libvirt PATCH v3 14/16] qemu: add -chardev dbus support

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c | 4 +++ src/qemu/qemu_monitor_json.c | 9 ++ .../graphics-dbus-chardev.args| 32 +++ tests/qemuxml2argvtest.c

[libvirt PATCH v3 13/16] conf: add

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Like a Spice port, a dbus serial must specify an associated channel name. Signed-off-by: Marc-André Lureau --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c| 26 +++ src/conf/domain_conf.h

[libvirt PATCH v3 12/16] qemu: add dbus clipboard sharing

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau This feature requires to setup a "-chardev qemu-vdagent,clipboard=on". "qemu-vdagent" is not a typical chardev that you can connect to another end, so it doesn't map to a or . Set it up along with "-display dbus" code instead. Signed-off-by: Marc-André Lureau ---

[libvirt PATCH v3 11/16] conf: add dbus

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/schemas/domaincommon.rng | 8 + src/conf/domain_conf.c| 13 ++- src/conf/domain_conf.h| 1 + .../graphics-dbus-clipboard.xml | 35

[libvirt PATCH v3 06/16] qemu: add -display dbus support

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau By default, libvirt will start a private bus and tell QEMU to connect to it. Instead, a D-Bus "address" to connect to can be specified, or the p2p mode enabled. D-Bus display works best with GL & a rendernode, which can be specified with child element. Signed-off-by:

[libvirt PATCH v3 10/16] qemu: add audio type 'dbus'

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c | 12 +-- src/qemu/qemu_validate.c | 30 - .../qemuxml2argvdata/graphics-dbus-audio.args | 33 +++ tests/qemuxml2argvtest.c

[libvirt PATCH v3 09/16] conf: add support

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/schemas/domaincommon.rng | 29 src/bhyve/bhyve_command.c | 1 + src/conf/domain_conf.c| 34 +++--- src/conf/domain_conf.h|

[libvirt PATCH v3 08/16] virsh: report the D-Bus bus URI for domdisplay

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau This implementation reports only Unix bus address using the URI format proposed in https://gitlab.freedesktop.org/dbus/dbus/-/issues/348. We prefer a URI form over the D-Bus address form, since all other display protocols use a URI, allowing to distinguish between

[libvirt PATCH v3 07/16] virsh: refactor/split cmdDomDisplay()

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau The function is large and quite complex. Move the inner loop for each scheme in a separate function cmdDomDisplayScheme(). Signed-off-by: Marc-André Lureau --- tools/virsh-domain.c | 341 +-- 1 file changed, 169 insertions(+),

[libvirt PATCH v3 05/16] qemu: start the D-Bus daemon for the display

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Start the daemon if necessary (it is already stopped in qemuProcessStop) Signed-off-by: Marc-André Lureau --- src/qemu/qemu_extdevice.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index

[libvirt PATCH v3 04/16] conf: add

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/schemas/basictypes.rng | 7 ++ docs/schemas/domaincommon.rng | 33 src/conf/domain_conf.c| 78 ++- src/conf/domain_conf.h

[libvirt PATCH v3 02/16] qemu: add -display dbus capability check

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 1cf56ace71b2..f6ba51229841 100644 ---

[libvirt PATCH v3 01/16] qemu: add chardev-vdagent capability check

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 +

[libvirt PATCH v3 00/16] Add QEMU "-display dbus" support

2021-12-22 Thread marcandre . lureau
From: Marc-André Lureau Hi, This series implements supports for the uQEMU "-display dbus" support, that landed earlier this week for 7.0. By default, libvirt will start a private VM bus (sharing and reusing the existing "vmstate" VM bus & code). The feature set should cover the needs to

[PATCH] ci: Refresh dockerfiles

2021-12-22 Thread Peter Krempa
Apart from some churn, the important is the removal of 'netcf-devel' from the fedora rawhide container. Update to state as of 174fe4999204afcae (libvirt-ci). Signed-off-by: Peter Krempa --- Pushed as trivial. It makes CI green again. .../debian-10-cross-aarch64.Dockerfile | 18

Re: [PATCH 2/2] virnettlscontext: Don't pass static key length to gnutls_dh_params_generate2()

2021-12-22 Thread Martin Kletzander
On Wed, Dec 22, 2021 at 02:12:37PM +0100, Ján Tomko wrote: On a Tuesday in 2021, Michal Privoznik wrote: As encryption norms get more strict it's easy to fall on the insecure side. For instance, so far we are generating 2048 bits long prime for Diffie-Hellman keys. Some systems consider this

Re: [PATCH 0/2] gnutls: Be more clever about DH key size

2021-12-22 Thread Martin Kletzander
On Wed, Dec 22, 2021 at 02:14:59PM +0100, Ján Tomko wrote: On a Wednesday in 2021, Martin Kletzander wrote: On Tue, Dec 21, 2021 at 03:22:57PM +0100, Michal Privoznik wrote: See 2/2 for explanation. Ideally, we wouldn't use gnutls_dh_params_generate2() at all, per [1]. But that would require

[PATCH 4/5] tests: Tool for programatic modification of qemucapabilitiesdata/*.replies

2021-12-22 Thread Peter Krempa
The tool is assembled from individual bits used for tests and actual capturing of the replies files. The tool ensures correct numbering and formatting of entries. In normal usage mode it masks as a test which validates formatting and numbering of the tests/qemucapabilitiesdata/*.replies files.

[PATCH 2/5] tests: qemumonitortestutils.h: Reformat header file

2021-12-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/qemumonitortestutils.h | 140 --- 1 file changed, 81 insertions(+), 59 deletions(-) diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index e572627e20..89c33c434b 100644 ---

[PATCH 3/5] qemumonitortestutils: Extract parser for the monitor conversation dump file

2021-12-22 Thread Peter Krempa
Make the parser reusable by extracting it and making it parse into command,reply tuples. Signed-off-by: Peter Krempa --- tests/qemumonitortestutils.c | 123 --- tests/qemumonitortestutils.h | 13 2 files changed, 99 insertions(+), 37 deletions(-) diff

[PATCH 5/5] tests: Remove 'qemucapsfixreplies'

2021-12-22 Thread Peter Krempa
The 'qemucapabilitiesnumbering' tool now replaces the role of this script and provides way to programmatically modify the replies file on top. Signed-off-by: Peter Krempa --- tests/domaincapstest.c | 3 ++- tests/qemucapabilitiestest.c | 4 +++- tests/qemucapsfixreplies | 26

[PATCH 1/5] util: json: Introduce virJSONValueObjectReplaceValue

2021-12-22 Thread Peter Krempa
The new helper replaces the 'value' part of the key-value tuple in an object. The advantage of this new helper is that it preserves the ordering of the key in the object when compared to a combination of stealing the old key and adding a new value. This will be needed for a new test/helper for

[PATCH 0/5] tests: Tool for programatic modification of qemucapabilitiesdata/*.replies

2021-12-22 Thread Peter Krempa
I was asked multiple times how to automate modification of the qemu capability dumps. I wrote a tool [1] that allowed doing that. Unfortunately as it wasn't in the repo it was not avalilable. Now I've finally set out to finish it. It masquerades as a test in default mode checking the ordering and

Re: [PATCH v6 4/4] NEWS: mention removal of sysconfig

2021-12-22 Thread Olaf Hering
Tue, 21 Dec 2021 16:33:11 -0700 Jim Fehlig : > What do you think of the below, slightly reworded variant? As a native speaker you are in the perfect position to formulate a suitable paragraph for the NEWS file. This new variant is certainly fine with me. If it is supposed to go into "Packaging

Re: [PATCH 2/2] virnettlscontext: Don't pass static key length to gnutls_dh_params_generate2()

2021-12-22 Thread Ján Tomko
On a Tuesday in 2021, Michal Privoznik wrote: As encryption norms get more strict it's easy to fall on the insecure side. For instance, so far we are generating 2048 bits long prime for Diffie-Hellman keys. Some systems consider this not long enough. While we may just keep increasing the value

Re: [PATCH 0/2] gnutls: Be more clever about DH key size

2021-12-22 Thread Ján Tomko
On a Wednesday in 2021, Martin Kletzander wrote: On Tue, Dec 21, 2021 at 03:22:57PM +0100, Michal Privoznik wrote: See 2/2 for explanation. Ideally, we wouldn't use gnutls_dh_params_generate2() at all, per [1]. But that would require bumping minimal required version to gnutls-3.6.0 and I'm not

Re: [libvirt PATCH v2] qemu: Fix typo in comment

2021-12-22 Thread Ján Tomko
On a Monday in 2021, Tim Wiederhake wrote: Signed-off-by: Tim Wiederhake --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 0/6] json helper cleanups

2021-12-22 Thread Tim Wiederhake
On Wed, 2021-12-22 at 13:02 +0100, Peter Krempa wrote: > Peter Krempa (6): >   qemuBlockStorageSourceGetRBDProps: Simplify generation of auth > modes >   Replace open coded virJSONValueArrayAppendString >   util: json: Don't copy string in virJSONValueNewString >   util: json: Open-code only call

Re: [PATCH 1/2] virnettlscontext: Drop gnutls_dh_set_prime_bits()

2021-12-22 Thread Ján Tomko
On a Tuesday in 2021, Michal Privoznik wrote: According to the gnutls_dh_set_prime_bits() manpage: The function has no effect in server side. On top of that, it is deprecated as of 3.1.7 while our minimum version is 3.2. Therefore, don't call it when creating server side context.

Re: [PATCH 0/6] json helper cleanups

2021-12-22 Thread Ján Tomko
On a Wednesday in 2021, Peter Krempa wrote: Peter Krempa (6): qemuBlockStorageSourceGetRBDProps: Simplify generation of auth modes Replace open coded virJSONValueArrayAppendString util: json: Don't copy string in virJSONValueNewString util: json: Open-code only call of

Re: [PATCH 0/2] gnutls: Be more clever about DH key size

2021-12-22 Thread Martin Kletzander
On Tue, Dec 21, 2021 at 03:22:57PM +0100, Michal Privoznik wrote: See 2/2 for explanation. Ideally, we wouldn't use gnutls_dh_params_generate2() at all, per [1]. But that would require bumping minimal required version to gnutls-3.6.0 and I'm not sure how available it is in OSes we support.

[PATCH 6/6] util: virjson.h: Reformat headers to conform with new style

2021-12-22 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virjson.h | 312 +++-- 1 file changed, 218 insertions(+), 94 deletions(-) diff --git a/src/util/virjson.h b/src/util/virjson.h index 24ac51f4f8..f0b8c419de 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h

[PATCH 5/6] util: json: Remove virJSONValueIsNull/virJSONValueObjectIsNull

2021-12-22 Thread Peter Krempa
If needed 'virJSONValueIsNull' can be easily replaced by 'virJSONValueGetType(obj) == VIR_JSON_TYPE_NULL'. 'virJSONValueObjectIsNull' has confusing name because it checks that a virJSONValue of OBJECT type has a key which is NULL, not that the object itself is NULL. This can be replaced according

[PATCH 3/6] util: json: Don't copy string in virJSONValueNewString

2021-12-22 Thread Peter Krempa
With 'g_strdup' not needing error handling we can ask callers to pass a copy of the string which will be adopted by the JSON value. Signed-off-by: Peter Krempa --- src/util/virjson.c | 17 +++-- src/util/virjson.h | 2 +- tests/virjsontest.c | 4 ++-- 3 files changed, 10

[PATCH 4/6] util: json: Open-code only call of virJSONValueNewStringLen

2021-12-22 Thread Peter Krempa
Replace the function by a call to virJSONValueNewString, when we copy the string using g_strndup. Remove the unused helper. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/virjson.c | 21 + src/util/virjson.h | 1 - 3 files changed, 1

[PATCH 1/6] qemuBlockStorageSourceGetRBDProps: Simplify generation of auth modes

2021-12-22 Thread Peter Krempa
The auth mode array is static, parse it from a JSON string. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 2e606e99b4..e5ff653a60 100644 ---

[PATCH 2/6] Replace open coded virJSONValueArrayAppendString

2021-12-22 Thread Peter Krempa
In two instances we've created a string virJSONValue just to append it to the array. Replace it by use of the virJSONValueArrayAppendString helper. Signed-off-by: Peter Krempa --- src/qemu/qemu_agent.c | 4 +--- src/util/virmacmap.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)

[PATCH 0/6] json helper cleanups

2021-12-22 Thread Peter Krempa
Peter Krempa (6): qemuBlockStorageSourceGetRBDProps: Simplify generation of auth modes Replace open coded virJSONValueArrayAppendString util: json: Don't copy string in virJSONValueNewString util: json: Open-code only call of virJSONValueNewStringLen util: json: Remove