Re: [PATCH RFC 00/13] hw/nvme: experimental user-creatable objects

2021-09-16 Thread Klaus Jensen
On Sep 16 18:30, Klaus Jensen wrote: > On Sep 16 14:41, Kevin Wolf wrote: > > Am 14.09.2021 um 22:37 hat Klaus Jensen geschrieben: > > > From: Klaus Jensen > > > > > > Hi, > > > > > > This is an attempt at adressing a bunch of issues that have presented > > > themselves since we added subsystem

[PATCH 13/15] iotests: Accommodate async QMP Exception classes

2021-09-16 Thread John Snow
(But continue to support the old ones for now, too.) There are very few cases of any user of QEMUMachine or a subclass thereof relying on a QMP Exception type. If you'd like to check for yourself, you want to grep for all of the derivatives of QMPError, excluding 'AQMPError' and its derivatives. T

[PATCH 11/15] python/aqmp: Create sync QMP wrapper for iotests

2021-09-16 Thread John Snow
This is a wrapper around the async QMPClient that mimics the old, synchronous QEMUMonitorProtocol class. It is designed to be interchangeable with the old implementation. It does not, however, attempt to mimic Exception compatibility. Signed-off-by: John Snow --- python/qemu/aqmp/legacy.py | 13

[PATCH 08/15] python/aqmp: Create MessageModel and StandaloneModel classes

2021-09-16 Thread John Snow
This allows 'Greeting' to be subclass of 'Message'. We need the adapter classes to avoid some typing problems that occur if we try to put too much into the 'Model' class itself; the exact details of why are left as an exercise to the reader. Why bother? This makes 'Greeting' ⊆ 'Message', which is

[PATCH 09/15] python/machine: remove has_quit argument

2021-09-16 Thread John Snow
If we spy on the QMP commands instead, we don't need callers to remember to pass it. Seems like a fair trade-off. The one slightly weird bit is overloading this instance variable for wait(), where we use it to mean "don't issue the qmp 'quit' command". This means that wait() will "fail" if the QEM

[PATCH 10/15] python/machine: Add support for AQMP backend

2021-09-16 Thread John Snow
To use the AQMP backend, Machine just needs to be a little more diligent about what happens when closing a QMP connection. The operation is no longer a freebie in the async world. Because async QMP continues to check for messages asynchronously, it's almost certainly likely that the loop will have

Re: [PATCH v3 00/16] python/iotests: Run iotest linters during Python CI

2021-09-16 Thread John Snow
On Thu, Sep 16, 2021 at 12:10 AM John Snow wrote: > GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-package-iotest > CI: https://gitlab.com/jsnow/qemu/-/pipelines/371611883 > Based-On: <20210915175318.853225-1-hre...@redhat.com> > "[PULL 00/32] Block patches" > > Since iotests ar

[PATCH 14/15] python/aqmp: Remove scary message

2021-09-16 Thread John Snow
The scary message interferes with the iotests output. Coincidentally, if iotests works by removing this, then it's good evidence that we don't really need to scare people away from using it. Signed-off-by: John Snow --- python/qemu/aqmp/__init__.py | 14 -- 1 file changed, 14 deletio

[PATCH 15/15] python, iotests: replace qmp with aqmp

2021-09-16 Thread John Snow
Swap out the synchronous QEMUMonitorProtocol from qemu.qmp with the sync wrapper from qemu.aqmp instead. Add an escape hatch in the form of the environment variable QEMU_PYTHON_LEGACY_QMP which allows you to cajole QEMUMachine into using the old interface, proving that both implementations work co

[PATCH 12/15] iotests: Disable AQMP logging under non-debug modes

2021-09-16 Thread John Snow
Disable the aqmp logger, which likes to (at the moment) print out intermediate warnings and errors that cause session termination; disable them so they don't interfere with the job output. Leave any "CRITICAL" warnings enabled though, those are ones that we should never see, no matter what. Signe

[PATCH 05/15] python/qmp: add send_fd_scm directly to QEMUMonitorProtocol

2021-09-16 Thread John Snow
It turns out you can do this directly from Python ... and because of this, you don't need to worry about setting the inheritability of the fds or spawning another process. Doing this is helpful because it allows QEMUMonitorProtocol to keep its file descriptor and socket object as private implement

[PATCH 06/15] python, iotests: remove socket_scm_helper

2021-09-16 Thread John Snow
It's not used anymore, now. Signed-off-by: John Snow --- tests/qemu-iotests/socket_scm_helper.c | 136 - python/qemu/machine/machine.py | 3 - python/qemu/machine/qtest.py | 2 - tests/Makefile.include | 1 - tests/meson.build

[PATCH 04/15] python/qmp: clear events on get_events() call

2021-09-16 Thread John Snow
All callers in the tree *already* clear the events after a call to get_events(). Do it automatically instead and update callsites to remove the manual clear call. These semantics are quite a bit easier to emulate with async QMP, and nobody appears to be abusing some emergent properties of what hap

