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
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
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
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
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
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 +
>
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)
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
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
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
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
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
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
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
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
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.
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
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
---
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
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
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
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
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:
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,
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
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
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
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
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 +
* 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
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"
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.
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
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
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
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,
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
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
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~
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
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
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
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
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
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
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
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
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
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
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
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 |
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
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
+++
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
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:
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 ++---
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 ++--
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
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
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
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
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
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
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:
>
>
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.
>
>
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
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
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
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
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
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
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
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
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
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
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
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
77 matches
Mail list logo