[PATCH v5 10/16] python/machine.py: Handle None events in events_wait

2020-07-09 Thread John Snow
If the timeout is 0, we can get None back. Handle this explicitly. Signed-off-by: John Snow Reviewed-by: Kevin Wolf --- python/qemu/machine.py | 27 --- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 3

[PATCH v5 01/16] python/qmp.py: Define common types

2020-07-09 Thread John Snow
Define some common types that we'll need to annotate a lot of other functions going forward. Signed-off-by: John Snow Reviewed-by: Kevin Wolf --- python/qemu/qmp.py | 18 ++ 1 file changed, 18 insertions(+) diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py index e64b6b5faa..

[PATCH v5 04/16] python/qmp.py: Do not return None from cmd_obj

2020-07-09 Thread John Snow
This makes typing the qmp library difficult, as it necessitates wrapping Optional[] around the type for every return type up the stack. At some point, it becomes difficult to discern or remember why it's None instead of the expected object. Use the python exception system to tell us exactly why we

[PATCH v5 13/16] python/machine.py: fix _popen access

2020-07-09 Thread John Snow
As always, Optional[T] causes problems with unchecked access. Add a helper that asserts the pipe is present before we attempt to talk with it. Signed-off-by: John Snow --- python/qemu/machine.py | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/python/qemu/mac

[PATCH v5 14/16] python/qemu: make 'args' style arguments immutable

2020-07-09 Thread John Snow
These arguments don't need to be mutable and aren't really used as such. Clarify their types as immutable and adjust code to match where necessary. In general, It's probably best not to accept a user-defined mutable object and store it as internal object state unless there's a strong justification

[PATCH v5 07/16] python/machine.py: Fix monitor address typing

2020-07-09 Thread John Snow
Prior to this, it's difficult for mypy to intuit what the concrete type of the monitor address is; it has difficulty inferring the type across two variables. Create _monitor_address as a property that always returns a valid address to simplify static type analysis. To preserve our ability to clea

[PATCH v5 12/16] python/machine.py: Add _qmp access shim

2020-07-09 Thread John Snow
Like many other Optional[] types, it's not always a given that this object will be set. Wrap it in a type-shim that raises a meaningful error and will always return a concrete type. Signed-off-by: John Snow --- python/qemu/machine.py | 24 +--- 1 file changed, 13 insertions(+

[PATCH v5 09/16] python/machine.py: Don't modify state in _base_args()

2020-07-09 Thread John Snow
Don't append to the _remove_files list during _base_args; instead do so during _launch. Rework _base_args as a @property to help facilitate this impression. This has the additional benefit of making the type of _console_address easier to analyze statically. Signed-off-by: John Snow Reviewed-by:

[PATCH v5 06/16] python/qmp.py: add QMPProtocolError

2020-07-09 Thread John Snow
In the case that we receive a reply but are unable to understand it, use this exception name to indicate that case. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kevin Wolf --- python/qemu/qmp.py | 10 ++ 1 file changed, 10 insertions(+) diff --git a/python

[PATCH v5 11/16] python/machine.py: use qmp.command

2020-07-09 Thread John Snow
machine.py and qmp.py both do the same thing here; refactor machine.py to use qmp.py's functionality more directly. Signed-off-by: John Snow Reviewed-by: Kevin Wolf --- python/qemu/machine.py | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/python

[PATCH v5 15/16] iotests.py: Adjust HMP kwargs typing

2020-07-09 Thread John Snow
mypy wants to ensure there's consistency between the kwargs arguments types and any unspecified keyword arguments. In this case, conv_keys is a bool, but the remaining keys are Any type. Mypy (correctly) infers the **kwargs type to be **Dict[str, str], which is not compatible with conv_keys: bool.

[PATCH v5 16/16] python/qemu: Add mypy type annotations

2020-07-09 Thread John Snow
These should all be purely annotations with no changes in behavior at all. You need to be in the python folder, but you should be able to confirm that these annotations are correct (or at least self-consistent) by running `mypy --strict qemu`. Signed-off-by: John Snow --- python/qemu/accel.py

[PATCH v2] tests: improve performance of device-introspect-test

2020-07-09 Thread Thomas Huth
From: Daniel P. Berrangé Total execution time with "-m slow" and x86_64 QEMU, drops from 3 minutes 15 seconds, down to 54 seconds. Individual tests drop from 17-20 seconds, down to 3-4 seconds. The cost of this change is that any QOM bugs resulting in the test failure will not be directly assoc

Re: [PATCH] linux-headers: update again to 5.8-rc

2020-07-09 Thread Cornelia Huck
On Thu, 9 Jul 2020 14:28:49 -0400 Paolo Bonzini wrote: > 5.8-rc1 inadvertently broke userspace ABI compatibility. Merge > again with latest kvm/master to undo that. Ouch. > > Signed-off-by: Paolo Bonzini > --- > The patch should get to Linus tomorrow. Posting here to > ensure i

Re: [PATCH 3/3] cpu-timers, icount: new modules

2020-07-09 Thread Cornelia Huck
On Thu, 9 Jul 2020 20:46:56 +0200 Claudio Fontana wrote: > On 7/9/20 8:38 PM, Claudio Fontana wrote: > > On 7/8/20 5:05 PM, Paolo Bonzini wrote: > >> On 08/07/20 17:00, Claudio Fontana wrote: > Bisectable, 100% failure rate, etc. :( Can you split the patch in > multiple parts, spec

Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier

2020-07-09 Thread Jason Wang
On 2020/7/9 下午10:10, Peter Xu wrote: On Thu, Jul 09, 2020 at 01:58:33PM +0800, Jason Wang wrote: - If we care the performance, it's better to implement the MAP event for vhost, otherwise it could be a lot of IOTLB miss I feel like these are two things. So far what we are talking about is whe

[PATCH] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267

2020-07-09 Thread Cindy Lu
In the function鑱絭host_vdpa_dma_map/unmap, The鑱絪truct msg鑱絯as not鑱絠nitialized all its fields. Signed-off-by: Cindy Lu --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index a3d17fe0f9..b9265f3761 10

[PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267

2020-07-09 Thread Cindy Lu
In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields. Signed-off-by: Cindy Lu --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index a3d17fe0f9..b9265f3761 10

Re: [PATCH] Remove VXHS block device

2020-07-09 Thread Markus Armbruster
Marc-André Lureau writes: > The vxhs code doesn't compile since v2.12.0. There's no point in fixing > and then adding CI for a config that our users have demonstrated that > they do not use; better to just remove it. > > Signed-off-by: Marc-André Lureau No compile testing probably because libvx

[PATCH] docs/qdev-device-use: Clean up the sentences related to -usbdevice

2020-07-09 Thread Thomas Huth
Most of the -usbdevice paramaters have been removed already. Update the doc accordingly. Signed-off-by: Thomas Huth --- docs/qdev-device-use.txt | 28 +++- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt i

Re: [PATCH v2] tests: improve performance of device-introspect-test

2020-07-09 Thread Laurent Vivier
On 10/07/2020 08:07, Thomas Huth wrote: > From: Daniel P. Berrangé > > Total execution time with "-m slow" and x86_64 QEMU, drops from 3 > minutes 15 seconds, down to 54 seconds. > > Individual tests drop from 17-20 seconds, down to 3-4 seconds. > > The cost of this change is that any QOM bugs

<    1   2   3   4