Re: [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure

2020-10-20 Thread Philippe Mathieu-Daudé
Hi Bin, On 8/21/20 7:29 PM, Philippe Mathieu-Daudé wrote: From: Bin Meng At present the function switch status data structure bit [399:376] are wrongly pupulated. These 3 bytes encode function switch status for the 6 function groups, with 4 bits per group, starting from function group 6 at

Re: [PATCH] docs: Better mention of qemu-img amend limitations

2020-10-20 Thread Eric Blake
On 9/23/20 4:56 PM, Nir Soffer wrote: > On Wed, Sep 23, 2020 at 11:38 PM Eric Blake wrote: >> >> Missed during merge resolution of commit bc5ee6da71. >> >> Signed-off-by: Eric Blake >> --- >> docs/tools/qemu-img.rst | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git

[PATCH 06/16] util/vfio-helpers: Trace PCI BAR region info

2020-10-20 Thread Philippe Mathieu-Daudé
For debug purpose, trace BAR regions info. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 8 util/trace-events | 1 + 2 files changed, 9 insertions(+) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index ac9cc20ce29..4204ce55445

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

2020-10-20 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 Reviewed-by: Philippe Mathieu-Daudé Message-id: 20201009175123.249009-3-js...@redhat.com Signed-off-by: John Snow

[PATCH v3 05/15] python: Add pipenv support

2020-10-20 Thread John Snow
pipenv is a tool used for managing virtual environments with pinned, explicit dependencies. It is used for precisely recreating python virtual environments. pipenv uses two files to do this: (1) Pipfile, which is similar in purpose and scope to what setup.py lists. It specifies the requisite

[PATCH v3 06/15] python: add pylint import exceptions

2020-10-20 Thread John Snow
Pylint 2.5.x and 2.6.x have regressions that make import checking inconsistent, see: https: //github.com/PyCQA/pylint/issues/3609 https: //github.com/PyCQA/pylint/issues/3624 https: //github.com/PyCQA/pylint/issues/3651 Pinning to 2.4.4 is worse, because it mandates versions of shared

[PATCH v3 13/15] python: move .isort.cfg into setup.cfg

2020-10-20 Thread John Snow
Signed-off-by: John Snow --- python/.isort.cfg | 7 --- python/setup.cfg | 8 2 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 python/.isort.cfg diff --git a/python/.isort.cfg b/python/.isort.cfg deleted file mode 100644 index 6d0fd6cc0d..00 ---

[PATCH v3 12/15] python: add mypy to pipenv

2020-10-20 Thread John Snow
0.730 appears to be about the oldest version that works with the features we want, including nice human readable output (to make sure iotest 297 passes), and type-parameterized Popen generics. 0.770, however, supports adding 'strict' to the config file, so require at least 0.770. Now that we are

[PATCH v3 15/15] python/qemu: add qemu package itself to pipenv

2020-10-20 Thread John Snow
This adds the python qemu packages themselves to the pipenv manifest. 'pipenv sync' will create a virtual environment sufficient to use the SDK. 'pipenv sync --dev' will create a virtual environment sufficient to use and test the SDK (with pylint, mypy, isort, flake8, etc.) The qemu packages are

[PATCH v3 14/15] python/qemu: add isort to pipenv

2020-10-20 Thread John Snow
isort 5.0.0 through 5.0.4 has a bug that causes it to misinterpret certain "from ..." clauses that are not related to imports. Require 5.0.5 or greater. isort can be run with 'isort -c qemu' from the python root. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daudé --- python/Pipfile

[PULL 12/21] python/qemu: Add mypy type annotations

2020-10-20 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 Reviewed-by: Kevin Wolf

[PULL 15/21] python/qemu/console_socket.py: Clarify type of drain_thread

2020-10-20 Thread John Snow
Mypy needs just a little help to guess the type here. Signed-off-by: John Snow Reviewed-by: Kevin Wolf Message-id: 20201006235817.3280413-15-js...@redhat.com Signed-off-by: John Snow --- python/qemu/console_socket.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH 16/16] util/vfio-helpers: Remove now unused qemu_vfio_pci_init_irq()

2020-10-20 Thread Philippe Mathieu-Daudé
Our only user, the NVMe block driver, switched to the MSIX API. As this function is now unused, remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/vfio-helpers.h | 2 -- util/vfio-helpers.c | 43 - 2 files changed, 45 deletions(-)

[PULL 11/21] iotests.py: Adjust HMP kwargs typing

2020-10-20 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.

[PULL 13/21] python/qemu/console_socket.py: Correct type of recv()

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

[PULL 03/21] python/machine.py: Fix monitor address typing

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

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

2020-10-20 Thread Nir Soffer
On Tue, Oct 20, 2020 at 8:52 PM 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 > Reviewed-by: Philippe Mathieu-Daudé > Message-id:

[PATCH v3 04/15] python: add directory structure README.rst files

2020-10-20 Thread John Snow
Add short readmes to python/, python/qemu/, python/qemu/machine, and python/qemu/machine that explain the directory hierarchy. These readmes are visible when browsing the source on e.g. gitlab/github and are designed to help new developers/users quickly make sense of the source tree. They are not

[PATCH v3 02/15] python: add qemu package installer

2020-10-20 Thread John Snow
Add setup.cfg and setup.py, necessary for installing a package via pip. Add a rst document explaining the basics of what this package is for and who to contact for more information. This document will be used as the landing page for the package on PyPI. I am not yet using a pyproject.toml style

[PATCH v3 03/15] python: add VERSION file

2020-10-20 Thread John Snow
Python infrastructure as it exists today is not capable reliably of single-sourcing a package version from a parent directory. The authors of pip are working to correct this, but as of today this is not possible to my knowledge. The problem is that when using pip to build and install a python

[PATCH v3 00/15] python: create installable package

2020-10-20 Thread John Snow
Based-on: https://gitlab.com/jsnow/qemu/-/tree/python This series factors the python/qemu directory as an installable package. It does not yet actually change the mechanics of how any other python source in the tree actually consumes it (yet), beyond the import path. The point of this series is

Re: [PATCH v4 4/7] nbd: Update qapi to support exporting multiple bitmaps

2020-10-20 Thread Markus Armbruster
Eric Blake writes: > On 10/20/20 3:51 AM, Markus Armbruster wrote: > >>> #define QAPI_LIST_ADD(list, element) do { \ >>> typeof(list) _tmp = g_new(typeof(*(list)), 1); \ >>> _tmp->value = (element); \ >>> _tmp->next = (list); \ >>> (list) = _tmp; \ >>> } while (0) >>> >>> >>>

RE: [PATCH v7 04/11] hw/block/nvme: Support allocated CNS command variants

2020-10-20 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Tuesday, October 20, 2020 4:21 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

RE: [PATCH v7 10/11] hw/block/nvme: Separate read and write handlers

2020-10-20 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Tuesday, October 20, 2020 8:36 AM > To: Klaus Jensen > Cc: Dmitry Fomichev ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

RE: [PATCH v7 01/11] hw/block/nvme: Add Commands Supported and Effects log

2020-10-20 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Monday, October 19, 2020 4:16 PM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

RE: [PATCH v7 03/11] hw/block/nvme: Add support for Namespace Types

2020-10-20 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Monday, October 19, 2020 4:54 PM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

RE: [PATCH v7 08/11] hw/block/nvme: Add injection of Offline/Read-Only zones

2020-10-20 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Monday, October 19, 2020 7:43 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org;

<    1   2