Re: Module/Tool/SO to convert from KVM-xml => QEMU-native?

2021-10-08 Thread Ajay Garg
Came across this : https://fedoraproject.org/wiki/Changes/LibvirtModularDaemons Upon regular compilation, it looks virsh (and possibly others) are compiled in the modular mode. Is it possible to compile in the legacy mode, in the latest libvirt? On Sat, Oct 9, 2021 at 12:20 AM Ajay Garg wrote:

Re: Squelch 'eof from qemu monitor' error on normal VM shutdown

2021-10-08 Thread Jim Fehlig
On 10/7/21 20:45, Jim Fehlig wrote: On 10/4/21 08:55, Michal Prívozník wrote: On 9/30/21 7:15 PM, Jim Fehlig wrote: On 9/29/21 21:29, Jim Fehlig wrote: Hi All, Likely Christian received a bug report that motivated commit aeda1b8c56, which was later reverted by Michal with commit 72adaf2f10.

[RFC PATCH] qemu: Do not report eof when processing monitor IO

2021-10-08 Thread Jim Fehlig
There have been countless reports from users concerned about the following error reported by libvirtd when qemu domains are shutdown internal error: End of file from qemu monitor While the error is harmless, users often mistaken it for real problem with their deployments. EOF from the monitor

Module/Tool/SO to convert from KVM-xml => QEMU-native?

2021-10-08 Thread Ajay Garg
Hi All. Following has been done : 1. "sudo apt-get install virt-manager" Above installed all packages required for libvirt/kvm/qemu via apt, and a vm was setup successfully. Also, the vm booting works fine, when the green start-button of virt-manager is clicked. 2. Next, qemu was compiled

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 10:31 PM Stefan Berger wrote: > > On 10/8/21 12:33 PM, Marc-André Lureau wrote: > > 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

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

2021-10-08 Thread Stefan Berger
On 10/8/21 12:33 PM, Marc-André Lureau wrote: 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 ZjQcmQRYFpfptBannerStart This

[libvirt PATCH 08/21] qemu: Introduce QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI

2021-10-08 Thread Andrea Bolognani
This capability detects the availability of the virtio-iommu-pci device. Note that, while this device is present even in somewhat old versions of QEMU, it's only some recent changes that made it actually usable for our purposes. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c

[libvirt PATCH 20/21] docs: Document virtio-iommu

2021-10-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- docs/formatdomain.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index a02802a954..9cbc63f6c7 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -7948,8 +7948,9 @@

[libvirt PATCH 11/21] tests: Add test cases for virtio-iommu

2021-10-08 Thread Andrea Bolognani
These represent valid uses of the device. Signed-off-by: Andrea Bolognani --- .../virtio-iommu-aarch64.aarch64-latest.args | 34 +++ .../qemuxml2argvdata/virtio-iommu-aarch64.xml | 20 +++ .../virtio-iommu-x86_64.x86_64-latest.args| 30

[libvirt PATCH 16/21] qemu: Assign PCI address to virtio-iommu

2021-10-08 Thread Andrea Bolognani
The device is configured to be an integrated endpoint, as is necessary for it to function correctly. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain_address.c | 6 +- .../virtio-iommu-aarch64.aarch64-latest.xml | 4 +++-

[libvirt PATCH 18/21] tests: Add test for virtio-iommu address

2021-10-08 Thread Andrea Bolognani
virtio-iommu needs to be an integrated device, and our address assignment code will make sure that is the case. If the user has provided an explicit address, however, we should make sure any addresses pointing to a different bus are rejected. Signed-off-by: Andrea Bolognani ---

[libvirt PATCH 19/21] qemu: Generate command line for virtio-iommu

2021-10-08 Thread Andrea Bolognani
https://bugzilla.redhat.com/show_bug.cgi?id=1653327 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 17 ++--- .../virtio-iommu-aarch64.aarch64-latest.args| 1 + .../virtio-iommu-x86_64.x86_64-latest.args | 1 + 3 files changed, 16