[PATCH 07/15] python/aqmp: add send_fd_scm

2021-09-16 Thread John Snow
The single space is indeed required to successfully transmit the file descriptor to QEMU. Signed-off-by: John Snow --- python/qemu/aqmp/qmp_client.py | 17 + 1 file changed, 17 insertions(+) diff --git a/python/qemu/aqmp/qmp_client.py b/python/qemu/aqmp/qmp_client.py index d2ad7

[PATCH 02/15] python/aqmp: add .empty() method to EventListener

2021-09-16 Thread John Snow
Synchronous clients may want to know if they're about to block waiting for an event or not. A method such as this is necessary to implement a compatible interface for the old QEMUMonitorProtocol using the new async internals. Signed-off-by: John Snow --- python/qemu/aqmp/events.py | 6 ++ 1

[PATCH 01/15] python/aqmp: add greeting property to QMPClient

2021-09-16 Thread John Snow
Expose the greeting as a read-only property of QMPClient so it can be retrieved at-will. Signed-off-by: John Snow --- python/qemu/aqmp/qmp_client.py | 5 + 1 file changed, 5 insertions(+) diff --git a/python/qemu/aqmp/qmp_client.py b/python/qemu/aqmp/qmp_client.py index 82e9dab124..d2ad7459

[PATCH 00/15] Switch iotests to using Async QMP

2021-09-16 Thread John Snow
Based-on: <20210916220716.1353698-1-js...@redhat.com> Based-on: <20210915162955.333025-1-js...@redhat.com> [PULL 0/2] Python patches [PATCH v4 00/27] python: introduce Asynchronous QMP package Hiya, This series continues where the first AQMP series left off and adds a synchron

[PATCH 03/15] python/aqmp: Return cleared events from EventListener.clear()

2021-09-16 Thread John Snow
This serves two purposes: (1) It is now possible to discern whether or not clear() removed any event(s) from the queue with absolute certainty, and (2) It is now very easy to get a List of all pending events in one chunk, which is useful for the sync bridge. Signed-off-by: John Snow --- python

Re: [RFC PATCH 0/4] block layer: split block APIs in graph and I/O

2021-09-16 Thread Paolo Bonzini
I think either -global or -global-state. Paolo Il gio 16 set 2021, 16:03 Emanuele Giuseppe Esposito ha scritto: > > > On 15/09/2021 16:43, Stefan Hajnoczi wrote: > > On Wed, Sep 15, 2021 at 02:11:41PM +0200, Paolo Bonzini wrote: > >> On 13/09/21 15:10, Stefan Hajnoczi wrote: > >>> On Wed, Sep

Re: [PATCH RFC 02/13] hw/nvme: move zns helpers and types into zoned.h

2021-09-16 Thread Klaus Jensen
On Sep 16 09:06, Keith Busch wrote: > On Tue, Sep 14, 2021 at 10:37:26PM +0200, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Move ZNS related helpers and types into zoned.h. Use a common prefix > > (nvme_zoned or nvme_ns_zoned) for zns related functions. > > Just a nitpicks on the naming,

Re: [PATCH RFC 00/13] hw/nvme: experimental user-creatable objects

2021-09-16 Thread Klaus Jensen
On Sep 16 14:41, Kevin Wolf wrote: > Am 14.09.2021 um 22:37 hat Klaus Jensen geschrieben: > > From: Klaus Jensen > > > > Hi, > > > > This is an attempt at adressing a bunch of issues that have presented > > themselves since we added subsystem support. It's been brewing for a > > while now. > >

Re: [PATCH RFC 02/13] hw/nvme: move zns helpers and types into zoned.h

2021-09-16 Thread Keith Busch
On Tue, Sep 14, 2021 at 10:37:26PM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Move ZNS related helpers and types into zoned.h. Use a common prefix > (nvme_zoned or nvme_ns_zoned) for zns related functions. Just a nitpicks on the naming, you can feel free to ignore. Since we're within N

Re: [PATCH v3 02/16] iotests/mirror-top-perms: Adjust imports

2021-09-16 Thread Philippe Mathieu-Daudé
On 9/16/21 4:27 PM, John Snow wrote: > On Thu, Sep 16, 2021 at 12:27 AM Philippe Mathieu-Daudé > mailto:phi...@redhat.com>> wrote: > > On 9/16/21 6:09 AM, John Snow wrote: > > We need to import things from the qemu namespace; importing the > > namespace alone doesn't bring the submodul

Re: [PATCH v3 01/16] python: Update for pylint 2.10

2021-09-16 Thread John Snow
On Thu, Sep 16, 2021 at 9:30 AM Alex Bennée wrote: > > John Snow writes: > > > A few new annoyances. Of note is the new warning for an unspecified > > encoding when opening a text file, which actually does indicate a > > potentially real problem; see > > https://www.python.org/dev/peps/pep-0597/

