Re: [PATCH 001/103] virJSONValueObjectAddVArgs: Add 'k' convertor for formatting non-negative integers

2021-10-08 Thread Kristina Hanicova
On Thu, Oct 7, 2021 at 6:43 PM Ján Tomko wrote: > On a Thursday in 2021, Peter Krempa wrote: > >In many cases we use a signed value, but use the sign to note that it > >was not assigned. For converting to JSON objects it will be handy to > >have possibility to do this automatically. > > > >Signed

Re: [libvirt PATCH v3 0/5] add interface infomation in guestinfo command

2021-10-08 Thread Lei Zhang
please, any feedback to this patch? On Tue, Sep 14, 2021 at 7:48 PM zhanglei wrote: > > > zhanglei (5): > domain: add interface information to 'virDomainGetGuestInfo' > virsh: add interface information to guestinfo command > qemu: refactor 'qemuAgentGetInterfaces' > qemu: add guest inte

[PATCH] qemucapabilitiestest: Add test data for the qemu-6.2 development cycle

2021-10-08 Thread Peter Krempa
The data is based on commit v6.1.0-1296-g14f12119aa Notable changes: - New machine types for the 6.2 cycle were added - MEM_UNPLUG_ERROR event was deprecated and replaced by DEVICE_UNPLUG_GUEST_ERROR - Intel SGX related commands and devices added - 'copy-before-write' blockdev filter was added

[PATCH 0/2] qemu_migration: set priv->migMaxBandwidth during migration

2021-10-08 Thread Kristina Hanicova
Kristina Hanicova (2): qemu_migration: set bandwidth in priv during migration qemu_migration: drop unnecessary 'migrate_speed' variable src/qemu/qemu_migration.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.31.1

[PATCH 1/2] qemu_migration: set bandwidth in priv during migration

2021-10-08 Thread Kristina Hanicova
We did not set priv->migMaxBandwidth if '--bandwidth' was specified as an option in the 'migrate' virsh command. This caused in printing the wrong value if virsh command 'migrate-getspeed' was called during the migration. This patch first sets the value to the given bandwidth (if one was specified)

[PATCH 2/2] qemu_migration: drop unnecessary 'migrate_speed' variable

2021-10-08 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/qemu/qemu_migration.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 71edcd5c62..48df080c15 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@

[libvirt PATCH v3 0/6] qemu: changes to use feature=on|off syntax for -cpu unconditionally

2021-10-08 Thread Daniel P . Berrangé
Given our min QEMU, it doesn't seem like we need to support either the old "-feature" / "+feature" syntax, nor the bare "feature" syntax. I'm pretty unsure about the last patch in this series, given the impact it had on test data files. If it is indeed ok though, we can delete two capabilities to

[libvirt PATCH v3 4/6] qemu: inline the qemuBuildCpuFeature code

2021-10-08 Thread Daniel P . Berrangé
With the previous refactorings, there's no real benefit from the qemuBuildCpuFeature helper method. Only one of the callers really needs the CPU feature name re-writing logic, the others can just use the right name directly. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_command.c | 31

[libvirt PATCH v3 3/6] qemu: remove use of (+|-)name syntax for -cpu featres

2021-10-08 Thread Daniel P . Berrangé
The -cpu arg gained support for feature=on|off syntax for the x86 emulator in 2.4.0 commit 38e5c119c2925812bd441450ab9e5e00fc79e662 Author: Eduardo Habkost Date: Mon Mar 23 17:29:32 2015 -0300 target-i386: Register QOM properties for feature flags Most other targets gained this synt

[libvirt PATCH v3 1/6] qemu: always translate underscores to hyphens in CPU features

2021-10-08 Thread Daniel P . Berrangé
QEMU switched from using underscores in x86 CPU features to hyphens in the 2.8.0 series with two commits commit fc7dfd205f3287893c436d932a167bffa30579c8 (HEAD, refs/bisect/bad) Author: Eduardo Habkost Date: Fri Sep 30 15:49:40 2016 -0300 target-i386: Remove underscores from feat_name

[libvirt PATCH v3 5/6] qemu: remove use of implicit boolean syntax for guest features

2021-10-08 Thread Daniel P . Berrangé
Some guest features that map to the -cpu arg are still added using implicit syntax "feature" which is a deprecated shorthand for "feature=on". Reviewed-by: Peter Krempa Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_command.c | 6 +++--- tests/qemuxml2ar

[libvirt PATCH v3 2/6] qemu: always use hyphens in hyperv feature names

