On Tue, Sep 29, 2020 at 04:47:14PM -0700, Sergey Nizovtsev wrote:
> Some objects accidentally inherit ObjectClass instead of Object.
> They compile silently but may crash after downcasting.
>
> In this patch, we introduce a coccinelle script to find broken
> declarations and fix them manually
Acked-by: Xinyu Li
在2020-10-05 04:40:10,Philippe Mathieu-Daudé写道:
> There is a number of contributions from these academic domains.
> Add the entries to the gitdm 'academic' domain map.
>
> Cc: Akkarit Sangpetch
> Cc: Alexander Bulekov
> Cc: Alexander Oleinik
> Cc: Alex Barcelo
> Cc: Brian
Acked-by: Xinyu Li
在2020-10-06 11:35:01,Alexander Bulekov写道:
> On 201004 2240, Philippe Mathieu-Daudé wrote:
> > There is a number of contributions from these academic domains.
> > Add the entries to the gitdm 'academic' domain map.
> >
> > Cc: Akkarit Sangpetch
> > Cc: Alexander Bulekov
> >
Acked-by: Xinyu Li
在2020-10-06 11:23:45,Fan Yang写道:
> Acked-by: Fan Yang
>
> On Mon, Oct 05, 2020 at 4:40AM +0800,Philippe Mathieu-Daudé
> wrote:
>
> > There is a number of contributions from these academic domains.
> > Add the entries to the gitdm 'academic' domain map.
> >
> > Cc:
On 05.10.20 22:52, Joseph Myers wrote:
> On Mon, 5 Oct 2020, Alex Bennée wrote:
>
>> Joseph Myers writes:
>>
>>> On Sun, 4 Oct 2020, Philippe Mathieu-Daudé wrote:
>>>
There is a number of contributors from this domain,
add its own entry to the gitdm domain map.
>>>
>>> At some point
Acked-by: Fan Yang
On Mon, Oct 05, 2020 at 4:40AM +0800,Philippe Mathieu-Daudé
wrote:
>
> There is a number of contributions from these academic domains.
> Add the entries to the gitdm 'academic' domain map.
>
> Cc: Akkarit Sangpetch
> Cc: Alexander Bulekov
> Cc: Alexander Oleinik
> Cc:
On 201004 2240, Philippe Mathieu-Daudé wrote:
> There is a number of contributions from these academic domains.
> Add the entries to the gitdm 'academic' domain map.
>
> Cc: Akkarit Sangpetch
> Cc: Alexander Bulekov
> Cc: Alexander Oleinik
> Cc: Alex Barcelo
> Cc: Brian Wheeler
> Cc: Chen
Acked-by: Fan Yang
On Mon, Oct 05, 2020 at 4:40AM +0800,Philippe Mathieu-Daudé
wrote:
> There is a number of contributions from these academic domains.
> Add the entries to the gitdm 'academic' domain map.
>
> Cc: Akkarit Sangpetch
> Cc: Alexander Bulekov
> Cc: Alexander Oleinik
> Cc:
> -Original Message-
> From: Keith Busch
> Sent: Wednesday, September 30, 2020 6:04 PM
> To: qemu-bl...@nongnu.org; qemu-devel@nongnu.org; Klaus Jensen
>
> Cc: Niklas Cassel ; Dmitry Fomichev
> ; Kevin Wolf ; Philippe
> Mathieu-Daudé ; Keith Busch
> Subject: [PATCH 3/9] hw/block/nvme:
> -Original Message-
> From: Keith Busch
> Sent: Wednesday, September 30, 2020 6:04 PM
> To: qemu-bl...@nongnu.org; qemu-devel@nongnu.org; Klaus Jensen
>
> Cc: Niklas Cassel ; Dmitry Fomichev
> ; Kevin Wolf ; Philippe
> Mathieu-Daudé ; Keith Busch
> Subject: [PATCH 1/9] hw/block/nvme:
On 10/5/20 7:05 PM, Cleber Rosa wrote:
Here on patches 08 an later, I've run:
flake8 ./scripts/qapi
And starting on patch 24 ("qapi/source.py: add type hint annotations")
it complained about:
/scripts/qapi/source.py:44:31: F821 undefined name 'T'
I think that must be flake8 < 3.8.0.
> -Original Message-
> From: Niklas Cassel
> Sent: Monday, October 5, 2020 7:41 AM
> To: Dmitry Fomichev
> Cc: Alistair Francis ; qemu-devel@nongnu.org;
> Damien Le Moal ; f...@euphon.net; Matias
> Bjorling ; qemu-bl...@nongnu.org;
> kw...@redhat.com; mlevi...@redhat.com;
On Mon, Oct 05, 2020 at 03:51:22PM -0400, John Snow wrote:
> Hi, this series adds static type hints to the QAPI module.
> This is part one!
>
> Part 1: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt1
> Everything: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6
>
> -
On Tue, 29 Sep 2020 at 05:53, John Wang wrote:
>
> G220A is a 2 socket x86 motherboard supported by OpenBMC.
> Strapping configuration was obtained from hardware.
>
> Signed-off-by: John Wang
Reviewed-by: Joel Stanley
> ---
> hw/arm/aspeed.c | 60
On Mon, Sep 28, 2020 at 7:05 PM Yifei Jiang wrote:
>
> In the case of supporting PMP feature, add PMP state description
> to vmstate_riscv_cpu.
>
> Signed-off-by: Yifei Jiang
> Signed-off-by: Yipeng Yin
> ---
> target/riscv/machine.c | 49 ++
> 1 file
I misspoke in my last comment, that first bullet should have said
- If you are running a Raspbian image, you must add "dwc_otg.fiq_fsm_enable=0"
to the '-append' command-line parameters.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to
On Thu, Oct 1, 2020 at 10:56 AM Richard Henderson
wrote:
>
> On 9/28/20 9:03 PM, Yifei Jiang wrote:
> > +VMSTATE_UINTTL(env.vsstatus, RISCVCPU),
> > +VMSTATE_UINTTL(env.vstvec, RISCVCPU),
> > +VMSTATE_UINTTL(env.vsscratch, RISCVCPU),
> > +VMSTATE_UINTTL(env.vsepc,
If you can upgrade to Qemu 5.1 or newer, you should be able to use the
builtin raspi2 or raspi3 emulation directly. Version 5.1 adds support for the
USB controller on the Pi.
There is no limitation on the amount of memory you can use with this
method, and the networking should work.
Here is the
As of version 5.1, Qemu now supports USB on Raspberry PI 2 and 3. There
are a few caveats:
- If you are running a Raspbian image, you must add "dwc_otg.fiq_fsm_enable=0"
to the '-kernel' command-line parameters.
- Raspbian images 2016-05-27-raspbian-jessie and earlier don't work, see
Bug
The $decl_type='type name' hack makes it impossible to document
macros with uppercase names (e.g. most of the macros in
object.h).
Now that we have explicitly tagged the struct and typedef doc
comments in memory.h and object.h, we don't need that hack
anymore. This will make the documentation
is not valid reST syntax.
Function @argument references don't need additional markup, so
just remove .
Constants were changed to use reST ``code`` syntax
Signed-off-by: Eduardo Habkost
Reviewed-by: Paolo Bonzini
Message-Id: <20201003025424.199291-6-ehabk...@redhat.com>
Signed-off-by: Eduardo
Long code lines don't look good in the rendered documents, make
them shorter.
Signed-off-by: Eduardo Habkost
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Paolo Bonzini
Message-Id: <20201003025424.199291-7-ehabk...@redhat.com>
Signed-off-by: Eduardo Habkost
---
docs/devel/qom.rst | 9
Correct copy/paste mistake in the DECLARE_INSTANCE_CHECKER and
DECLARE_CLASS_CHECKERS documentation.
Signed-off-by: Eduardo Habkost
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Paolo Bonzini
Message-Id: <20201003025424.199291-2-ehabk...@redhat.com>
Signed-off-by: Eduardo Habkost
---
is not valid reST syntax.
Signed-off-by: Eduardo Habkost
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Paolo Bonzini
Message-Id: <20201003025424.199291-5-ehabk...@redhat.com>
Signed-off-by: Eduardo Habkost
---
docs/devel/qom.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
If we explicitly indicate we are documenting a typedef or a
struct, we'll be able to remove the $decl_type='type name' hack
from kernel-doc.
Signed-off-by: Eduardo Habkost
Reviewed-by: Paolo Bonzini
Message-Id: <20201003024123.193840-4-ehabk...@redhat.com>
Signed-off-by: Eduardo Habkost
---
Some code blocks had one extra space, fix that.
Signed-off-by: Eduardo Habkost
Reviewed-by: Paolo Bonzini
Message-Id: <20201003025424.199291-4-ehabk...@redhat.com>
Signed-off-by: Eduardo Habkost
---
docs/devel/qom.rst | 76 +++---
1 file changed, 38
This will allow us to remove the QEMU-specific
$decl_type='type name' hack from the kernel-doc script.
Signed-off-by: Eduardo Habkost
Reviewed-by: Paolo Bonzini
Message-Id: <20201003024123.193840-5-ehabk...@redhat.com>
Signed-off-by: Eduardo Habkost
---
include/exec/memory.h | 6 +++---
1
From: Philippe Mathieu-Daudé
We are going to split this file and reuse these static functions.
Declare them in the local "qdev-prop-internal.h" header.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
Message-Id: <20200930164949.1425294-8-phi...@redhat.com>
Signed-off-by:
One example that was not being parsed correctly by kernel-doc is:
typedef Object *(ObjectPropertyResolve)(Object *obj,
void *opaque,
const char *part);
Signed-off-by: Eduardo Habkost
Reviewed-by: Paolo Bonzini
Example of typedef that was not parsed by kernel-doc:
typedef void (ObjectUnparent)(Object *obj);
Signed-off-by: Eduardo Habkost
Reviewed-by: Paolo Bonzini
Message-Id: <20201003024123.193840-3-ehabk...@redhat.com>
Signed-off-by: Eduardo Habkost
---
scripts/kernel-doc | 2 +-
1 file
From: Philippe Mathieu-Daudé
Instead of only displaying the property missing, also display
the object name. This help developer to quickly figure out the
mistake without opening a debugger.
Signed-off-by: Philippe Mathieu-Daudé
Signed-off-by: Eduardo Habkost
Reviewed-by: Li Qiang
Acked-by:
From: Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
Message-Id: <20200930164949.1425294-7-phi...@redhat.com>
Signed-off-by: Eduardo Habkost
---
include/hw/qdev-properties.h | 1 +
hw/core/qdev-properties.c| 7 +++
2 files changed, 8
The list was incorrectly parsed as a literal block due to
indentation.
Signed-off-by: Eduardo Habkost
Reviewed-by: Paolo Bonzini
Message-Id: <20201003025424.199291-3-ehabk...@redhat.com>
Signed-off-by: Eduardo Habkost
---
docs/devel/qom.rst | 6 +++---
1 file changed, 3 insertions(+), 3
From: Philippe Mathieu-Daudé
We are going to split this file and reuse these static functions.
Add the local "qdev-prop-internal.h" header declaring them.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
Message-Id: <20200930164949.1425294-6-phi...@redhat.com>
From: Philippe Mathieu-Daudé
We will soon move this code, fix its style to avoid checkpatch.pl
to complain.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
Message-Id: <20200930164949.1425294-5-phi...@redhat.com>
Signed-off-by: Eduardo Habkost
---
From: Philippe Mathieu-Daudé
Replace strtoul() by qemu_strtoul() so checkpatch.pl won't complain
if we move this code later.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
Message-Id: <20200930164949.1425294-4-phi...@redhat.com>
Signed-off-by: Eduardo Habkost
---
From: Philippe Mathieu-Daudé
Move properties specific to machines into a separate file.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
Message-Id: <20200930164949.1425294-9-phi...@redhat.com>
Signed-off-by: Eduardo Habkost
---
hw/core/qdev-properties-system.c | 687
From: Philippe Mathieu-Daudé
The MACAddr structure contains an array of uint8_t. Previously
if a value was out of the [0..255] range, it was silently casted
and no input validation was done.
Replace strtol() by qemu_strtol() -- so checkpatch.pl won't
complain if we move this code later -- and
From: Philippe Mathieu-Daudé
cpu_common_reset() uses tcg_flush_softmmu_tlb() which is
declared in "exec/cpu-common.h". Add the missing header
to avoid when refactoring other headers:
hw/core/cpu.c: In function ‘cpu_common_reset’:
hw/core/cpu.c:273:9: error: implicit declaration of function
The following changes since commit 36d9c2883e55c863b622b99f0ebb5143f0001401:
readthedocs: build with Python 3.6 (2020-10-05 16:30:45 +0100)
are available in the Git repository at:
git://github.com/ehabkost/qemu.git tags/machine-next-pull-request
for you to fetch changes up to
From: Igor Mammedov
Spec[1] defines 0 - 3 level memory side cache, however QEMU
CLI allows to specify an intermediate cache level without
specifying previous level. Such option(s) silently ignored
when building HMAT table, which leads to incomplete cache
information.
Make sure that previous
Signed-off-by: Eduardo Habkost
---
docs/devel/qtest.rst | 6 ++
tests/qtest/libqos/libqtest.h | 20 ++--
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/docs/devel/qtest.rst b/docs/devel/qtest.rst
index 3bf9ebee7f0..075fe5f7d53 100644
---
On Mon, 5 Oct 2020, Alex Bennée wrote:
> Joseph Myers writes:
>
> > On Sun, 4 Oct 2020, Philippe Mathieu-Daudé wrote:
> >
> >> There is a number of contributors from this domain,
> >> add its own entry to the gitdm domain map.
> >
> > At some point the main branding will be Siemens; not sure
This moves the QTest section of testing.rst to a separate
document, and include the QTest Protocol specification and
libqtest API reference in the document.
Eduardo Habkost (3):
docs: Move QTest documentation to its own document
docs/devel/qtest: Include protocol spec in document
The qtest and libqtest doc comments will be parsed to generate
API documentation, so move QTest documentation to its own
document where the API and format documentation and will be
included.
Signed-off-by: Eduardo Habkost
---
docs/devel/index.rst | 1 +
docs/devel/qtest.rst | 58
Include the QTest Protocol doc string in docs/devel/qtest.rst,
after converting it to use Sphinx syntax.
Signed-off-by: Eduardo Habkost
---
docs/devel/qtest.rst | 12 ++--
softmmu/qtest.c | 73 +++-
2 files changed, 75 insertions(+), 10
Which Beagle boards, Jetson Nano, other devices have rich support from
qemu? ARM is critical going forward.
On Mon, Oct 5, 2020, 10:20 AM Dims <1772...@bugs.launchpad.net> wrote:
> So, is it still true, that QEMU doesn't support USB on Raspberry Pi?
>
> In other words I can't emulate Raspberry
On Mon, Oct 5, 2020 at 11:52 PM Yonggang Luo wrote:
> The sh script are harder to maintain for compatible different
> xsh environment so convert it to python script
> Also incorporate the fixes in
>
> https://patchew.org/QEMU/20200929143654.518157-1-marcandre.lur...@redhat.com/
>
> Testing args
A PLL channel is able to further divide the generated PLL frequency.
The divider is given in the CTRL_A2W register. Some channels have an
additional fixed divider which is always applied to the signal.
Tested-by: Philippe Mathieu-Daudé
Signed-off-by: Luc Michel
---
hw/misc/bcm2835_cprman.c |
The CPRMAN PLLs generate a clock based on a prescaler, a multiplier and
a divider. The prescaler doubles the parent (xosc) frequency, then the
multiplier/divider are applied. The multiplier has an integer and a
fractional part.
This commit also implements the CPRMAN CM_LOCK register. This
Connect the 'uart-out' clock from the CPRMAN to the PL011 instance.
Signed-off-by: Luc Michel
---
hw/arm/bcm2835_peripherals.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c
index 9d6190042d..d8f28b1ae2 100644
---
There are 5 PLLs in the CPRMAN, namely PLL A, C, D, H and B. All of them
take the xosc clock as input and produce a new clock.
This commit adds a skeleton implementation for the PLLs as sub-devices
of the CPRMAN. The PLLs are instantiated and connected internally to the
main oscillator.
Each PLL
On Wed, Sep 30, 2020 at 3:47 AM Sergey Nizovtsev wrote:
>
> Some objects accidentally inherit ObjectClass instead of Object.
> They compile silently but may crash after downcasting.
>
> In this patch, we introduce a coccinelle script to find broken
> declarations and fix them manually with proper
Those reset values have been extracted from a Raspberry Pi 3 model B
v1.2, using the 2020-08-20 version of raspios. The dump was done using
the debugfs interface of the CPRMAN driver in Linux (under
'/sys/kernel/debug/clk'). Each exposed clock tree stage (PLLs, channels
and muxes) can be observed
The BCM2835 CPRMAN is the clock manager of the SoC. It is composed of a
main oscillator, and several sub-components (PLLs, multiplexers, ...) to
generate the BCM2835 clock tree.
This commit adds a skeleton of the CPRMAN, with a dummy register
read/write implementation. It embeds the main
Add a clock input to the PL011 UART so we can compute the current baud
rate and trace it. This is intended for developers who wish to use QEMU
to e.g. debug their firmware or to figure out the baud rate configured
by an unknown/closed source binary.
Reviewed-by: Philippe Mathieu-Daudé
On Tue, Oct 6, 2020 at 3:23 AM Peter Maydell
wrote:
>
> On Mon, 5 Oct 2020 at 18:24, Yonggang Luo wrote:
> >
> > The sh script are harder to maintain for compatible different
> > xsh environment
> >
> > Signed-off-by: Yonggang Luo
> > ---
> > meson.build | 2 +-
> >
The nanosecond unit greatly limits the dynamic range we can display in
clock value traces, for values in the order of 1GHz and more. The
internal representation can go way beyond this value and it is quite
common for today's clocks to be within those ranges.
For example, a frequency between
A clock mux can be configured to select one of its 10 sources through
the CM_CTL register. It also embeds yet another clock divider, composed
of an integer part and a fractional part. The number of bits of each
part is mux dependent.
Tested-by: Philippe Mathieu-Daudé
Signed-off-by: Luc Michel
This simple mux sits between the PLL channels and the DSI0E and DSI0P
clock muxes. This mux selects between PLLA-DSI0 and PLLD-DSI0 channel
and outputs the selected signal to source number 4 of DSI0E/P clock
muxes. It is controlled by the cm_dsi0hsck register.
Reviewed-by: Philippe Mathieu-Daudé
PLLs are composed of multiple channels. Each channel outputs one clock
signal. They are modeled as one device taking the PLL generated clock as
input, and outputting a new clock.
A channel shares the CM register with its parent PLL, and has its own
A2W_CTRL register. A write to the CM register
The CPRMAN (clock controller) was mapped at the watchdog/power manager
address. It was also split into two unimplemented peripherals (CM and
A2W) but this is really the same one, as shown by this extract of the
Raspberry Pi 3 Linux device tree:
watchdog@7e10 {
compatible =
This function creates a clock a parent it to another object with a given
name. It calls clock_setup_canonical_path before returning the new
clock.
This function is useful to create clocks in devices when one doesn't
want to expose it at the qdev level (as an input or an output).
Suggested-by:
The clock multiplexers are the last clock stage in the CPRMAN. Each mux
outputs one clock signal that goes out of the CPRMAN to the SoC
peripherals.
Each mux has at most 10 sources. The sources 0 to 3 are common to all
muxes. They are:
0. ground (no clock signal)
1. the main oscillator
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
Tested-by: Cleber Rosa
---
scripts/qapi/mypy.ini | 5 ---
scripts/qapi/visit.py | 73 +--
2
v1 -> v2:
- patch 05: Added a comment about MMIO .valid constraints [Phil]
- patch 05: Added MMIO .impl [Phil]
- patch 05: Moved init_internal_clock to the public clock API, renamed
clock_new (new patch 03) [Phil]
- patch 11: use muldiv64 for clock mux frequency output computation
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Damien Hedde
Signed-off-by: Luc Michel
---
include/hw/clock.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/include/hw/clock.h b/include/hw/clock.h
index d357594df9..c93e6113cd 100644
--- a/include/hw/clock.h
+++ b/include/hw/clock.h
And this fixes the pylint report for this file, so make sure we check
this in the future, too.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
Tested-by: Cleber Rosa
---
scripts/qapi/pylintrc | 1 -
scripts/qapi/visit.py | 4 ++--
2 files changed, 2
"John, if pylint told you to jump off a bridge, would you?"
Hey, if it looked like fun, I might.
Now that this file is clean, enable pylint checks on this file.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/pylintrc | 1 -
This is true by design, but not presently able to be expressed in the
type system. An assertion helps mypy understand our constraints.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/visit.py | 12 +++-
1 file changed, 7 insertions(+), 5
module_basename doesn't use the 'what' argument, so remove it.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/gen.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py
index
'fp' and 'fd' are self-evident in context, add them to the list of OK
names.
_top and _bottom also need to stay standard methods because some users
override the method and need to use `self`. Tell pylint to shush.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
Make the file handling here just a tiny bit more idiomatic.
(I realize this is heavily subjective.)
Use exist_ok=True for os.makedirs and remove the exception,
use fdopen() to wrap the file descriptor in a File-like object,
and use a context manager for managing the file pointer.
Signed-off-by:
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/gen.py | 104
1 file changed, 57 insertions(+), 47 deletions(-)
diff
The edge case is that if the name is '', this expression returns a
string instead of a bool, which violates our declared type.
Signed-off-by: John Snow
Reviewed-by: Cleber Rosa
Reviewed-by: Eduardo Habkost
---
scripts/qapi/gen.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/mypy.ini | 5 ---
scripts/qapi/types.py | 86 ---
2 files changed, 64
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/commands.py | 71 ++--
1 file changed, 54 insertions(+), 17 deletions(-)
diff
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/mypy.ini | 5 -
1 file changed, 5 deletions(-)
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
index 5df11e53fd1..8ab9ac52cc4 100644
--- a/scripts/qapi/mypy.ini
+++
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
Tested-by: Cleber Rosa
---
scripts/qapi/mypy.ini | 5 -
1 file changed, 5 deletions(-)
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
index 1b8555dfa39..c6960ff2dbd 100644
---
Annotations do not change runtime behavior.
This commit *only* adds annotations.
A note on typing of __init__: mypy requires init functions with no
parameters to document a return type of None to be considered fully
typed. In the case when there are input parameters, None may be omitted.
Since
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/events.py | 46 --
scripts/qapi/mypy.ini | 5 -
2 files changed, 35
Shush an error and leave a hint for future cleanups when we're allowed
to use Python 3.7+.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
Tested-by: Cleber Rosa
---
scripts/qapi/pylintrc | 1 -
scripts/qapi/source.py | 3 +++
2 files changed, 3 insertions(+),
As docstrings, they'll show up in documentation and IDE help.
The docstring style being targeted is the Sphinx documentation
style. Sphinx uses an extension of ReST with "domains". We use the
(implicit) Python domain, which supports a number of custom "info
fields". Those info fields are
Clarify them while we're here.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/events.py | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py
index 57e0939e963..599f3d1f564
Mypy isn't a fan of rebinding a variable with a new data type.
It's easy enough to avoid.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/commands.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/scripts/qapi/commands.py
Fix two very minor issues, and then establish a mypy type-checking
baseline.
Like pylint, this should be run from the folder above:
> mypy --config-file=qapi/mypy.ini qapi/
This is designed and tested for mypy 0.770 or greater.
Signed-off-by: John Snow
Tested-by: Eduardo Habkost
At this point, that just means using a consistent strategy for constant names.
constants get UPPER_CASE and names not used externally get a leading underscore.
As a preference, while renaming constants to be UPPERCASE, move them to
the head of the file. Generally, it's nice to be able to audit
Including it in common.py creates a circular import dependency; schema
relies on common, but common.build_params requires a type annotation
from schema. To type this properly, it needs to be moved outside the
cycle.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/common.py | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index ba35abea478..cee63eb95c7 100644
--- a/scripts/qapi/common.py
Wildcard includes become hard to manage when refactoring and dealing
with circular dependencies with strictly typed mypy.
flake8 also flags each one as a warning, as it is not smart enough to
know which names exist in the imported file.
Remove them and include things explicitly by name instead.
Signed-off-by: John Snow
Reviewed-by: Cleber Rosa
Reviewed-by: Eduardo Habkost
---
scripts/qapi/common.py | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index a417b6029c8..338adedef4f 100644
---
Code style tools really dislike the use of global keywords, because it
generally involves re-binding the name at runtime which can have strange
effects depending on when and how that global name is referenced in
other modules.
Make a little indent level manager instead.
Signed-off-by: John Snow
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Signed-off-by: John Snow
Reviewed-by: Eduardo Habkost
Reviewed-by: Cleber Rosa
---
scripts/qapi/common.py | 27 ---
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git
Using `pylint --generate-rcfile > pylintrc`, generate a skeleton
pylintrc file. Sections that are not presently relevant (by the end of
this series) are removed leaving just the empty section as a search
engine / documentation hint to future authors.
I am targeting pylint 2.6.0. In the future
A precise style guide and a package-wide overhaul is forthcoming pending
further discussion and consensus. At present, we are avoiding obvious
errors that cause sphinx documentation build problems.
A preliminary style guide is loosely based on PEP 257 and Sphinx
Autodoc. It is chosen for
Remove qapi/common.py from the pylintrc ignore list.
Signed-off-by: John Snow
Reviewed-by: Cleber Rosa
Tested-by: Cleber Rosa
Tested-by: Eduardo Habkost
---
scripts/qapi/pylintrc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/qapi/pylintrc
All of the QAPI include statements are changed to be package-aware, as
explicit relative imports.
A quirk of Python packages is that the name of the package exists only
*outside* of the package. This means that to a module inside of the qapi
folder, there is inherently no such thing as the "qapi"
Hi, this series adds static type hints to the QAPI module.
This is part one!
Part 1: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt1
Everything: https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6
- Requires Python 3.6+
- Requires mypy 0.770 or newer (for type analysis
In two different places, we are not making a cross-reference to some
resource correctly.
Signed-off-by: John Snow
---
docs/devel/multi-thread-tcg.rst | 2 +-
docs/devel/testing.rst | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/devel/multi-thread-tcg.rst
Petty style guide fixes and line length enforcement. Not a big win, not
a big loss, but flake8 passes 100% on the qapi module, which gives us an
easy baseline to enforce hereafter.
A note on the flake8 exception: flake8 will warn on *any* bare except,
but pylint's is context-aware and will
1 - 100 of 359 matches
Mail list logo