Re: [PATCH v3 02/16] iotests/mirror-top-perms: Adjust imports

2021-09-16 Thread John Snow
On Thu, Sep 16, 2021 at 12:27 AM Philippe Mathieu-Daudé wrote: > On 9/16/21 6:09 AM, John Snow wrote: > > We need to import things from the qemu namespace; importing the > > namespace alone doesn't bring the submodules with it -- unless someone > > else (like iotests.py) imports them too. > > > >

Re: [RFC PATCH 0/4] block layer: split block APIs in graph and I/O

2021-09-16 Thread Emanuele Giuseppe Esposito
On 15/09/2021 16:43, Stefan Hajnoczi wrote: On Wed, Sep 15, 2021 at 02:11:41PM +0200, Paolo Bonzini wrote: On 13/09/21 15:10, Stefan Hajnoczi wrote: On Wed, Sep 08, 2021 at 09:10:17AM -0400, Emanuele Giuseppe Esposito wrote: Currently, block layer APIs like block-backend.h contain a mix of

Re: [PATCH v3 01/16] python: Update for pylint 2.10

2021-09-16 Thread Alex Bennée
John Snow writes: > A few new annoyances. Of note is the new warning for an unspecified > encoding when opening a text file, which actually does indicate a > potentially real problem; see > https://www.python.org/dev/peps/pep-0597/#motivation > > Use LC_CTYPE to determine an encoding to use for

Re: [PATCH 5/8] qdev: improve find_device_state() to distinguish simple not found case

2021-09-16 Thread Vladimir Sementsov-Ogievskiy
16.09.2021 13:48, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: We'll need this for realizing qdev_find_child() in the next commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- softmmu/qdev-monitor.c | 48 +- 1 file changed, 33 in

Re: [PATCH RFC 00/13] hw/nvme: experimental user-creatable objects

2021-09-16 Thread Kevin Wolf
Am 14.09.2021 um 22:37 hat Klaus Jensen geschrieben: > From: Klaus Jensen > > Hi, > > This is an attempt at adressing a bunch of issues that have presented > themselves since we added subsystem support. It's been brewing for a > while now. > > Fundamentally, I've come to the conclusion that mod

Re: [PATCH v5 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-09-16 Thread Peter Lieven
Am 09.07.21 um 12:21 schrieb Kevin Wolf: Am 08.07.2021 um 20:23 hat Peter Lieven geschrieben: Am 08.07.2021 um 14:18 schrieb Kevin Wolf : Am 07.07.2021 um 20:13 hat Peter Lieven geschrieben: Am 06.07.2021 um 17:25 schrieb Kevin Wolf : Am 06.07.2021 um 16:55 hat Peter Lieven geschrieben: I wil

[PATCH V3] block/rbd: implement bdrv_co_block_status

2021-09-16 Thread Peter Lieven
the qemu rbd driver currently lacks support for bdrv_co_block_status. This results mainly in incorrect progress during block operations (e.g. qemu-img convert with an rbd image as source). This patch utilizes the rbd_diff_iterate2 call from librbd to detect allocated and unallocated (all zero area

Re: [PATCH 5/8] qdev: improve find_device_state() to distinguish simple not found case

2021-09-16 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > We'll need this for realizing qdev_find_child() in the next commit. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > softmmu/qdev-monitor.c | 48 +- > 1 file changed, 33 insertions(+), 15 deletions(-) > > diff

Re: [PATCH 2/8] block: add BlockParentClass class

2021-09-16 Thread Vladimir Sementsov-Ogievskiy
16.09.2021 11:34, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add a class that will unify block parents for blockdev-replace functionality we are going to add. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-parent.h | 32 + block/bloc

Re: [PULL 00/32] Block patches

2021-09-16 Thread Peter Maydell
On Wed, 15 Sept 2021 at 18:53, Hanna Reitz wrote: > > The following changes since commit 0b6206b9c6825619cd721085fe082d7a0abc9af4: > > Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210914-4' > into staging (2021-09-15 13:27:49 +0100) > > are available in the Git repository at

Re: [PATCH 2/8] block: add BlockParentClass class

2021-09-16 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Add a class that will unify block parents for blockdev-replace > functionality we are going to add. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > include/block/block-parent.h | 32 + > block/block-parent.c | 66 +++

Re: [PATCH] qemu-storage-daemon: Only display FUSE help when FUSE is built-in

2021-09-16 Thread Kevin Wolf
Am 15.09.2021 um 23:36 hat Philippe Mathieu-Daudé geschrieben: > ping & Cc'ing qemu-trivial@ (reviewed twice) ... > > On 8/16/21 8:04 PM, Philippe Mathieu-Daudé wrote: > > When configuring QEMU with --disable-fuse, the qemu-storage-daemon > > still reports FUSE command line options in its help: >