Re: [PATCH 03/20] python/machine.py: reorder __init__

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/7/20 1:58 AM, John Snow wrote: > Put the init arg handling all at the top, and mostly in order (deviating > when one is dependent on another), and put what is effectively runtime > state declaration at the bottom. > > Signed-off-by: John Snow > --- > python/qemu/machine.py | 44

Re: [PATCH 18/20] python/qemu/qmp.py: re-raise OSError when encountered

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/7/20 1:58 AM, John Snow wrote: > Nested if conditions don't change when the exception block fires; we > need to explicitly re-raise the error if we didn't intend to capture and > suppress it. > > Signed-off-by: John Snow > --- > python/qemu/qmp.py | 6 +++--- > 1 file changed, 3

Re: [PATCH 17/20] python/qemu/qmp.py: Preserve error context on re-raise

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/7/20 1:58 AM, John Snow wrote: > Use the "from ..." phrasing when re-raising errors to preserve their > initial context, to help aid debugging when things go wrong. > > This also silences a pylint 2.6.0+ error. > > Signed-off-by: John Snow > --- > python/qemu/qmp.py | 9 + > 1

Re: [PATCH 09/20] python/qemu: make 'args' style arguments immutable

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/7/20 1:58 AM, John Snow wrote: > 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

Re: [PATCH 06/20] python/machine.py: use qmp.command

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/7/20 1:58 AM, John Snow wrote: > 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 | 32 > 1 file

Re: [PATCH 01/20] python/qemu: use isort to lay out imports

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/7/20 1:57 AM, John Snow wrote: > Borrowed from the QAPI cleanup series, use the same configuration to > standardize the way we write and sort imports. > > Signed-off-by: John Snow > --- > python/qemu/.isort.cfg| 7 +++ > python/qemu/accel.py | 1 + >

[PATCH 19/20] python/qemu/qmp.py: Straighten out exception hierarchy

2020-10-06 Thread John Snow
Be a little more rigorous about which exception we use, and when. Primarily, this makes QMPCapabilitiesError an extension of QMPprotocolError. The family of errors: QMPError (generic base) QMPConnectError (For connection issues) QMPTimeoutError (when waiting for an event expires)

[PATCH 20/20] python: add mypy config

2020-10-06 Thread John Snow
Formalize the options used for checking the python library. You can run mypy from the directory that mypy.ini is in by typing `mypy qemu/`. Signed-off-by: John Snow --- python/mypy.ini | 4 1 file changed, 4 insertions(+) create mode 100644 python/mypy.ini diff --git a/python/mypy.ini

[PATCH 16/20] python/console_socket: avoid encoding to/from string

2020-10-06 Thread John Snow
We can work directly in bytes instead of translating back and forth to string, which removes the question of which encodings to use. Signed-off-by: John Snow --- python/qemu/console_socket.py | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git

[PATCH 17/20] python/qemu/qmp.py: Preserve error context on re-raise

2020-10-06 Thread John Snow
Use the "from ..." phrasing when re-raising errors to preserve their initial context, to help aid debugging when things go wrong. This also silences a pylint 2.6.0+ error. Signed-off-by: John Snow --- python/qemu/qmp.py | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH 18/20] python/qemu/qmp.py: re-raise OSError when encountered

2020-10-06 Thread John Snow
Nested if conditions don't change when the exception block fires; we need to explicitly re-raise the error if we didn't intend to capture and suppress it. Signed-off-by: John Snow --- python/qemu/qmp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/qemu/qmp.py

[PATCH 11/20] python/qemu: Add mypy type annotations

2020-10-06 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 12/20] python/qemu/console_socket.py: Correct type of recv()

2020-10-06 Thread John Snow
The type and parameter names of recv() should match socket.socket(). OK, easy enough, but in the cases we don't pass straight through to the real socket implementation, we probably can't accept such flags. OK, for now, assert that we don't receive flags in such cases. Signed-off-by: John Snow

[PATCH 15/20] python/qemu/console_socket.py: Add type hint annotations

2020-10-06 Thread John Snow
Finish the typing of console_socket.py with annotations and no code changes. Signed-off-by: John Snow --- python/qemu/console_socket.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index

[PATCH 06/20] python/machine.py: use qmp.command

2020-10-06 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 | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git

[PATCH 10/20] iotests.py: Adjust HMP kwargs typing

