> -Original Message-
> From: Li Zhijian
> Sent: Wednesday, September 23, 2020 2:18 PM
> To: Zhang, Chen ; jasow...@redhat.com
> Cc: qemu-devel@nongnu.org
> Subject: Re: [PATCH 1/3] colo-compare: return -1 if no packet is queued
>
>
>
> On 9/23/20 9:41 AM, Zhang, Chen wrote:
> >
> >> -
> -Original Message-
> From: Li Zhijian
> Sent: Tuesday, September 22, 2020 2:47 PM
> To: Zhang, Chen ; Jason Wang
> ; qemu-dev
> Cc: Zhang Chen
> Subject: Re: [PATCH 3/4] net/colo-compare.c: Add secondary old packet
> detection
>
>
>
> On 9/18/20 5:22 PM, Zhang Chen wrote:
> > From
Hi Kirti,
A few trivial comments from the first read through.
On 2020/9/23 7:24, Kirti Wankhede wrote:
These functions save and restore PCI device specific data - config
space of PCI device.
Used VMStateDescription to save and restore interrupt state.
Signed-off-by: Kirti Wankhede
Reviewed-by
> diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
> index 21b7a0484b..cb931d0fda 100644
> --- a/audio/sdlaudio.c
> +++ b/audio/sdlaudio.c
> @@ -253,6 +253,7 @@ static void sdl_callback (void *opaque, Uint8 *buf, int
> len)
> return ret;
On 22.09.2020 16:13, Paolo Bonzini wrote:
On 22/09/20 14:16, Pavel Dovgalyuk wrote:
+
+When you need to use snapshots with diskless virtual machine,
+it must be started with 'orphan' qcow2 image. This image will be used
+for storing VM snapshots. Here is the example of the command line for this:
On 9/23/20 9:41 AM, Zhang, Chen wrote:
-Original Message-
From: Li Zhijian
Sent: Tuesday, September 22, 2020 5:55 PM
To: Zhang, Chen ; jasow...@redhat.com
Cc: qemu-devel@nongnu.org; Li Zhijian
Subject: [PATCH 1/3] colo-compare: return -1 if no packet is queued
Return 0 will trigge
Yes that's a silly mistake that invokes the linker with a dummy empty
argument. I'll fix it and repost, thanks for testing on Arch!
Paolo
Il mar 22 set 2020, 23:41 Toolybird <1896...@bugs.launchpad.net> ha
scritto:
> ** Attachment added: "meson-log.txt"
>
> https://bugs.launchpad.net/qemu/+bug/1
On 22/09/2020 12.31, David Hildenbrand wrote:
> Easy, just like ADD HALFWORD IMMEDIATE (AGHI).
>
> Signed-off-by: David Hildenbrand
> ---
> target/s390x/insn-data.def | 1 +
> target/s390x/translate.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/target/s390x/insn-data.def b/targ
22.09.2020 21:11, Neal Gompa wrote:
On Tue, Sep 22, 2020 at 1:43 PM Daniel P. Berrangé wrote:
On Tue, Sep 22, 2020 at 01:09:06PM -0400, Neal Gompa wrote:
On Tue, Sep 22, 2020 at 12:16 PM Daniel P. Berrangé wrote:
2 years back I proposed dropping the sheepdog mailing list from the
MAINTAINE
On 22/09/2020 12.31, David Hildenbrand wrote:
> Easy to wire up.
>
> Signed-off-by: David Hildenbrand
> ---
> target/s390x/insn-data.def | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
> index 8dbeaf8c49..e851e9df5e 100644
> --- a
On 22/09/2020 12.31, David Hildenbrand wrote:
> Easy, just like ADD HALFWORD IMMEDIATE (AGHI).
>
> Signed-off-by: David Hildenbrand
> ---
> target/s390x/insn-data.def | 1 +
> target/s390x/translate.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/target/s390x/insn-data.def b/targ
On 9/22/20 5:24 PM, leirao wrote:
we should set ram_bulk_stage to false after ram_state_init,
otherwise the bitmap will be unused in migration_bitmap_find_dirty.
all pages in ram cache will be flushed to the ram of secondary guest
for each checkpoint.
Signed-off-by: leirao
---
migration/ra
From: Erich McMillan
Signed-off-by: Erich McMillan
---
hw/i386/pc.c | 50
hw/i386/pc_sysfw.c | 13 ++--
include/hw/i386/pc.h | 2 ++
3 files changed, 54 insertions(+), 11 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index
On 9/22/20 6:30 PM, Philippe Mathieu-Daudé wrote:
On 9/22/20 11:56 AM, zhenwei pi wrote:
Post memory failure event to uplayer to handle hardware memory
corrupted event. Rather than simple QEMU log, QEMU could report more
effective message to uplayer. For example, guest crashes by MCE,
selecti
KVM_CAP_IRQ_ROUTING has been available for x86 since Linux 2.6.33.
We can make it a requirement since that was more than ten years ago.
Signed-off-by: Paolo Bonzini
---
hw/i386/fw_cfg.c | 2 +-
hw/i386/kvm/apic.c | 4 +---
hw/i386/microvm.c | 2 +-
hw/i386/pc.c | 2 +
Paravirtualized features have been listed in KVM_GET_SUPPORTED_CPUID since
Linux 2.6.35 (commit 84478c829d0f, "KVM: x86: export paravirtual cpuid flags
in KVM_GET_SUPPORTED_CPUID", 2010-05-19). It has been more than 10 years,
so remove the fallback code.
Signed-off-by: Paolo Bonzini
---
target/
> > Hi Eduardo,
> > This patch set will remove some limitations of Intel PT CPUID
> > information.
> > 1. The "IP payloads" feature will disable the Intel PT in guests and it
> > will be
> coming soon.
> > 2. To make the live migration safe, we set the Intel PT CPUID as a
> > constan
On 22/09/20 21:47, Eduardo Habkost wrote:
> We don't need to use kernel-irqchip=off for irq0 override if IRQ
> routing is supported by the host, which is the case since 2009
> (IRQ routing was added to KVM in Linux v2.6.30).
>
> This is a more straightforward fix for Launchpad bug #1896263, as
> i
> -Original Message-
> From: Li Zhijian
> Sent: Tuesday, September 22, 2020 5:55 PM
> To: Zhang, Chen ; jasow...@redhat.com
> Cc: qemu-devel@nongnu.org; Li Zhijian
> Subject: [PATCH 3/3] colo-compare: check mark in mutual exclusion
>
> Signed-off-by: Li Zhijian
Reviewed-by: Zhang Ch
> -Original Message-
> From: Li Zhijian
> Sent: Tuesday, September 22, 2020 5:55 PM
> To: Zhang, Chen ; jasow...@redhat.com
> Cc: qemu-devel@nongnu.org; Li Zhijian
> Subject: [PATCH 2/3] colo-compare: fix missing compare_seq initialization
>
> Signed-off-by: Li Zhijian
Reviewed-by:
> -Original Message-
> From: Li Zhijian
> Sent: Tuesday, September 22, 2020 5:55 PM
> To: Zhang, Chen ; jasow...@redhat.com
> Cc: qemu-devel@nongnu.org; Li Zhijian
> Subject: [PATCH 1/3] colo-compare: return -1 if no packet is queued
>
> Return 0 will trigger a packet comparison
>
Y
> -Original Message-
> From: Rao, Lei
> Sent: Tuesday, September 22, 2020 5:25 PM
> To: Zhang, Chen ; lizhij...@cn.fujitsu.com;
> jasow...@redhat.com; quint...@redhat.com; dgilb...@redhat.com;
> pbonz...@redhat.com
> Cc: qemu-devel@nongnu.org; Rao, Lei
> Subject: [PATCH v2 3/3] Fix the
> -Original Message-
> From: Rao, Lei
> Sent: Tuesday, September 22, 2020 5:25 PM
> To: Zhang, Chen ; lizhij...@cn.fujitsu.com;
> jasow...@redhat.com; quint...@redhat.com; dgilb...@redhat.com;
> pbonz...@redhat.com
> Cc: qemu-devel@nongnu.org; Rao, Lei
> Subject: [PATCH v2 2/3] Reduce
> -Original Message-
> From: Rao, Lei
> Sent: Tuesday, September 22, 2020 5:25 PM
> To: Zhang, Chen ; lizhij...@cn.fujitsu.com;
> jasow...@redhat.com; quint...@redhat.com; dgilb...@redhat.com;
> pbonz...@redhat.com
> Cc: qemu-devel@nongnu.org; Rao, Lei
> Subject: [PATCH v2 1/3] Optimiz
On Tue, Sep 22, 2020 at 05:00:26PM -0400, John Snow wrote:
> As part of delinting and adding type hints to the QAPI generator, it's
> helpful for the entrypoint to be part of the package, only leaving a
> very tiny entrypoint shim outside of the module.
>
> Signed-off-by: John Snow
> ---
> scrip
If the device is not a failover primary device, call
vfio_migration_probe() and vfio_migration_finalize() to enable
migration support for those devices that support it respectively to
tear it down again.
Removed vfio_pci_vmstate structure.
Removed migration blocker from VFIO PCI device specific str
With vIOMMU, IO virtual address range can get unmapped while in pre-copy
phase of migration. In that case, unmap ioctl should return pages pinned
in that range and QEMU should find its correcponding guest physical
addresses and report those dirty.
Suggested-by: Alex Williamson
Signed-off-by: Kirt
vfio_listener_log_sync gets list of dirty pages from container using
VFIO_IOMMU_GET_DIRTY_BITMAP ioctl and mark those pages dirty when all
devices are stopped and saving state.
Return early for the RAM block section of mapped MMIO region.
Signed-off-by: Kirti Wankhede
Reviewed-by: Neo Jia
---
h
Create mapped iova list when vIOMMU is enabled. For each mapped iova
save translated address. Add node to list on MAP and remove node from
list on UNMAP.
This list is used to track dirty pages during migration.
Signed-off-by: Kirti Wankhede
---
hw/vfio/common.c | 58
Call VFIO_IOMMU_DIRTY_PAGES ioctl to start and stop dirty pages tracking
for VFIO devices.
Signed-off-by: Kirti Wankhede
Reviewed-by: Dr. David Alan Gilbert
---
hw/vfio/migration.c | 36
1 file changed, 36 insertions(+)
diff --git a/hw/vfio/migration.c b/hw
mr->ram_block is NULL when mr->is_iommu is true, then fr.dirty_log_mask
wasn't set correctly due to which memory listener's log_sync doesn't
get called.
This patch returns log_mask with DIRTY_MEMORY_MIGRATION set when
IOMMU is enabled.
Signed-off-by: Kirti Wankhede
---
softmmu/memory.c | 2 +-
1
Added .save_live_pending, .save_live_iterate and .save_live_complete_precopy
functions. These functions handles pre-copy and stop-and-copy phase.
In _SAVING|_RUNNING device state or pre-copy phase:
- read pending_bytes. If pending_bytes > 0, go through below steps.
- read data_offset - indicates k
Sequence during _RESUMING device state:
While data for this device is available, repeat below steps:
a. read data_offset from where user application should write data.
b. write data of data_size to migration region from data_offset.
c. write data_size which indicates vendor driver that data is wri
Added helper functions to get IOMMU info capability chain.
Added function to get migration capability information from that
capability chain for IOMMU container.
Similar change was proposed earlier:
https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg03759.html
Disable migration for devices
Added amount of bytes transferred to the target VM by all VFIO devices
Signed-off-by: Kirti Wankhede
---
Note: Comments from v25 for this patch are not addressed yet.
https://www.mail-archive.com/qemu-devel@nongnu.org/msg715620.html
Alex, need more pointer on documentation part raised Markus Ar
Added migration state change notifier to get notification on migration state
change. These states are translated to VFIO device state and conveyed to vendor
driver.
Signed-off-by: Kirti Wankhede
Reviewed-by: Neo Jia
Reviewed-by: Dr. David Alan Gilbert
---
hw/vfio/migration.c | 29 +++
VM state change handler gets called on change in VM's state. This is used to set
VFIO device state to _RUNNING.
Signed-off-by: Kirti Wankhede
Reviewed-by: Neo Jia
Reviewed-by: Dr. David Alan Gilbert
---
hw/vfio/migration.c | 136 ++
hw/vfio/tra
Whether the VFIO device supports migration or not is decided based of
migration region query. If migration region query is successful and migration
region initialization is successful then migration is supported else
migration is blocked.
Signed-off-by: Kirti Wankhede
Reviewed-by: Neo Jia
Acked-
Hook vfio_get_object callback for PCI devices.
Signed-off-by: Kirti Wankhede
Reviewed-by: Neo Jia
Suggested-by: Cornelia Huck
Reviewed-by: Cornelia Huck
---
hw/vfio/pci.c | 8
include/hw/vfio/vfio-common.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/hw/vfio/
Define flags to be used as delimeter in migration file stream.
Added .save_setup and .save_cleanup functions. Mapped & unmapped migration
region from these functions at source during saving or pre-copy phase.
Set VFIO device state depending on VM's state. During live migration, VM is
running when .
These functions save and restore PCI device specific data - config
space of PCI device.
Used VMStateDescription to save and restore interrupt state.
Signed-off-by: Kirti Wankhede
Reviewed-by: Neo Jia
---
hw/vfio/pci.c | 134 ++
hw/vfio/pci
This function will be used for migration region.
Migration region is mmaped when migration starts and will be unmapped when
migration is complete.
Signed-off-by: Kirti Wankhede
Reviewed-by: Neo Jia
Reviewed-by: Cornelia Huck
---
hw/vfio/common.c | 32 --
Hi,
This Patch set adds migration support for VFIO devices in QEMU.
This Patch set include patches as below:
Patch 1-2:
- Few code refactor
Patch 3:
- Added save and restore functions for PCI configuration space. Used
pci_device_save() and pci_device_load() so that config space cache is saved
On Tue, Sep 22, 2020 at 05:00:25PM -0400, John Snow wrote:
> This is a minor re-work of the entrypoint script. It isolates a
> generate() method from the actual command-line mechanism.
>
> Signed-off-by: John Snow
> ---
> scripts/qapi-gen.py | 87 -
>
On Tue, Sep 22, 2020 at 05:00:24PM -0400, John Snow wrote:
> This adds some really childishly simple debugging tools. Maybe they're
> interesting for someone else, too?
>
> Signed-off-by: John Snow
> ---
> scripts/qapi/debug.py | 78 +++
> 1 file changed,
On 22.09.2020 09:26, David Hildenbrand wrote:
> On 22.09.20 00:22, Maciej S. Szmigiero wrote:
>> Hi David,
>>
>> Thank you for your comments.
>>
(...)
>>
>> The idea is to use virtual DIMM sticks for hot-adding extra memory at
>> runtime, while using ballooning for runtime adjustment of the guest
>
On 9/22/20 5:31 PM, Eduardo Habkost wrote:
I'm stepping out as maintainer of ./scripts/*.py, but still
willing to help review patches for Python code.
Signed-off-by: Eduardo Habkost
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
John Snow (1):
MAINTAINERS: Add Python library stanza
MAINTAINERS | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
--
2.26.2
Add some microdocumentation that gives a nice file-level overview of
this 1300+ line file.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 36 +---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
On 9/22/20 6:34 PM, John Snow wrote:
based-on: <20200922210101.4081073-1-js...@redhat.com>
^ Copy-paste malfunction
based-on: <20200922212115.4084301-1-js...@redhat.com>
[PATCH 0/6] qapi: static typing conversion, pt4
Hi, this series adds static type hints to the QAPI module.
Thi
This is an interface with a default implementation. Pylint doesn't have
enough context to be aware of this.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 271befea1c..6ecbc2aa6b 100644
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index baafe3babf..6b47ca26e0 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -309,7 +309,7 @@ def doc_type(se
It is generally nicer to just let things fail, because it makes the
static type hints less infected with Optional[T], where a future
programmer using the library has to wonder what that means.
Let errors be errors.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 7 ---
1 file changed,
I'm proposing that I split the actual Python library off from the other
miscellaneous python scripts we have and declare it maintained. Add
myself as a maintainer of this folder, along with Cleber.
v2: change python/* to python/, thanks Alex.
Signed-off-by: John Snow
Reviewed-by: Philippe Mathie
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index aaf20f776b..15ff441660 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -546,15 +546,18 @@ def se
On Tue, Sep 22, 2020 at 12:09:46PM +0100, Dr. David Alan Gilbert wrote:
>
> Do you have the numbers for:
>epool
>epool thread-pool-size=1
>spool
Hi David,
Ok, I re-ran my numbers again after upgrading to latest qemu and also
upgraded host kernel to latest upstream. Apart from compari
Signed-off-by: John Snow
---
scripts/qapi/mypy.ini | 6 --
1 file changed, 6 deletions(-)
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
index 20ab509946..df60c18de1 100644
--- a/scripts/qapi/mypy.ini
+++ b/scripts/qapi/mypy.ini
@@ -1,10 +1,4 @@
[mypy]
strict = True
strict_opt
We are using meta as a class variable, but union types use this as a
mutable value which changes the value for the class, not the instance.
Use the empty string as the default/empty value for ease of typing. It
is still false-ish, so it will work just fine.
Signed-off-by: John Snow
---
scripts/
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 8907bec0b5..61238c0686 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -39,6 +39,8 @@
class Visitable:
"""Ab
The pylint similarity checks cannot distinguish parameter lists from
other code; with the QAPISchemaVisitor interface having long lists of
parameters, these similarity checks fire off in a way that's difficult
to disable in a targeted way without littering the code with pylint
pragmas.
There is a
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 519 -
1 file changed, 361 insertions(+), 158 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
based-on: <2020093525.4085762-1-js...@redhat.com>
[PATCH 00/26] qapi: static typing conversion, pt5
Hi, this series adds static type hints to the QAPI module.
This is the final part, part six!
Part 6 (Everything):
https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6
- R
If they don't use self and nothing that extends them needs self either,
they can be classmethods.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 61238c0686..2d2
Signed-off-by: John Snow
---
scripts/qapi/pylintrc | 5 -
1 file changed, 5 deletions(-)
diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc
index fb444e93bb..539e5f65a0 100644
--- a/scripts/qapi/pylintrc
+++ b/scripts/qapi/pylintrc
@@ -1,10 +1,5 @@
[MASTER]
-# Add files or directo
I hope you like butter, because here comes the churn!
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 184 +
1 file changed, 95 insertions(+), 89 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 2d23ce04eb..a0e047c735
Python doesn't have anything quite exactly like Traits, Interfaces, or
Mixins; but we can approximate it.
Add a 'Visitable' class that enforces a type signature for the visit()
method; this way, mypy is ensuring that even for otherwise unrelated
classes that do not inherit from a common base, this
This must always be QAPISchemaObjectTypeMember, and we do check and
enforce this -- but because the seen dict is invariant and check methods
need to operate in terms of a more abstract type, we need to tell the
type system to believe us.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 6 ++
It's a big file, but there's really nothing in here that doesn't belong
in here -- and I don't think it's large enough to justify the
one-module-per-class approach.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi/schema.py b/
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 68 +++---
1 file changed, 38 insertions(+), 30 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
in
This is obscure: If we test the type on a local copy instead of the
stored state AFTER the assignment, mypy does not constrain the type of
the copy. If we test on the stored state, it works out fine.
Corrects this warning:
qapi/schema.py:887: error: "QAPISchemaType" has no attribute "element_type
The 'seen' dictionaries are invariant types and require the most
abstracted type to maintain a consistent interface with other
check_clash implementations.
In this case, we happen to know (and require) that they will be object
types, so add a runtime assertion to constrain that type.
Corrects thi
There's nothing inherently wrong with using 'and' in this manner, but
the type returned is more loose than you might expect. Any value can be
false-ish, so mypy assumes that the type of the expression must be the
Union of both types, because a type can always be false-ish.
To tighten the static an
Re-order the check method slightly in order to provide stronger typing
for the arg_type field.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 3aa842be08..c9a62711
Signed-off-by: John Snow
---
scripts/qapi/pylintrc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc
index 88efbf71cb..5091a08f12 100644
--- a/scripts/qapi/pylintrc
+++ b/scripts/qapi/pylintrc
@@ -2,8 +2,7 @@
# Add files or dire
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index c9a62711c2..aaf20f776b 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -792,13 +792,14 @@ def __
ifcond's initialization allows a fairly confusing type, but we want to
assert that after the QAPISchema is built, this always returns a
List[str]. Add an assertion to allow us to say that.
(Note: Technically, I only assert that it's a list -- but type hints
that will be added later will make it cl
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index fa0ddad922..a3403d4017 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -650,7 +650,7 @@ def check
Standard pylint complaint: use more descriptibe variable names. OK,
fine.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 28 +++-
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index cdb64ffc22..818f8
We'll actually get a better error message by just letting the dictionary
lookup fail.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index a84d8549a4..b35f741c6f 100644
--- a/scripts/qapi/sche
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 38 ++
1 file changed, 38 insertions(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index d9aae4ddb7..490436b48a 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -61,7 +6
For consistency: replace @staticmethod with @classmethod.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index a3403d4017..f5f40ffa16 100644
--- a/scripts/qapi/parser.py
+
On Tue, Sep 22, 2020 at 05:00:36PM -0400, John Snow wrote:
> Annotations do not change runtime behavior.
> This commit *only* adds annotations.
>
> Signed-off-by: John Snow
> ---
> scripts/qapi/common.py | 27 ---
> 1 file changed, 16 insertions(+), 11 deletions(-)
>
> d
Re-order check slightly so we can provide a stronger guarantee on the
typing of the base field.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index a53631e660..3aa
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 818f8bc580..e3481b02f2 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -412,6 +412,8 @@ class QAPIDoc:
"""
This is an immutable, named, typed tuple; it's nicer than arbitrary
dicts for passing data around when using strict typing.
Turn parser.exprs into a list of ParsedExpressions instead, and adjust
expr.py to match.
Signed-off-by: John Snow
---
scripts/qapi/expr.py | 56 +++--
It's usually nicer to keep static methods as class methods -- this
allows them to call other class methods, to be subclassed and extended,
etc.
Meanwhile, any method that doesn't utilize `self` can be a class method.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 10 ++
1 file ch
Signed-off-by: John Snow
---
scripts/qapi/mypy.ini | 5 -
1 file changed, 5 deletions(-)
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini
index 4d341c6b2d..20ab509946 100644
--- a/scripts/qapi/mypy.ini
+++ b/scripts/qapi/mypy.ini
@@ -4,11 +4,6 @@ strict_optional = False
disallow_u
Since values can also be other data types, add an assertion to ensure
we're dealing with strings.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 1bc33e85ea..756c904257 100644
--- a/sc
Instead of pass (an implicit return none), use raise NotImplementedError
to mark a function as abstract -- one that doesn't return. This allows
us to correctly type the stub.
Signed-off-by: John Snow
---
scripts/qapi/schema.py | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff -
Signed-off-by: John Snow
---
scripts/qapi/pragma.py | 25 +
scripts/qapi/source.py | 15 ++-
2 files changed, 27 insertions(+), 13 deletions(-)
create mode 100644 scripts/qapi/pragma.py
diff --git a/scripts/qapi/pragma.py b/scripts/qapi/pragma.py
new file mod
Instead of passing previously_included and info separately, we can pass
the parent parser itself. This cuts down on the number of parameters to
pass when creating a parser; and makes it easier to add new shared data
members between parent and child.
Signed-off-by: John Snow
---
scripts/qapi/pars
get_expr can return many things, depending on where it is used. In the
outer parsing loop, we expect and require it to return an object.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
inde
This kind of type checking at runtime is not something mypy can
introspect, so add a do-nothing cast to help mypy out.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
ind
Annotations do not change runtime behavior.
This commit *only* adds annotations.
Annotations for QAPIDoc are in a later commit.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 69 ++
1 file changed, 49 insertions(+), 20 deletions(-)
diff --git a/sc
parser.py is a JSON parser at heart and shouldn't necessarily understand
what it is parsing on a semantic level. Move pragma parsing to pragma.py,
and leave the parser a little more happily ignorant.
Note: the type annotation in error.py now creates a cyclic import, because
error -> source -> prag
Now that we can have exception contexts that don't specify a specific
line, we can use that context to raise errors when opening the file.
If we don't have a parent context, we can simply use our own.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 12 +++-
1 file changed, 7 inser
The type checker can't constrain the token value to string in this case,
because it's only loosely correlated with the return token, which is
"stringly typed".
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/qapi/parser.py b/scripts
For the sake of keeping __init__ easier to reason about, with fewer
variables in play.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 30 ++
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 8b
It doesn't need to take quite so many arguments.
Signed-off-by: John Snow
---
scripts/qapi/parser.py | 21 -
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 5b3a9b5da8..77067b2f5d 100644
--- a/scripts/qapi/p
Based on the docs, we don't support the null constant, and the code
agrees. There's a few remnants where callers check .tok for 'n', and
these can be removed.
Signed-off-by: John Snow
---
scripts/qapi/parser.py| 8
tests/qapi-schema/leading-comma-list.err | 2 +-
te
1 - 100 of 527 matches
Mail list logo