2021-10-08 Thread Daniel P . Berrangé
QEMU switched from using underscores in x86 CPU features to hyphens in the 2.8.0 series with two commits commit fc7dfd205f3287893c436d932a167bffa30579c8 (HEAD, refs/bisect/bad) Author: Eduardo Habkost Date: Fri Sep 30 15:49:40 2016 -0300 target-i386: Remove underscores from feat_name

Re: [PATCH] qemucapabilitiestest: Add test data for the qemu-6.2 development cycle

2021-10-08 Thread Michal Prívozník
On 10/8/21 9:50 AM, Peter Krempa wrote: > The data is based on commit v6.1.0-1296-g14f12119aa > > Notable changes: > > - New machine types for the 6.2 cycle were added > - MEM_UNPLUG_ERROR event was deprecated and replaced by > DEVICE_UNPLUG_GUEST_ERROR > - Intel SGX related commands and device

Re: [PATCH 1/2] qemu_migration: set bandwidth in priv during migration

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 10:19:04 +0200, Kristina Hanicova wrote: > We did not set priv->migMaxBandwidth if '--bandwidth' was > specified as an option in the 'migrate' virsh command. This > caused in printing the wrong value if virsh command > 'migrate-getspeed' was called during the migration. This

Re: [PATCH 2/2] qemu_migration: drop unnecessary 'migrate_speed' variable

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 10:19:05 +0200, Kristina Hanicova wrote: > Signed-off-by: Kristina Hanicova > --- > src/qemu/qemu_migration.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c > index 71edcd5c62..48df08

Re: [PATCH 1/2] qemu_migration: set bandwidth in priv during migration

2021-10-08 Thread Michal Prívozník
On 10/8/21 12:44 PM, Jiri Denemark wrote: > On Fri, Oct 08, 2021 at 10:19:04 +0200, Kristina Hanicova wrote: >> We did not set priv->migMaxBandwidth if '--bandwidth' was >> specified as an option in the 'migrate' virsh command. This >> caused in printing the wrong value if virsh command >> 'migrate

[PATCH] vireventglib: Remove handles with the highest priority