2020-10-06 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 13/20] python/qemu/console_socket.py: fix typing of settimeout

2020-10-06 Thread John Snow
The types and names of the parameters must match the socket.socket interface. Signed-off-by: John Snow --- python/qemu/console_socket.py | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index

[PATCH 14/20] python/qemu/console_socket.py: Clarify type of drain_thread

2020-10-06 Thread John Snow
Mypy needs just a little help to guess the type here. Signed-off-by: John Snow --- python/qemu/console_socket.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index 39456825064..d4669c441d0 100644 ---

[PATCH 07/20] python/machine.py: Add _qmp access shim

2020-10-06 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

[PATCH 05/20] python/machine.py: Handle None events in events_wait

2020-10-06 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

[PATCH 08/20] python/machine.py: fix _popen access

2020-10-06 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

[PATCH 09/20] python/qemu: make 'args' style arguments immutable

2020-10-06 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

[PATCH 04/20] python/machine.py: Don't modify state in _base_args()

2020-10-06 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 03/20] python/machine.py: reorder __init__

2020-10-06 Thread John Snow
Put the init arg handling all at the top, and mostly in order (deviating when one is dependent on another), and put what is effectively runtime state declaration at the bottom. Signed-off-by: John Snow --- python/qemu/machine.py | 44 -- 1 file changed,

[PATCH 02/20] python/machine.py: Fix monitor address typing

2020-10-06 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

[PATCH 01/20] python/qemu: use isort to lay out imports

2020-10-06 Thread John Snow
Borrowed from the QAPI cleanup series, use the same configuration to standardize the way we write and sort imports. Signed-off-by: John Snow --- python/qemu/.isort.cfg| 7 +++ python/qemu/accel.py | 1 + python/qemu/console_socket.py | 2 +- python/qemu/machine.py

[PATCH 00/20] python/qemu: strictly typed mypy conversion, pt2

2020-10-06 Thread John Snow
Continuing where I left off prior to the 5.1 release, this series touches up a few odds and ends and introduces mypy hints. What's new: - Using isort to solidify import order - Patches adding small corrections and typing for console_socket - A few error class changes for qmp.py Like my QAPI

Re: [PATCH] tests/docker: Add genisoimage to the docker file

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/6/20 7:43 PM, Thomas Huth wrote: > genisoimage is needed for running the tests/qtest/cdrom-test qtest. > > Signed-off-by: Thomas Huth > --- > tests/docker/dockerfiles/centos8.docker | 1 + > tests/docker/dockerfiles/debian-amd64.docker | 1 + > tests/docker/dockerfiles/fedora.docker

[PATCH] tests/docker: Add genisoimage to the docker file

2020-10-06 Thread Thomas Huth
genisoimage is needed for running the tests/qtest/cdrom-test qtest. Signed-off-by: Thomas Huth --- tests/docker/dockerfiles/centos8.docker | 1 + tests/docker/dockerfiles/debian-amd64.docker | 1 + tests/docker/dockerfiles/fedora.docker | 1 +

Re: [PATCH v5 10/10] migration: introduce snapshot-{save,load,delete} QMP commands

2020-10-06 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > On 10/2/20 11:27 AM, Daniel P. Berrangé wrote: > > savevm, loadvm and delvm are some of the few HMP commands that have never > > been converted to use QMP. The reasons for the lack of conversion are > > that they blocked execution of the event thread, and