[libvirt PATCH 17/21] qemu: Validate address type for virtio-iommu

2021-10-08 Thread Andrea Bolognani
virtio-iommu is a PCI device and attempts to use a different address type should be rejected. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_validate.c | 7 +++ ...mmu-invalid-address-type.x86_64-latest.err | 1 + .../virtio-iommu-invalid-address-type.xml | 20

[libvirt PATCH 21/21] news: Document virtio-iommu

2021-10-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- NEWS.rst | 4 1 file changed, 4 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index caa61f0646..ab524a68fe 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -32,6 +32,10 @@ v7.9.0 (unreleased) controller. The default behavior is unchanged (hotplug is

[libvirt PATCH 15/21] conf: Add virDomainDeviceInfo to virDomainIOMMUDef

2021-10-08 Thread Andrea Bolognani
This is needed so that IOMMU devices can have addresses. Existing IOMMU devices (intel-iommu and SMMUv3) are system devices and as such don't have an address associated to them, but virtio-iommu is a PCI device and needs one. Signed-off-by: Andrea Bolognani --- docs/schemas/domaincommon.rng |

[libvirt PATCH 14/21] qemu: Validate use of ACPI with virtio-iommu

2021-10-08 Thread Andrea Bolognani
virtio-iommu doesn't work without ACPI, so we need to make sure the latter is enabled. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_validate.c | 6 ++ .../virtio-iommu-no-acpi.x86_64-latest.err| 1 + tests/qemuxml2argvdata/virtio-iommu-no-acpi.xml |

[libvirt PATCH 13/21] qemu: Validate capabilities for virtio-iommu

2021-10-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_validate.c | 8 .../qemuxml2argvdata/virtio-iommu-x86_64.x86_64-6.1.0.err | 1 + tests/qemuxml2argvtest.c | 1 + 3 files changed, 10 insertions(+) create mode 100644

[libvirt PATCH 12/21] qemu: Validate machine type used with virtio-iommu

2021-10-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_validate.c | 8 ...irtio-iommu-wrong-machine.x86_64-latest.err | 1 + .../virtio-iommu-wrong-machine.xml | 18 ++ tests/qemuxml2argvtest.c | 1 + 4 files changed,

[libvirt PATCH 03/21] conf: Make virDomainDeviceInfoFormat() const correct

2021-10-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/conf/domain_addr.c | 4 ++-- src/conf/domain_addr.h | 4 ++-- src/conf/domain_conf.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 53b39923e8..fe6520cf3a 100644 ---

[libvirt PATCH 10/21] conf: Introduce virtio model for

2021-10-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c| 4 src/qemu/qemu_domain_address.c | 6 ++ src/qemu/qemu_validate.c | 3 +++ 6 files changed, 16

[libvirt PATCH 09/21] qemu: Introduce QEMU_CAPS_VIRTIO_IOMMU_BOOT_BYPASS

2021-10-08 Thread Andrea Bolognani
This capability detects the availability of the boot-bypass property of the virtio-iommu-pci device. This property was only introduced in QEMU 6.2 but, since the device has been around for much longer, we end up querying its properties for several more releases. As I don't have convenient access

[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

[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

[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 ---

[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 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 ---

[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

[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 ---

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

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 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

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: [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

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] 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

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

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.

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

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

[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

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

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

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

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 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(+),

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 |

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 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.

[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

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 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

[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

[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 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

[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

[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

[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.

[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 _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(+), 17

[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 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

[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 ---

[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

[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

[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'

[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'

[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.

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 +-

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: [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é > --- >

[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

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

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 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 ++--

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 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 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

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

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)

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 > >

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 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: [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 +++---

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)

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.

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 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

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

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 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 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

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

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 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 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

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 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

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(-)

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

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 >>

  1   2   >