2021-10-08 Thread Michal Privoznik
When a server decides to close a client, the virNetServerClientCloseLocked() is called. In here various cleanup steps are taken, but the most important part (from this commit's POV at least) is the way that the socket is closed. Firstly, removal of the socket associated with the client from the eve

Re: [PATCH 001/103] virJSONValueObjectAddVArgs: Add 'k' convertor for formatting non-negative integers

2021-10-08 Thread Ján Tomko
On a Friday in 2021, Kristina Hanicova wrote: On Thu, Oct 7, 2021 at 6:43 PM Ján Tomko wrote: On a Thursday in 2021, Peter Krempa wrote: >In many cases we use a signed value, but use the sign to note that it >was not assigned. For converting to JSON objects it will be handy to >have possibilit

Re: [PATCH] vireventglib: Remove handles with the highest priority

2021-10-08 Thread Daniel P . Berrangé
On Fri, Oct 08, 2021 at 01:12:49PM +0200, Michal Privoznik wrote: > When a server decides to close a client, the > virNetServerClientCloseLocked() is called. In here various > cleanup steps are taken, but the most important part (from this > commit's POV at least) is the way that the socket is clos

Re: [PATCH 003/103] virJSONValueObjectAddVArgs: Add new convertors for allocated strings

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The 'f' and 'F' convertors add a string value to the JSON value object and free the passed pointer. This is helpful in case we need to e.g. add single use formatted values: I'm not a fan of conditionally freeing the passed pointer based on some value.

Re: [PATCH 007/103] qemu: capabilities: Rename QEMU_CAPS_OBJECT_QAPIFIED to QEMU_CAPS_OBJECT_JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Unify it with the upcoming capabilities for -netdev and -device. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 6 +++--- src/qemu/qemu_capabilities.h | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_monitor.c | 2 +- 4 files

Re: [PATCH] vireventglib: Remove handles with the highest priority

2021-10-08 Thread Michal Prívozník
On 10/8/21 1:36 PM, Daniel P. Berrangé wrote: > On Fri, Oct 08, 2021 at 01:12:49PM +0200, Michal Privoznik wrote: >> When a server decides to close a client, the >> virNetServerClientCloseLocked() is called. In here various >> cleanup steps are taken, but the most important part (from this >> commi

Re: [PATCH 008/103] qemu: capabilities: Introduce QEMU_CAPS_NETDEV_JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Introduce a capability that will be asserted once '-netdev' will accept JSON. For now it will be dormant (only used by tests). Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 1 + src/qemu/qemu_capabilities.h | 1 + 2 files changed, 2 inse

Re: [PATCH 009/103] qemuBuildObjectCommandlineFromJSON: Remove checks for 'type' and 'alias'

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: We validate the generated props agains the QMP schema which makes sure *against that the objects are generated properly. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) Revie

Re: [PATCH 010/103] testCompareXMLToArgvValidateSchema: Base -netdev validation on JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Base the validation on presence of JSON as we do with other validated commands. This will prepare the code for a refactor so that it's the same for all validated commands. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 5 + 1 file change

Re: [PATCH 011/103] qemu: command: Format netdev as JSON when QEMU_CAPS_NETDEV_JSON is present

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Base the JSON output on a regular capability flag rather than purely internal flag. This will prepare for the time when QEMU will accept JSON argumets for -netdev. For now the capability is not set (thus we for now don't have QMP schema validation) but

Re: [PATCH 012/103] virQEMUBuildNetdevCommandlineFromJSON: Remove unused formatter

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Now that everything was replaced by the new code we can remove this function. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/util/virqemu.c | 30 -- src/util/virqemu.h | 4 3 files change

Re: [PATCH 013/103] qemu: Remove 'qemuBuildCommandLineFlags' and associated code

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The -netdev formatter code switched to a real virQEMUCaps flag so we can remove the old flags which used to enable JSON for -netdev for validation purposes. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.h | 4 src/qemu/qemu_driver.c |

Re: [PATCH 015/103] qemuxml2argvtest: Refactor QAPI schema validation code

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Prevent duplication of code when extending the validator for new commands. Add a struct describing a command to validate and make the validation loop a bit more robust to corner cases. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 120

Re: [PATCH 015/103] qemuxml2argvtest: Refactor QAPI schema validation code

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Prevent duplication of code when extending the validator for new commands. Add a struct describing a command to validate and make the validation loop a bit more robust to corner cases. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 120

Re: [PATCH 1/2] qemu_migration: set bandwidth in priv during migration

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 12:56:24 +0200, Michal Prívozník wrote: > On 10/8/21 12:44 PM, Jiri Denemark wrote: > > On Fri, Oct 08, 2021 at 10:19:04 +0200, Kristina Hanicova wrote: > >> We did not set priv->migMaxBandwidth if '--bandwidth' was > >> specified as an option in the 'migrate' virsh command.

Re: [PATCH 017/103] qemu: capabilities: Introduce QEMU_CAPS_CHARDEV_JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The flag will be used to switch use of JSON arguments for -chardev once qemu will support it. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 1 + src/qemu/qemu_capabilities.h | 1 + 2 files changed, 2 insertions(+) Reviewed-by: Ján Tom

Re: [PATCH 018/103] qemu: capabilities: Introduce QEMU_CAPS_DEVICE_JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The flag will be used to switch use of JSON arguments for -device once qemu will support it. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 3 +++ 2 files changed, 6 insertions(+) Reviewed-by: Ján

Re: [PATCH] vireventglib: Remove handles with the highest priority

2021-10-08 Thread Daniel P . Berrangé
On Fri, Oct 08, 2021 at 01:56:24PM +0200, Michal Prívozník wrote: > On 10/8/21 1:36 PM, Daniel P. Berrangé wrote: > > On Fri, Oct 08, 2021 at 01:12:49PM +0200, Michal Privoznik wrote: > >> When a server decides to close a client, the > >> virNetServerClientCloseLocked() is called. In here various >

Re: [PATCH 033/103] qemu: command: Introduce JSON equivalent of qemuBuildDeviceAddressStr

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Upcoming patches will start converting the formatting of arguments for -device from a string to JSON so that we can keep proper types around when using it via QMP. This means we will need an equivalet for the device address builder *equivalent funct

Re: [PATCH 053/103] qemu: command: Introduce JSON variant of qemuBuildVirtioDevStr

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Add a JSON variant of the generator of properties for virtio devices. For convenience both the old and new are for now marked as unused, which will be removed once the conversion is complete. The formatted properties have following types according to QE

Re: [PATCH 054/103] qemu: command: Introduce helper for building JSON props of -device into commandline

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The helper converts the JSON object to a string and adds it to the current command as arguments of '-device'. The helper also prepares for '-device' taking JSON directly. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 27

Re: [PATCH 055/103] qemu: command: Introduce JSON variant of qemuBuildRomProps

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Add a JSON variant of the generator 'rom' properties. For convenience both the old and new are for now marked as unused, which will be removed once the conversion is complete. The formatted properties have following types according to QEMU. 'virtio-blk-

Re: [PATCH 056/103] qemuBuildPanicCommandLine: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Format a JSON object with the device properties and then use qemuBuildDeviceCommandlineFromJSON to convert it to the standard commandline for now. The 'ioport' property of 'pvpanic' is a number in QEMU: ioport=- (default: 1285) Signed-off-by:

Re: [PATCH 057/103] qemuBuildWatchdogCommandLine: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The watchdog doesn't have any special properties. Convert the command line generator and hotplug code. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 31 +++ src/qemu/qemu_command.h | 6 +++--- src/qemu/qemu_hotpl

Re: [libvirt PATCH v3 1/6] qemu: always translate underscores to hyphens in CPU features

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 10:01:40 +0100, Daniel P. Berrangé wrote: > QEMU switched from using underscores in x86 CPU features to hyphens > in the 2.8.0 series with two commits > > commit fc7dfd205f3287893c436d932a167bffa30579c8 (HEAD, refs/bisect/bad) > Author: Eduardo Habkost > Date: Fri

Re: [libvirt PATCH v3 2/6] qemu: always use hyphens in hyperv feature names

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 10:01:41 +0100, Daniel P. Berrangé wrote: > QEMU switched from using underscores in x86 CPU features to hyphens > in the 2.8.0 series with two commits > > commit fc7dfd205f3287893c436d932a167bffa30579c8 (HEAD, refs/bisect/bad) > Author: Eduardo Habkost > Date: Fri

Re: [libvirt PATCH v3 3/6] qemu: remove use of (+|-)name syntax for -cpu featres

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 10:01:42 +0100, Daniel P. Berrangé wrote: > The -cpu arg gained support for feature=on|off syntax for the x86 > emulator in 2.4.0 > > commit 38e5c119c2925812bd441450ab9e5e00fc79e662 > Author: Eduardo Habkost > Date: Mon Mar 23 17:29:32 2015 -0300 > > target-i3

Re: [PATCH 058/103] qemuBuildMemoryDeviceCommandLine: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: This includes the 'pc-dimm', 'nvdimm', 'virtio-pmem-pci' and 'virtio-mem-pci' devices. The value types according to QEMU are: 'pc-dimm' node= - (default: 0) memdev=> 'nvdimm' label-size= memdev=> node= - (default: 0) unarmed=

Re: [PATCH 059/103] qemuBuildShmemCommandLine: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Note that the legacy 'ivshmem' device was already removed upstream, but it's converted so that the code is identical. For the two modern devices QEMU considers the properties being of following types: 'ivshmem-doorbell' chardev= - ID of a cha

Re: [PATCH] vireventglib: Remove handles with the highest priority

2021-10-08 Thread Michal Prívozník
On 10/8/21 2:23 PM, Daniel P. Berrangé wrote: > On Fri, Oct 08, 2021 at 01:56:24PM +0200, Michal Prívozník wrote: >> On 10/8/21 1:36 PM, Daniel P. Berrangé wrote: >>> On Fri, Oct 08, 2021 at 01:12:49PM +0200, Michal Privoznik wrote: When a server decides to close a client, the virNetServe

Re: [PATCH 060/103] qemuBuildMemballoonCommandLine: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The generated properties have the following types according to QEMU: deflate-on-oom= - on/off (default: false) free-page-reporting= - on/off (default: false) Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 33 --

Re: [PATCH] vireventglib: Remove handles with the highest priority

2021-10-08 Thread Daniel P . Berrangé
On Fri, Oct 08, 2021 at 03:13:27PM +0200, Michal Prívozník wrote: > On 10/8/21 2:23 PM, Daniel P. Berrangé wrote: > > On Fri, Oct 08, 2021 at 01:56:24PM +0200, Michal Prívozník wrote: > >> On 10/8/21 1:36 PM, Daniel P. Berrangé wrote: > > So, ACK to this patch as a quick fix, but it feels like we >

Re: [PATCH 061/103] qemuBuildMemballoonCommandLine: Reorder properties

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Move the 'deflate-on-oom' and 'free-page-reporting' before the address to simplify the genrator code. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 ++-- tests/qemuxml2argvdata/balloon-ccw-deflate.args

Re: [libvirt PATCH v3 4/6] qemu: inline the qemuBuildCpuFeature code

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 10:01:43 +0100, Daniel P. Berrangé wrote: > With the previous refactorings, there's no real benefit from the > qemuBuildCpuFeature helper method. Only one of the callers really > needs the CPU feature name re-writing logic, the others can just > use the right name directly.

Re: [PATCH 062/103] qemuBuildRNGCommandLine: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The 'virtio-rng' has the following property types according to QEMU: rng=> max-bytes= - (default: 9223372036854775807) period=- (default: 65536) Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 46 +++--

[PATCH] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Stefan Berger
Using swtpm v0.7.0 we can run swtpm_setup to create default config files for swtpm_setup and swtpm-localca in session mode. Now a user can start a VM with an attached TPM without having to run this program on the command line before. This program needs to run once. This patch addresses the issue r

Re: [libvirt PATCH v3 5/6] qemu: remove use of implicit boolean syntax for guest features

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 10:01:44 +0100, Daniel P. Berrangé wrote: > Some guest features that map to the -cpu arg are still added using > implicit syntax "feature" which is a deprecated shorthand for > "feature=on". > > Reviewed-by: Peter Krempa > Signed-off-by: Daniel P. Berrangé > --- > src/qe

Re: [PATCH 063/103] qemuBuildHostdevCommandLine: Build mediated device commandline via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The 'vfio-pci-nohotplug' device has the following property types according to QEMU: display=- on/off/auto (default: "off") sysfsdev= ramfb= bootindex= Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 48 ++-

Re: [PATCH 064/103] qemuBuildHostdevMediatedDevProps: Move 'ramfb' and 'bootindex' before the address

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Simplify the generator by moving few properties earlier. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 ++-- .../hostdev-mdev-display-ramfb.x86_64-latest.args | 2 +- .../hostdev-subsys-mdev-vfi

[PATCH v2 00/15] qdev: Add JSON -device

2021-10-08 Thread Kevin Wolf
It's still a long way until we'll have QAPIfied devices, but there are some improvements that we can already make now to make the future switch easier. One important part of this is having code paths without QemuOpts, which we want to get rid of and replace with the keyval parser in the long run.

[PATCH v2 03/15] net/vhost-vdpa: Fix device compatibility check

2021-10-08 Thread Kevin Wolf
vhost-vdpa works only with specific devices. At startup, it second guesses what the command line option handling will do and error out if it thinks a non-virtio device will attach to them. This second guessing is not only ugly, it can lead to wrong error messages ('-device floppy,netdev=foo' shoul

[PATCH v2 02/15] net/vhost-user: Fix device compatibility check

2021-10-08 Thread Kevin Wolf
vhost-user works only with specific devices. At startup, it second guesses what the command line option handling will do and error out if it thinks a non-virtio device will attach to them. This second guessing is not only ugly, it can lead to wrong error messages ('-device floppy,netdev=foo' shoul

[PATCH v2 01/15] net: Introduce NetClientInfo.check_peer_type()

2021-10-08 Thread Kevin Wolf
Some network backends (vhost-user and vhost-vdpa) work only with specific devices. At startup, they second guess what the command line option handling will do and error out if they think a non-virtio device will attach to them. This second guessing is not only ugly, it can lead to wrong error mess

[PATCH v2 09/15] softmmu/qdev-monitor: add error handling in qdev_set_id

2021-10-08 Thread Kevin Wolf
From: Damien Hedde qdev_set_id() is mostly used when the user adds a device (using -device cli option or device_add qmp command). This commit adds an error parameter to handle the case where the given id is already taken. Also document the function and add a return value in order to be able to c

[PATCH v2 06/15] iotests/051: Fix typo

2021-10-08 Thread Kevin Wolf
The iothread isn't called 'iothread0', but 'thread0'. Depending on the order that properties are parsed, the error message may change from the expected one to another one saying that the iothread doesn't exist. Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-i

[PATCH v2 08/15] qdev: Make DeviceState.id independent of QemuOpts

2021-10-08 Thread Kevin Wolf
DeviceState.id is a pointer to a string that is stored in the QemuOpts object DeviceState.opts and freed together with it. We want to create devices without going through QemuOpts in the future, so make this a separately allocated string. Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-

[PATCH v2 05/15] iotests/245: Fix type for iothread property

2021-10-08 Thread Kevin Wolf
iothread is a string property, so None (= JSON null) is not a valid value for it. Pass the empty string instead to get the default iothread. Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/245 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v2 04/15] qom: Reduce use of error_propagate()

2021-10-08 Thread Kevin Wolf
ERRP_GUARD() makes debugging easier by making sure that &error_abort still fails at the real origin of the error instead of error_propagate(). Signed-off-by: Kevin Wolf --- qom/object.c| 7 +++ qom/object_interfaces.c | 19 ++- 2 files changed, 9 insertions(+), 1

[PATCH v2 11/15] qdev: Add Error parameter to hide_device() callbacks

2021-10-08 Thread Kevin Wolf
hide_device() is used for virtio-net failover, where the standby virtio device delays creation of the primary device. It only makes sense to have a single primary device for each standby device. Adding a second one should result in an error instead of hiding it and never using it afterwards. Prepa

[PATCH v2 13/15] virtio-net: Avoid QemuOpts in failover_find_primary_device()

2021-10-08 Thread Kevin Wolf
Don't go through the global QemuOptsList, it is state of the legacy command line parser and we will create devices that are not contained in it. It is also just the command line configuration and not necessarily the current runtime state. Instead, look at the qdev device tree which has the current

[PATCH v2 12/15] virtio-net: Store failover primary opts pointer locally

2021-10-08 Thread Kevin Wolf
Instead of accessing the global QemuOptsList, which really belong to the command line parser and shouldn't be accessed from devices, store a pointer to the QemuOpts in a new VirtIONet field. This is not the final state, but just an intermediate step to get rid of QemuOpts in devices. It will later

[PATCH v2 14/15] qdev: Base object creation on QDict rather than QemuOpts

2021-10-08 Thread Kevin Wolf
QDicts are both what QMP natively uses and what the keyval parser produces. Going through QemuOpts isn't useful for either one, so switch the main device creation function to QDicts. By sharing more code with the -object/object-add code path, we can even reduce the code size a bit. This commit doe

[PATCH v2 15/15] vl: Enable JSON syntax for -device

2021-10-08 Thread Kevin Wolf
Like we already do for -object, introduce support for JSON syntax in -device, which can be kept stable in the long term and guarantees that a single code path with identical behaviour is used for both QMP and the command line. Compared to the QemuOpts based code, the parser contains less surprises

[PATCH v2 07/15] qdev: Avoid using string visitor for properties

2021-10-08 Thread Kevin Wolf
The only thing the string visitor adds compared to a keyval visitor is list support. git grep for 'visit_start_list' and 'visit.*List' shows that devices don't make use of this. In a world with a QAPIfied command line interface, the keyval visitor is used to parse the command line. In order to mak

[PATCH v2 10/15] qemu-option: Allow deleting opts during qemu_opts_foreach()

2021-10-08 Thread Kevin Wolf
Use QTAILQ_FOREACH_SAFE() so that the current QemuOpts can be deleted while iterating through the whole list. Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy --- util/qemu-option.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qemu-option.c b/u

Re: [PATCH 065/103] qemuBuildHostdevMediatedDevProps: Format USB host devices via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The 'usb-host' device has the following types according to QEMU for properties we control: hostdevice= hostbus= - (default: 0) hostaddr= - (default: 0) bootindex= Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 46 ++

[PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Stefan Berger
Using swtpm v0.7.0 we can run swtpm_setup to create default config files for swtpm_setup and swtpm-localca in session mode. Now a user can start a VM with an attached TPM without having to run this program on the command line before. This program needs to run once. This patch addresses the issue r

Re: [PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Marc-André Lureau
On Fri, Oct 8, 2021 at 5:56 PM Stefan Berger wrote: > Using swtpm v0.7.0 we can run swtpm_setup to create default config files > for swtpm_setup and swtpm-localca in session mode. Now a user can start > a VM with an attached TPM without having to run this program on the > command line before. Thi

Re: [PATCH 066/103] qemuBuildRedirdevCommandLine: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: The 'usb-redir' device has the following types according to QEMU for properties we control: chardev= - ID of a chardev to use as a backend filter= bootindex= Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 49

Re: [PATCH 067/103] qemuBuildInputCommandLine: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: For 'usb-mouse'/'usb-tablet'/'usb-kbd' we don't use any special property. For 'virtio-input-pci' we only use the 'evdev' argument which is a string so this conversion doesn't impact anything. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 1

Re: [PATCH 068/103] qemuCommandAddExtDevice: Generate via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Generate the 'zpci' device via JSON. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 81 +++-- src/qemu/qemu_command.h | 3 +- src/qemu/qemu_hotplug.c | 27 +- 3 files changed, 49 insertions(+), 6

Re: [PATCH 069/103] qemuBuildHostdevCommandLine: Format PCI host devices via JSON

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: For properties we use these are the QEMU types: host= - Address (bus/device/function) of the host device, example: 04:10.0 bootindex= failover_pair_id= Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 69 ++-

Re: [PATCH 070/103] qemuBuildPCIHostdevDevProps: Move 'failover_pair_id' property before address

2021-10-08 Thread Ján Tomko
On a Thursday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c| 6 +- tests/qemuxml2argvdata/net-virtio-teaming-hostdev.args | 4 ++-- tests/qemuxml2argvdata/net-virtio-teaming.args | 4 ++-- 3 files changed, 5 insertio

Re: [PATCH v7 1/4] qemu: capablities: detect presence of acpi-pci-hotplug-with-bridge-support

2021-10-08 Thread Ani Sinha
On Fri, Oct 8, 2021 at 12:12 PM Ani Sinha wrote: > qemu added support for i440fx specific global boolean flag > > PIIX4_PM.acpi-pci-hotplug-with-bridge-support > > around version 2.1. This flag is enabled by default. When disabled, it > turns > off acpi pci hotplug for cold plugged pci bridges in

Re: [PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Daniel P . Berrangé
On Fri, Oct 08, 2021 at 09:56:35AM -0400, Stefan Berger wrote: > Using swtpm v0.7.0 we can run swtpm_setup to create default config files > for swtpm_setup and swtpm-localca in session mode. Now a user can start > a VM with an attached TPM without having to run this program on the > command line be

[PATCH v3] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Stefan Berger
Using swtpm v0.7.0 we can run swtpm_setup to create default config files for swtpm_setup and swtpm-localca in session mode. Now a user can start a VM with an attached TPM without having to run this program on the command line before. This program needs to run once. This patch addresses the issue r

Re: [PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Stefan Berger
On 10/8/21 10:43 AM, Daniel P. Berrangé wrote: On Fri, Oct 08, 2021 at 09:56:35AM -0400, Stefan Berger wrote: Using swtpm v0.7.0 we can run swtpm_setup to create default config files for swtpm_setup and swtpm-localca in session mode. Now a user can start a VM with an attached TPM without havin

Re: [PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Daniel P . Berrangé
On Fri, Oct 08, 2021 at 09:56:35AM -0400, Stefan Berger wrote: > Using swtpm v0.7.0 we can run swtpm_setup to create default config files > for swtpm_setup and swtpm-localca in session mode. Now a user can start > a VM with an attached TPM without having to run this program on the > command line be

Re: [PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Stefan Berger
On 10/8/21 10:43 AM, Daniel P. Berrangé wrote: This error path will trigger preventing use of the TPM, even if the user has manually setup the config themselves. Why aren't you running /usr/share/swtpm/swtpm-create-user-config-files instead which is what I see does exist on Fedora today. Th

Re: [PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Daniel P . Berrangé
On Fri, Oct 08, 2021 at 10:51:24AM -0400, Stefan Berger wrote: > > On 10/8/21 10:43 AM, Daniel P. Berrangé wrote: > > On Fri, Oct 08, 2021 at 09:56:35AM -0400, Stefan Berger wrote: > > > Using swtpm v0.7.0 we can run swtpm_setup to create default config files > > > for swtpm_setup and swtpm-localc

Re: [PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Stefan Berger
On 10/8/21 10:52 AM, Daniel P. Berrangé wrote: On Fri, Oct 08, 2021 at 09:56:35AM -0400, Stefan Berger wrote: Using swtpm v0.7.0 we can run swtpm_setup to create default config files for swtpm_setup and swtpm-localca in session mode. Now a user can start a VM with an attached TPM without havin

Re: [libvirt PATCH v3 6/6] qemu: drop support for full CPU model expansion

2021-10-08 Thread Jiri Denemark
On Fri, Oct 08, 2021 at 10:01:45 +0100, Daniel P. Berrangé wrote: > The "canonical CPU features" capability is a derivative of the > "unavailable features" capability, which is exposed when seeing > the "max" CPU models has the "unavailable-features" property. > > This property was actually added

Re: [PATCH v2 14/15] qdev: Base object creation on QDict rather than QemuOpts

2021-10-08 Thread Laurent Vivier
On 08/10/2021 15:34, Kevin Wolf wrote: QDicts are both what QMP natively uses and what the keyval parser produces. Going through QemuOpts isn't useful for either one, so switch the main device creation function to QDicts. By sharing more code with the -object/object-add code path, we can even red

Re: Cancellation of VM core dumps

2021-10-08 Thread Jiri Denemark
On Tue, Oct 05, 2021 at 14:30:43 +, Simon Rowe wrote: > I see that cancellation of core dump jobs that are memory-only are explicitly > rejected > > > >>> d.abortJob() > > libvirt: QEMU Driver error : Requested operation is not valid: cannot abort > memory-only dump > > Traceback (most re

Re: [PATCH v7 0/4] introduce support for acpi-bridge-hotplug feature

2021-10-08 Thread Laine Stump
Reviewed-by: Laine Stump I'm going to push this later today after I put it through CI (and get back from a mandatory 4 hour drive). On 10/8/21 2:42 AM, Ani Sinha wrote: changelog: v7: Laine's suggestions from v6 incorporated. rebased the patchset to latest master. v6: rebased to latest

Re: [PATCH v2] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Stefan Berger
On 10/8/21 10:56 AM, Stefan Berger wrote: On 10/8/21 10:52 AM, Daniel P. Berrangé wrote: On Fri, Oct 08, 2021 at 09:56:35AM -0400, Stefan Berger wrote: Using swtpm v0.7.0 we can run swtpm_setup to create default config files for swtpm_setup and swtpm-localca in session mode. Now a user can

Re: [PATCH v3] qemu: tpm: Run swtpm_setup --create-config-files in session mode

2021-10-08 Thread Marc-André Lureau
Hi On Fri, Oct 8, 2021 at 6:44 PM Stefan Berger wrote: > Using swtpm v0.7.0 we can run swtpm_setup to create default config files > for swtpm_setup and swtpm-localca in session mode. Now a user can start > a VM with an attached TPM without having to run this program on the > command line before.

[libvirt PATCH 01/21] DONOTMERGEYET: Add replies for QEMU 6.2.0 on x86_64

2021-10-08 Thread Andrea Bolognani
These were generated using a QEMU binary built from commit v6.1.0-1220-g5564f06816 with https://lists.gnu.org/archive/html/qemu-devel/2021-10/msg00161.html https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg07819.html applied on top. Signed-off-by: Andrea Bolognani --- .../domain

[libvirt PATCH 06/21] conf: Add new/free functions for virDomainIOMMUDef

2021-10-08 Thread Andrea Bolognani
This will make it possible to limit changes to a single spot later on, and is also just an overall nicer way to create and destroy objects. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 29 + src/conf/domain_conf.h | 3 +++ 2 files changed, 28 insertio

[libvirt PATCH 04/21] conf: Introduce VIR_PCI_CONNECT_INTEGRATED

2021-10-08 Thread Andrea Bolognani
This new flag can be used to convince the PCI address assignment algorithm to place a device directly on the root bus. It will be used to implement support for virtio-iommu, which needs to be an integrated device in order to work correctly. Signed-off-by: Andrea Bolognani --- src/conf/domain_add

[libvirt PATCH 07/21] qemu: Tweak some code

2021-10-08 Thread Andrea Bolognani
The altered code is functionally equivalent to the previous one, but it's already laid down in a way that will make further changes easier and less messy. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c| 14 ++ src/qemu/qemu_domain_address.c | 23 +

[libvirt PATCH 02/21] DONOTMERGEYET: Add replies for QEMU 6.2.0 on aarch64

2021-10-08 Thread Andrea Bolognani
These were generated using a QEMU binary built from commit v6.1.0-1220-g5564f06816 with https://lists.gnu.org/archive/html/qemu-devel/2021-10/msg00161.html https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg07819.html applied on top. Signed-off-by: Andrea Bolognani --- .../qemu_6

[libvirt PATCH 00/21] qemu: Implement virtio-iommu support

2021-10-08 Thread Andrea Bolognani
The first couple of patches add replies files and as such have been aggressively snipped to deal with mailing list message size limits. Grab the unabriged version with $ git fetch https://gitlab.com/abologna/libvirt.git virtio-iommu As noted in those patches, some of the QEMU changes this serie

[libvirt PATCH 05/21] conf: Add IOMMU support to virDomainDeviceDefCopy()

2021-10-08 Thread Andrea Bolognani
There doesn't seem to be a reason for IOMMUs not to be handled by this function. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index df51d59e0d..60f2b1129f 100644

  1   2   >