Re: [PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/6/20 6:15 PM, Paolo Bonzini wrote: > On 06/10/20 18:02, Philippe Mathieu-Daudé wrote: >> On 10/6/20 5:51 PM, Richard Henderson wrote: >>> On 10/6/20 10:36 AM, Philippe Mathieu-Daudé wrote: +++ b/hw/nvram/fw_cfg-interface.c @@ -0,0 +1,15 @@ +#include "qemu/osdep.h"

Re: [PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/6/20 6:04 PM, Laszlo Ersek wrote: > On 10/06/20 17:51, Richard Henderson wrote: >> On 10/6/20 10:36 AM, Philippe Mathieu-Daudé wrote: >>> +++ b/hw/nvram/fw_cfg-interface.c >>> @@ -0,0 +1,15 @@ >>> +#include "qemu/osdep.h" >>> +#include "hw/nvram/fw_cfg.h" >> >> License boilerplate missing.

Re: [PATCH] hw/ide/ahci: silence a compiler warning

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/6/20 5:42 PM, Alex Bennée wrote: > When built with -Og -ggdb with gcc 8.3 the compiler gets confused > reporting: > > ../../hw/ide/ahci.c: In function ‘ahci_populate_sglist’: > ../../hw/ide/ahci.c:965:58: error: ‘tbl_entry_size’ may be used > uninitialized in this function

Re: [PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Laszlo Ersek
On 10/06/20 18:08, Philippe Mathieu-Daudé wrote: > On 10/6/20 6:04 PM, Laszlo Ersek wrote: >> On 10/06/20 17:51, Richard Henderson wrote: >>> On 10/6/20 10:36 AM, Philippe Mathieu-Daudé wrote: +++ b/hw/nvram/fw_cfg-interface.c @@ -0,0 +1,15 @@ +#include "qemu/osdep.h" +#include

Re: [PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Paolo Bonzini
On 06/10/20 18:02, Philippe Mathieu-Daudé wrote: > On 10/6/20 5:51 PM, Richard Henderson wrote: >> On 10/6/20 10:36 AM, Philippe Mathieu-Daudé wrote: >>> +++ b/hw/nvram/fw_cfg-interface.c >>> @@ -0,0 +1,15 @@ >>> +#include "qemu/osdep.h" >>> +#include "hw/nvram/fw_cfg.h" >> >> License boilerplate

Re: [PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Laszlo Ersek
On 10/06/20 17:51, Richard Henderson wrote: > On 10/6/20 10:36 AM, Philippe Mathieu-Daudé wrote: >> +++ b/hw/nvram/fw_cfg-interface.c >> @@ -0,0 +1,15 @@ >> +#include "qemu/osdep.h" >> +#include "hw/nvram/fw_cfg.h" > > License boilerplate missing. > > r~ > Hrmpf, so easy to forget about that,

Re: [PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/6/20 5:51 PM, Richard Henderson wrote: > On 10/6/20 10:36 AM, Philippe Mathieu-Daudé wrote: >> +++ b/hw/nvram/fw_cfg-interface.c >> @@ -0,0 +1,15 @@ >> +#include "qemu/osdep.h" >> +#include "hw/nvram/fw_cfg.h" > > License boilerplate missing. Grr. Paolo since you queued this, do you mind

Re: [PATCH v3 0/1] qom: Fix missing interface in qemu-storage-daemon

2020-10-06 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20201006153636.2383248-1-phi...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20201006153636.2383248-1-phi...@redhat.com Subject: [PATCH v3 0/1] qom: Fix missing

Re: [PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Richard Henderson
On 10/6/20 10:36 AM, Philippe Mathieu-Daudé wrote: > +++ b/hw/nvram/fw_cfg-interface.c > @@ -0,0 +1,15 @@ > +#include "qemu/osdep.h" > +#include "hw/nvram/fw_cfg.h" License boilerplate missing. r~

[PATCH] hw/ide/ahci: silence a compiler warning

2020-10-06 Thread Alex Bennée
When built with -Og -ggdb with gcc 8.3 the compiler gets confused reporting: ../../hw/ide/ahci.c: In function ‘ahci_populate_sglist’: ../../hw/ide/ahci.c:965:58: error: ‘tbl_entry_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] As prdtl being > 0 is a

Re: [PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Paolo Bonzini
On 06/10/20 17:36, Philippe Mathieu-Daudé wrote: > While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed > by a device only available using system-mode (fw_cfg), it is > implemented by a crypto component (tls-cipher-suites) which > is always available when crypto is used. > > Commit

[PATCH v3 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Philippe Mathieu-Daudé
While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed by a device only available using system-mode (fw_cfg), it is implemented by a crypto component (tls-cipher-suites) which is always available when crypto is used. Commit 69699f3055 introduced the following error in the qemu-storage-daemon

[PATCH v3 0/1] qom: Fix missing interface in qemu-storage-daemon

2020-10-06 Thread Philippe Mathieu-Daudé
Attempt to fix the issue reported by Kevin. Since v2: - Rename function (lersek) Since RFC(v1): - Keep it local to hw/nvram (danpb) - Based on Meson cleanup Based-on: <20201006125602.2311423-1-phi...@redhat.com> Base is available in the Git repository at: https://gitlab.com/philmd/qemu.git

Re: [PATCH v7 03/13] qtest: switch users back to qtest_qmp_receive

2020-10-06 Thread Maxim Levitsky
On Tue, 2020-10-06 at 14:56 +0200, Paolo Bonzini wrote: > On 06/10/20 14:38, Maxim Levitsky wrote: > > The only remaining users of qtest_qmp_receive_dict are tests > > that fuzz the QMP protocol. > > > > Tested with 'make check-qtest'. > > Probably the qtest_qmp_receive_success conversion should

Re: [PATCH v7 00/13] Fix scsi devices plug/unplug races w.r.t virtio-scsi iothread

2020-10-06 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20201006123904.610658-1-mlevi...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: N/A. Internal error while reading log file The full log is available at

Re: [PATCH v7 03/13] qtest: switch users back to qtest_qmp_receive

2020-10-06 Thread Paolo Bonzini
On 06/10/20 14:38, Maxim Levitsky wrote: > The only remaining users of qtest_qmp_receive_dict are tests > that fuzz the QMP protocol. > > Tested with 'make check-qtest'. Probably the qtest_qmp_receive_success conversion should have been in a separate patch. But it's a nice side effect that I

Re: [PATCH v2 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/6/20 2:55 PM, Laszlo Ersek wrote: > On 10/06/20 13:19, Philippe Mathieu-Daudé wrote: >> While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed >> by a device only available using system-mode (fw_cfg), it is >> implemented by a crypto component (tls-cipher-suites) which >> is always

Re: [PATCH v2 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Paolo Bonzini
On 06/10/20 14:38, Kevin Wolf wrote: > Am 06.10.2020 um 14:20 hat Paolo Bonzini geschrieben: >> It's >> >> Based-on: <20201006111219.2300921-1-phi...@redhat.com> >> >> (which won't be applied in exactly that shape, but more or less it will >> be the same). > > Oh, I see. Then I guess it's not

[PATCH v7 13/13] scsi/scsi_bus: fix races in REPORT LUNS

2020-10-06 Thread Maxim Levitsky
Currently scsi_target_emulate_report_luns iterates over the child device list twice, and there is no guarantee that this list is the same in both iterations. The reason for iterating twice is that the first iteration calculates how much memory to allocate. However if we use a dynamic array we

Re: [PATCH v2 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Laszlo Ersek
On 10/06/20 13:19, Philippe Mathieu-Daudé wrote: > While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed > by a device only available using system-mode (fw_cfg), it is > implemented by a crypto component (tls-cipher-suites) which > is always available when crypto is used. > > Commit

[PATCH v7 11/13] scsi/scsi_bus: Add scsi_device_get

2020-10-06 Thread Maxim Levitsky
Add scsi_device_get which finds the scsi device and takes a reference to it. Suggested-by: Stefan Hajnoczi Signed-off-by: Maxim Levitsky Message-Id: <20200913160259.32145-8-mlevi...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 11 +++ include/hw/scsi/scsi.h |

[PATCH v7 04/13] qdev: add "check if address free" callback for buses

2020-10-06 Thread Maxim Levitsky
From: Paolo Bonzini Check if an address is free on the bus before plugging in the device. This makes it possible to do the check without any side effects, and to detect the problem early without having to do it in the realize callback. Signed-off-by: Paolo Bonzini --- hw/core/qdev.c

[PATCH v7 05/13] scsi: switch to bus->check_address

2020-10-06 Thread Maxim Levitsky
From: Paolo Bonzini Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 122 - 1 file changed, 75 insertions(+), 47 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 3284a5d1fb..94921c04b1 100644 --- a/hw/scsi/scsi-bus.c +++

[PATCH v7 10/13] scsi/scsi-bus: scsi_device_find: don't return unrealized devices

2020-10-06 Thread Maxim Levitsky
From: Paolo Bonzini The device core first places a device on the bus and then realizes it. Make scsi_device_find avoid returing such devices to avoid races in drivers that use an iothread (currently virtio-scsi) Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1812399 Suggested-by: Paolo

[PATCH v7 12/13] virtio-scsi: use scsi_device_get

2020-10-06 Thread Maxim Levitsky
This will help us to avoid the scsi device disappearing after we took a reference to it. It doesn't by itself forbid case when we try to access an unrealized device Suggested-by: Stefan Hajnoczi Signed-off-by: Maxim Levitsky Reviewed-by: Stefan Hajnoczi Message-Id:

[PATCH v7 03/13] qtest: switch users back to qtest_qmp_receive

2020-10-06 Thread Maxim Levitsky
The only remaining users of qtest_qmp_receive_dict are tests that fuzz the QMP protocol. Tested with 'make check-qtest'. Signed-off-by: Maxim Levitsky --- tests/qtest/ahci-test.c | 4 +- tests/qtest/device-plug-test.c | 2 +- tests/qtest/drive_del-test.c| 9 ++---

[PATCH v7 01/13] qtest: rename qtest_qmp_receive to qtest_qmp_receive_dict

2020-10-06 Thread Maxim Levitsky
In the next patch a new version of qtest_qmp_receive will be reintroduced that will buffer received qmp events for later consumption in qtest_qmp_eventwait_ref No functional change intended. Suggested-by: Paolo Bonzini Signed-off-by: Maxim Levitsky --- tests/qtest/ahci-test.c| 4 ++--

[PATCH v7 00/13] Fix scsi devices plug/unplug races w.r.t virtio-scsi iothread

2020-10-06 Thread Maxim Levitsky
This is the next version of the patches. In this version I implemented Paulo's suggestion of fixing the qtests to cope with out of order events. This resulted in small but nice refactoring. Besides that, the only other change from V6 is that I dropped Paulo's fix to qtest_qmp_device_del since

[PATCH v7 09/13] device-core: use atomic_set on .realized property

2020-10-06 Thread Maxim Levitsky
Some code might race with placement of new devices on a bus. We currently first place a (unrealized) device on the bus and then realize it. As a workaround, users that scan the child device list, can check the realized property to see if it is safe to access such a device. Use an atomic write

[PATCH v7 08/13] device-core: use RCU for list of children of a bus

2020-10-06 Thread Maxim Levitsky
This fixes the race between device emulation code that tries to find a child device to dispatch the request to (e.g a scsi disk), and hotplug of a new device to that bus. Note that this doesn't convert all the readers of the list but only these that might go over that list without BQL held. This

[PATCH v7 07/13] device_core: use drain_call_rcu in in qmp_device_add

2020-10-06 Thread Maxim Levitsky
Soon, a device removal might only happen on RCU callback execution. This is okay for device-del which provides a DEVICE_DELETED event, but not for the failure case of device-add. To avoid changing monitor semantics, just drain all pending RCU callbacks on error. Signed-off-by: Maxim Levitsky

[PATCH v7 06/13] scsi/scsi_bus: switch search direction in scsi_device_find

2020-10-06 Thread Maxim Levitsky
This change will allow us to convert the bus children list to RCU, while not changing the logic of this function Signed-off-by: Maxim Levitsky Reviewed-by: Stefan Hajnoczi Message-Id: <20200913160259.32145-2-mlevi...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 12

Re: [PATCH v2 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Paolo Bonzini
On 06/10/20 14:15, Kevin Wolf wrote: > Am 06.10.2020 um 13:19 hat Philippe Mathieu-Daudé geschrieben: >> While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed >> by a device only available using system-mode (fw_cfg), it is >> implemented by a crypto component (tls-cipher-suites) which >> is

Re: [PULL v2 00/17] Block patches

2020-10-06 Thread Peter Maydell
On Mon, 5 Oct 2020 at 16:43, Stefan Hajnoczi wrote: > > The following changes since commit 469e72ab7dbbd7ff4ee601e5ea7c29545d46593b: > > Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging > (2020-10-02 16:19:42 +0100) > > are available in the Git repository at: > >

Re: [PATCH v2 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Kevin Wolf
Am 06.10.2020 um 13:19 hat Philippe Mathieu-Daudé geschrieben: > While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed > by a device only available using system-mode (fw_cfg), it is > implemented by a crypto component (tls-cipher-suites) which > is always available when crypto is used. > >

Re: [PATCH v2 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Paolo Bonzini
On 06/10/20 13:19, Philippe Mathieu-Daudé wrote: > While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed > by a device only available using system-mode (fw_cfg), it is > implemented by a crypto component (tls-cipher-suites) which > is always available when crypto is used. > > Commit

Re: [PATCH v2 3/3] MAINTAINERS: add Kevin Wolf as storage daemon maintainer

2020-10-06 Thread Philippe Mathieu-Daudé
On 9/10/20 4:44 PM, Stefan Hajnoczi wrote: > The MAINTAINERS file was not updated when the storage daemon was merged. > > Signed-off-by: Stefan Hajnoczi > --- > MAINTAINERS | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index

[PATCH v2 0/1] qom: Fix missing interface in qemu-storage-daemon

2020-10-06 Thread Philippe Mathieu-Daudé
Attempt to fix the issue reported by Kevin. Since RFC: - Keep it local to hw/nvram (danpb) - Based on Meson cleanup Based-on: <20201006111219.2300921-1-phi...@redhat.com> Supersedes: <20201005105442.2093105-1-phi...@redhat.com> Philippe Mathieu-Daudé (1): hw/nvram: Always register

[PATCH v2 1/1] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Philippe Mathieu-Daudé
While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed by a device only available using system-mode (fw_cfg), it is implemented by a crypto component (tls-cipher-suites) which is always available when crypto is used. Commit 69699f3055 introduced the following error in the qemu-storage-daemon

Re: [PATCH v2 3/3] MAINTAINERS: add Kevin Wolf as storage daemon maintainer

2020-10-06 Thread Kevin Wolf
Am 10.09.2020 um 16:44 hat Stefan Hajnoczi geschrieben: > The MAINTAINERS file was not updated when the storage daemon was merged. > > Signed-off-by: Stefan Hajnoczi Acked-by: Kevin Wolf

Re: [PATCH v2 1/3] docs: generate qemu-storage-daemon-qmp-ref(7) man page

2020-10-06 Thread Kevin Wolf
Am 10.09.2020 um 16:43 hat Stefan Hajnoczi geschrieben: > Although qemu-storage-daemon QMP commands are identical to QEMU QMP > commands they are a subset. Generate a manual page of just the commands > supported by qemu-storage-daemon so that users know exactly what is > available in

Re: [PATCH v2 2/3] docs: add qemu-storage-daemon(1) man page

2020-10-06 Thread Kevin Wolf
Am 10.09.2020 um 16:43 hat Stefan Hajnoczi geschrieben: > Document the qemu-storage-daemon tool. Most of the command-line options > are identical to their QEMU counterparts. Perhaps Sphinx hxtool > integration could be extended to extract documentation for individual > command-line options so they

Re: [RFC PATCH 1/3] qom: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/5/20 3:22 PM, Daniel P. Berrangé wrote: > On Mon, Oct 05, 2020 at 12:54:40PM +0200, Philippe Mathieu-Daudé wrote: >> While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed >> by a device only available using system-mode (fw_cfg), it is >> implemented by a crypto component

Re: [PULL 5/5] crypto/tls-cipher-suites: Produce fw_cfg consumable blob

2020-10-06 Thread Philippe Mathieu-Daudé
On 10/6/20 10:41 AM, Laszlo Ersek wrote: > On 10/05/20 11:16, Philippe Mathieu-Daudé wrote: >> Hi Laszlo, >> >> On 10/1/20 9:18 AM, Laszlo Ersek wrote: >>> On 09/29/20 17:46, Kevin Wolf wrote: Am 04.07.2020 um 18:39 hat Philippe Mathieu-Daudé geschrieben: > Since our format is consumable

Re: [PULL 5/5] crypto/tls-cipher-suites: Produce fw_cfg consumable blob

2020-10-06 Thread Laszlo Ersek
On 10/05/20 11:16, Philippe Mathieu-Daudé wrote: > Hi Laszlo, > > On 10/1/20 9:18 AM, Laszlo Ersek wrote: >> On 09/29/20 17:46, Kevin Wolf wrote: >>> Am 04.07.2020 um 18:39 hat Philippe Mathieu-Daudé geschrieben: Since our format is consumable by the fw_cfg device, we can implement the

Re: [RFC PATCH 1/3] qom: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-06 Thread Laszlo Ersek
On 10/05/20 12:54, Philippe Mathieu-Daudé wrote: > While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed > by a device only available using system-mode (fw_cfg), it is > implemented by a crypto component (tls-cipher-suites) which > is always available when crypto is used. > > Commit

Re: [PATCH v8 00/14] monitor: Optionally run handlers in coroutines

2020-10-06 Thread Markus Armbruster
Kevin Wolf writes: > Some QMP command handlers can block the main loop for a relatively long > time, for example because they perform some I/O. This is quite nasty. > Allowing such handlers to run in a coroutine where they can yield (and > therefore release the BQL) while waiting for an event