Re: [PATCH 1/3] Acceptance tests: bump pycdlib version for easier installation

2020-10-10 Thread Philippe Mathieu-Daudé
On 10/9/20 10:55 PM, Cleber Rosa wrote: On with certain versions of "pip", package installations will attempt to create wheels. And, on environments without a "complete" Python installation (as described in the acceptance tests requirements docs), that will fail. pycdlib, starting with version

Re: [PATCH v2] tests/acceptance: Test case for detecting -object crashes

2020-10-10 Thread Philippe Mathieu-Daudé
On 10/9/20 10:29 PM, Eduardo Habkost wrote: Add a simple test case that will run QEMU directly (without QMP) just to check for crashes when using `-object`. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * "Running command:" log message instead of "Command:" (Cleber) * Use universal_newli

[PULL 01/39] meson.build: Add comments to clarify code organization

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-2-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- meson.build | 8 1 file changed, 8 insertions(+) diff --git a/meson.build b/meson.build index 17c89c87c6..68eaf8ce2f 100644 ---

[PULL 04/39] chardev: Move the creation of the library to the main meson.build

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-5-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- chardev/meson.build | 6 -- meso

[PULL 00/39] SCSI, qdev, qtest, meson patches for 2020-10-10

2020-10-10 Thread Paolo Bonzini
The following changes since commit 4a7c0bd9dcb08798c6f82e55b5a3423f7ee669f1: Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.2-20201009' into staging (2020-10-09 15:48:04 +0100) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for y

[PULL 09/39] qom: Move the creation of the library to the main meson.build

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-10-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- meson.build | 8 qom/m

[PULL 05/39] migration: Move the creation of the library to the main meson.build

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-6-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- meson.build | 7 +++ m

[PULL 02/39] meson.build: Sort sourcesets alphabetically

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-3-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- meson.build | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index 68eaf8

[PULL 16/39] docs/devel/qtest: Include protocol spec in document

2020-10-10 Thread Paolo Bonzini
From: Eduardo Habkost Include the QTest Protocol doc string in docs/devel/qtest.rst, after converting it to use Sphinx syntax. Signed-off-by: Eduardo Habkost Acked-by: Thomas Huth Message-Id: <20201005205228.697463-3-ehabk...@redhat.com> Signed-off-by: Paolo Bonzini --- docs/devel/qtest.rst

[PULL 19/39] docs/devel: update instruction on how to add new unit tests

2020-10-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- docs/devel/qtest.rst | 30 +- docs/devel/testing.rst | 19 ++- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/docs/devel/qtest.rst b/docs/devel/qtest.rst index 075fe5f7d5..97c5a75626 100644 --- a/docs

[PULL 18/39] qtest: unify extra_qtest_srcs and extra_qtest_deps

2020-10-10 Thread Paolo Bonzini
Currently the extra sources and extra dependencies of qtests are held in two separate dictionaries. Use the same trick as tests/meson.build to combine them into one. This will make it easier to update the documentation for unit tests and qtests. Signed-off-by: Paolo Bonzini --- tests/qtest/mes

[PULL 03/39] hw/core: Move the creation of the library to the main meson.build

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-4-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/meson.build | 6 -- meso

[PULL 15/39] docs: Move QTest documentation to its own document

2020-10-10 Thread Paolo Bonzini
From: Eduardo Habkost 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 Acked-by: Thomas Huth Message-Id: <20201005205228.

[PULL 23/39] qtest: Reintroduce qtest_qmp_receive

2020-10-10 Thread Paolo Bonzini
From: Maxim Levitsky The new qtest_qmp_receive buffers all the received qmp events, allowing qtest_qmp_eventwait_ref to return them. This is intended to solve the race in regard to ordering of qmp events vs qmp responses, as soon as the callers start using the new interface. In addition to that

[PULL 06/39] io: Move the creation of the library to the main meson.build

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-7-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- io/meson.build | 10 -- meso

[PULL 11/39] softmmu: move more files to softmmu/

2020-10-10 Thread Paolo Bonzini
Keep most softmmu_ss files into the system-emulation-specific directory. Signed-off-by: Paolo Bonzini --- MAINTAINERS | 9 + meson.build | 10 -- bootdevice.c => softmmu/bootdevice.c | 0 device_tree.c => softmmu/dev

[PULL 29/39] qdev: add "check if address free" callback for buses

2020-10-10 Thread 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 Message-Id: <20201006123904.610658-5-mlevi...@redha

[PULL 14/39] configure: fix performance regression due to PIC objects

2020-10-10 Thread Paolo Bonzini
Because most files in QEMU are grouped into static libraries, Meson conservatively compiles them with -fPIC. This is overkill and produces slowdowns up to 20% on some TCG tests. As a stopgap measure, use the b_staticpic option to limit the slowdown to --enable-pie. https://github.com/mesonbuild

[PULL 07/39] crypto: Move the creation of the library to the main meson.build

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-8-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- crypto/meson.build | 10 --

[PULL 20/39] build-sys: fix git version from -version

2020-10-10 Thread Paolo Bonzini
From: Marc-André Lureau Typo introduced with the script. Fixes: 2c273f32d3 ("meson: generate qemu-version.h") Signed-off-by: Marc-André Lureau Reported-by: Laszlo Ersek Reviewed-by: Eric Blake Tested-by: Laszlo Ersek Message-Id: <20200929143654.518157-1-marcandre.lur...@redhat.com> Signed-of

[PULL 13/39] qom: fix objects with improper parent type

2020-10-10 Thread Paolo Bonzini
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 base type. Signed-off-by: Sergey Nizovtsev Signed-off-by: Paolo Bo

[PULL 39/39] meson: identify more sections of meson.build

2020-10-10 Thread Paolo Bonzini
Add more headers that clarify code organization. Signed-off-by: Paolo Bonzini --- meson.build | 36 +--- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index 0c676af194..652c37cceb 100644 --- a/meson.build +++ b/meson.bui

[PULL 17/39] docs/devel/qtest: Include libqtest API reference

2020-10-10 Thread Paolo Bonzini
From: Eduardo Habkost Signed-off-by: Eduardo Habkost Acked-by: Thomas Huth Message-Id: <20201005205228.697463-4-ehabk...@redhat.com> Signed-off-by: Paolo Bonzini --- docs/devel/qtest.rst | 6 ++ tests/qtest/libqos/libqtest.h | 20 ++-- 2 files changed, 16 inserti

[PULL 10/39] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE

2020-10-10 Thread Paolo Bonzini
From: 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 err

Re: [PATCH v10 6/7] test: new qTest case to test the vhost-user-blk-server

2020-10-10 Thread Coiby Xu
On Wed, Sep 23, 2020 at 01:36:06PM +0100, Stefan Hajnoczi wrote: On Fri, Sep 18, 2020 at 04:09:11PM +0800, Coiby Xu wrote: +int qtest_socket_client(char *server_socket_path) +{ +struct sockaddr_un serv_addr; +int sock; +int ret; +int retries = 0; +sock = socket(PF_UNIX, SOCK_

[PULL 26/39] qtest: switch users back to qtest_qmp_receive

2020-10-10 Thread Paolo Bonzini
From: Maxim Levitsky Let test use the new functionality for buffering events. 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 Message-Id: <20201006123904.610658-4-mlevi...@redhat.com> Signed-

[PULL 12/39] exec: split out non-softmmu-specific parts

2020-10-10 Thread Paolo Bonzini
Over the years, most parts of exec.c that were not specific to softmmu have been moved to accel/tcg; what's left is mostly the low-level part of the memory API, which includes RAMBlock and AddressSpaceDispatch. However exec.c also hosts 4-500 lines of code for the target specific parts of the CPU Q

[PATCH V2 0/5] Support RISC-V migration

2020-10-10 Thread Yifei Jiang
This patches supported RISC-V migration based on tcg accel. And we have verified related migration features such as snapshot and live migration. A few weeks ago, we submitted RFC patches about supporting RISC-V migration based on kvm accel: https://www.spinics.net/lists/kvm/msg223605.html. And we

[PULL 30/39] scsi/scsi_bus: switch search direction in scsi_device_find

2020-10-10 Thread Paolo Bonzini
From: 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/s

[PULL 08/39] authz: Move the creation of the library to the main meson.build

2020-10-10 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20201006125602.2311423-9-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- authz/meson.build | 10 -- m

[PULL 22/39] qtest: rename qtest_qmp_receive to qtest_qmp_receive_dict

2020-10-10 Thread Paolo Bonzini
From: 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 Signed-off-by: Paolo Bo

[PATCH V2 1/5] target/riscv: Add basic vmstate description of CPU

2020-10-10 Thread Yifei Jiang
Add basic CPU state description to the newly created machine.c Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- target/riscv/cpu.c | 7 target/riscv/cpu.h | 4 +++ target/riscv/machine.c | 77 target/riscv/meson.build | 3 +-

[PULL 34/39] device-core: use atomic_set on .realized property

2020-10-10 Thread Paolo Bonzini
From: 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. U

[PULL 21/39] meson.build: Re-enable KVM support for MIPS

2020-10-10 Thread Paolo Bonzini
From: Huacai Chen After converting from configure to meson, KVM support is lost for MIPS, so re-enable it in meson.build. Fixes: fdb75aeff7c212e1afaaa3a43 ("configure: remove target configuration") Fixes: 8a19980e3fc42239aae054bc9 ("configure: move accelerator logic to meson") Cc: aolo Bonzini

[PULL 25/39] device-plug-test: use qtest_qmp to send the device_del command

2020-10-10 Thread Paolo Bonzini
Simplify the code now that events are buffered. There is no need anymore to separate sending the command and retrieving the response. Signed-off-by: Paolo Bonzini --- tests/qtest/device-plug-test.c | 32 +--- 1 file changed, 9 insertions(+), 23 deletions(-) diff --g

[PULL 36/39] scsi/scsi_bus: Add scsi_device_get

2020-10-10 Thread Paolo Bonzini
From: 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 Message-Id: <20201006123904.610658-12-mlevi...@re

[PULL 28/39] qemu-iotests, qtest: rewrite test 067 as a qtest

2020-10-10 Thread Paolo Bonzini
Test 067 from qemu-iotests is executing QMP commands to hotplug and hot-unplug disks, devices and blockdevs. Because the power of the text-based test harness is limited, it is actually limiting the checks that it does, for example by skipping DEVICE_DELETED events. tests/qtest already has a simil

[PATCH V2 5/5] target/riscv: Add sifive_plic vmstate

2020-10-10 Thread Yifei Jiang
Add sifive_plic vmstate for supporting sifive_plic migration. Current vmstate framework only supports one structure parameter as num field to describe variable length arrays, so introduce num_enables. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- hw/intc/sifive_plic.c | 26 ++

[PULL 32/39] device-core: use RCU for list of children of a bus

2020-10-10 Thread Paolo Bonzini
From: 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 w

[PULL 27/39] qtest: check that drives are really appearing and disappearing

2020-10-10 Thread Paolo Bonzini
Do not just trust the HMP commands to create and delete the drive, use query-block to check that this is actually the case. Reviewed-by: Kevin Wolf Signed-off-by: Paolo Bonzini --- tests/qtest/drive_del-test.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-

[PULL 38/39] scsi/scsi_bus: fix races in REPORT LUNS

2020-10-10 Thread Paolo Bonzini
From: 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

[PULL 35/39] scsi/scsi-bus: scsi_device_find: don't return unrealized devices

2020-10-10 Thread 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 Bonzini Signed-off-by:

[PULL 24/39] qtest: remove qtest_qmp_receive_success

2020-10-10 Thread Paolo Bonzini
From: Maxim Levitsky The purpose of qtest_qmp_receive_success was mostly to process events that arrived between the issueing of a command and the "return" line from QMP. This is now handled by the buffering of events that libqtest performs automatically. Signed-off-by: Paolo Bonzini Signed-off

[PATCH V2 4/5] target/riscv: Add V extension state description

2020-10-10 Thread Yifei Jiang
In the case of supporting V extension, add V extension description to vmstate_riscv_cpu. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin Reviewed-by: Richard Henderson --- target/riscv/machine.c | 25 + 1 file changed, 25 insertions(+) diff --git a/target/riscv/ma

Re: [PATCH V13 1/9] linux-headers: Update MIPS KVM type defintition

2020-10-10 Thread Philippe Mathieu-Daudé
On 10/7/20 10:39 AM, Huacai Chen wrote: Update MIPS KVM type defintition from Linux 5.9-rc6. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Huacai Chen --- linux-headers/linux/kvm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-headers/linux/kvm.h b/

[PATCH V2 2/5] target/riscv: Add PMP state description

2020-10-10 Thread Yifei Jiang
In the case of supporting PMP feature, add PMP state description to vmstate_riscv_cpu. 'vmstate_pmp_addr' and 'num_rules' could be regenerated by pmp_update_rule(). But there exists the problem of updating num_rules repeatedly in pmp_update_rule(). So here extracts pmp_update_rule_addr() and pmp_u

[PULL 33/39] scsi: switch to bus->check_address

2020-10-10 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini Message-Id: <20201006123904.610658-6-mlevi...@redhat.com> 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

[PATCH] docs/devel/testing.rst: Update outdated Avocado URLs

2020-10-10 Thread Philippe Mathieu-Daudé
Avocado documentation referred returns 404 error. Update the broken links. Signed-off-by: Philippe Mathieu-Daudé --- docs/devel/testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index bd64c1bdcdd..23a1697d9f4 10064

[PULL 31/39] device_core: use drain_call_rcu in in qmp_device_add

2020-10-10 Thread Paolo Bonzini
From: 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-

[PULL 37/39] virtio-scsi: use scsi_device_get

2020-10-10 Thread Paolo Bonzini
From: 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: <2020

[PATCH V2 3/5] target/riscv: Add H extension state description

2020-10-10 Thread Yifei Jiang
In the case of supporting H extension, add H extension description to vmstate_riscv_cpu. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- target/riscv/machine.c | 51 ++ 1 file changed, 51 insertions(+) diff --git a/target/riscv/machine.c b/targe

Re: [PULL 00/39] SCSI, qdev, qtest, meson patches for 2020-10-10

2020-10-10 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20201010075739.951385-1-pbonz...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20201010075739.951385-1-pbonz...@redhat.com Subject: [PULL 00/39] SCSI, qdev, qtest, mes

Re: [PATCH v10 0/7] vhost-user block device backend implementation

2020-10-10 Thread Coiby Xu
On Fri, Oct 09, 2020 at 11:18:43AM +0100, Stefan Hajnoczi wrote: On Fri, Sep 18, 2020 at 04:09:05PM +0800, Coiby Xu wrote: v10 - Use a linked list of VuFdWatch objects to keep kick info [Stefan] - Merge improvements and fixes from Stefan - Rename libvhost-user's vu_message_read to vu_message_

Re: [PATCH V13 8/9] hw/mips: Add Loongson-3 machine support

2020-10-10 Thread Philippe Mathieu-Daudé
Hi Huacai, On 10/7/20 10:39 AM, Huacai Chen wrote: Add Loongson-3 based machine support, it use liointc as the interrupt controler and use GPEX as the pci controller. Currently it can work with both TCG and KVM. As the machine model is not based on any exiting physical hardware, the name of the

Re: [PATCH 2/3] Acceptance tests: do not show canceled test logs on GitLab CI

2020-10-10 Thread Philippe Mathieu-Daudé
On 10/9/20 10:55 PM, Cleber Rosa wrote: Tests resulting in "CANCEL" in Avocado are usually canceled on purpose, and are almost identical to "SKIP". The logs for canceled tests are adding a lot of noise to the logs being shown on GitLab CI, and causing distraction from real failures. Thanks, bi

Re: [PATCH 3/3] Acceptance tests: show test report on GitLab CI

2020-10-10 Thread Philippe Mathieu-Daudé
On 10/9/20 10:55 PM, Cleber Rosa wrote: Avocado will, by default, produce JUnit files. Let's ask GitLab to present those in the web UI. https://gitlab.com/philmd/qemu/-/pipelines/200764992/test_report Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Cl

Re: [PATCH v6 00/36] qapi: static typing conversion, pt1

2020-10-10 Thread Markus Armbruster
John Snow writes: > 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

[PULL 01/34] docs: repair broken references

2020-10-10 Thread Markus Armbruster
From: John Snow In two different places, we are not making a cross-reference to some resource correctly. Signed-off-by: John Snow Message-Id: <20201009161558.107041-2-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- docs/devel/multi-thread-tcg.rst | 2 +-

[PULL 11/34] qapi/common.py: Add indent manager

2020-10-10 Thread Markus Armbruster
From: John Snow 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-o

[PULL 03/34] qapi-gen: Separate arg-parsing from generation

2020-10-10 Thread Markus Armbruster
From: John Snow 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 Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Message-Id: <20201009161558.107041-4-js...@redhat.co

[PULL 13/34] qapi/common.py: Replace one-letter 'c' variable

2020-10-10 Thread Markus Armbruster
From: John Snow Signed-off-by: John Snow Reviewed-by: Cleber Rosa Reviewed-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20201009161558.107041-14-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/common.py | 8

[PULL 00/34] QAPI patches patches for 2020-10-10

2020-10-10 Thread Markus Armbruster
The following changes since commit 4a7c0bd9dcb08798c6f82e55b5a3423f7ee669f1: Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.2-20201009' into staging (2020-10-09 15:48:04 +0100) are available in the Git repository at: git://repo.or.cz/qemu/armbru.git tags/pull-qapi-2020-10-10

[PULL 06/34] qapi: Remove wildcard includes

2020-10-10 Thread Markus Armbruster
From: John Snow 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

[PULL 10/34] qapi/common.py: Remove python compatibility workaround

2020-10-10 Thread Markus Armbruster
From: John Snow Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id: <20201009161558.107041-11-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/common.py | 5 + 1 file changed, 1 insertion(+), 4 dele

[PULL 04/34] qapi: move generator entrypoint into package

2020-10-10 Thread Markus Armbruster
From: John Snow 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 package. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-b

[PULL 07/34] qapi: enforce import order/styling with isort

2020-10-10 Thread Markus Armbruster
From: John Snow While we're mucking around with imports, we might as well formalize the style we use. Let's use isort to do it for us. lines_after_imports=2: Use two lines after imports, to match PEP8's desire to have "two lines before and after" class definitions, which are likely to start imme

[PULL 12/34] qapi/common.py: delint with pylint

2020-10-10 Thread Markus Armbruster
From: John Snow 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

[PULL 05/34] qapi: Prefer explicit relative imports

2020-10-10 Thread Markus Armbruster
From: John Snow 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 th

[PULL 14/34] qapi/common.py: check with pylint

2020-10-10 Thread Markus Armbruster
From: John Snow 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 Message-Id: <20201009161558.107041-15-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster -

[PULL 21/34] qapi/commands.py: Don't re-bind to variable of different type

2020-10-10 Thread Markus Armbruster
From: John Snow 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 Reviewed-by: Markus Armbruster Message-Id: <20201009161558.107041-22-js...@redhat.com> Signed-off-by: Marku

[PULL 08/34] qapi: delint using flake8

2020-10-10 Thread Markus Armbruster
From: John Snow 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-awa

[PULL 18/34] qapi: establish mypy type-checking baseline

2020-10-10 Thread Markus Armbruster
From: John Snow Fix a minor typing issue, 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 Habk

[PULL 15/34] qapi/common.py: add type hint annotations

2020-10-10 Thread Markus Armbruster
From: John Snow Annotations do not change runtime behavior. This commit *only* adds annotations. Note that build_params() cannot be fully annotated due to import dependency issues. The commit after next will take care of it. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by:

[PULL 27/34] qapi/gen.py: Remove unused parameter

2020-10-10 Thread Markus Armbruster
From: John Snow _module_dirname doesn't use the 'what' argument, so remove it. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id: <20201009161558.107041-30-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/

[PULL 17/34] qapi/common.py: move build_params into gen.py

2020-10-10 Thread Markus Armbruster
From: John Snow 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

[PULL 23/34] qapi/source.py: add type hint annotations

2020-10-10 Thread Markus Armbruster
From: John Snow 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

[PULL 20/34] qapi/events.py: Move comments into docstrings

2020-10-10 Thread Markus Armbruster
From: John Snow Clarify them while we're here. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id: <20201009161558.107041-21-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/events.py | 6 +- 1 fil

[PULL 29/34] qapi/gen.py: delint with pylint

2020-10-10 Thread Markus Armbruster
From: John Snow '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-

[PULL 02/34] qapi: modify docstrings to be sphinx-compatible

2020-10-10 Thread Markus Armbruster
From: John Snow A precise style guide and a package-wide overhaul is forthcoming pending further discussion and consensus. For now, merely avoid obvious errors that cause Sphinx documentation build problems, using a style loosely based on PEP 257 and Sphinx Autodoc. It is chosen for interoperabil

[PULL 16/34] qapi/common.py: Convert comments into docstrings, and elaborate

2020-10-10 Thread Markus Armbruster
From: John Snow 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 fi

[PULL 24/34] qapi/source.py: delint with pylint

2020-10-10 Thread Markus Armbruster
From: John Snow 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 Message-Id: <20201009161558.107041-26-js...@redhat.com> Reviewed-by: Markus Armbrus

[PULL 34/34] qapi/visit.py: add type hint annotations

2020-10-10 Thread Markus Armbruster
From: 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 Tested-by: Cleber Rosa Message-Id: <20201009161558.107041-37-js...@redhat.com> Reviewed-by: Markus Armbruster Signe

[PULL 25/34] qapi/gen: Make _is_user_module() return bool

2020-10-10 Thread Markus Armbruster
From: John Snow _is_user_module() returns thruth values. The next commit wants it to return bool. Make it so. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Reviewed-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20201009161558.107041-27-js...@redhat.com> Reviewed-

[PULL 26/34] qapi/gen.py: add type hint annotations

2020-10-10 Thread Markus Armbruster
From: 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 Message-Id: <20201009161558.107041-28-js...@redhat.com> Message-Id: <20201009161558.107041-29-js...@redhat.com> [mypy

[PULL 09/34] qapi: add pylintrc

2020-10-10 Thread Markus Armbruster
From: John Snow 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.

[PULL 30/34] qapi/types.py: add type hint annotations

2020-10-10 Thread Markus Armbruster
From: 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 Message-Id: <20201009161558.107041-33-js...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbrus

[PULL 22/34] qapi/commands.py: add type hint annotations

2020-10-10 Thread Markus Armbruster
From: 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 Message-Id: <20201009161558.107041-23-js...@redhat.com> Message-Id: <20201009161558.107041-24-js...@redhat.com> [mypy

[PULL 33/34] qapi/visit.py: remove unused parameters from gen_visit_object

2020-10-10 Thread Markus Armbruster
From: John Snow 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 Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20201009161558.107041-36-js..

[PULL 28/34] qapi/gen.py: update write() to be more idiomatic

2020-10-10 Thread Markus Armbruster
From: John Snow 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.

[PULL 32/34] qapi/visit.py: assert tag_member contains a QAPISchemaEnumType

2020-10-10 Thread Markus Armbruster
From: John Snow 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 Message-Id: <20201009161558.107041-35-js...@redhat.com> Reviewe

[PULL 19/34] qapi/events.py: add type hint annotations

2020-10-10 Thread Markus Armbruster
From: John Snow Annotations do not change runtime behavior. This commit *only* adds annotations. Note: __init__ does not need its return type annotated, as it is special. https://mypy.readthedocs.io/en/stable/class_basics.html#annotating-init-methods Signed-off-by: John Snow Reviewed-by: Eduar

[PULL 31/34] qapi/types.py: remove one-letter variables

2020-10-10 Thread Markus Armbruster
From: John Snow "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 Message-Id: <20201009161558.107041-3

Re: [RFC PATCH 2/2] .mailmap: Fix more contributor entries

2020-10-10 Thread Pan Nengyuan
On 2020/10/5 1:26, Philippe Mathieu-Daudé wrote: > These authors have some incorrect author email field. > For each of them, there is one commit with the replaced > entry. > > Cc: Anup Patel > Cc: Andrew Melnychenko > Cc: David Carlier > Cc: Erik Smit > Cc: Marcel Apfelbaum > Cc: Pan Nengyu

Re: [RFC v1 3/4] qtest: do not build ide-test if TCG is not available

2020-10-10 Thread Claudio Fontana
On 10/9/20 6:01 PM, Paolo Bonzini wrote: > On 09/10/20 17:21, Claudio Fontana wrote: >> it seems that ide-test depends on TCG currently. >> >> Signed-off-by: Claudio Fontana >> --- >> tests/qtest/meson.build | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tests/qtest/m

Re: [PATCH] net/filter-rewriter: destroy g_hash_table in colo_rewriter_cleanup

2020-10-10 Thread Pan Nengyuan
ping! Maybe missed to queue? On 2020/9/5 8:44, Li Qiang wrote: > Pan Nengyuan 于2020年9月4日周五 下午3:23写道: >> >> s->connection_track_table forgot to destroy in colo_rewriter_cleanup. Fix it. >> >> Reported-by: Euler Robot >> Signed-off-by: Pan Nengyuan > > Reviewed-by: Li Qiang > >> --- >> net/f

Re: [PATCH] target/i386/cpu: add return value verification and ignore Error objects

2020-10-10 Thread Pan Nengyuan
ping! Maybe missed to queue? On 2020/9/4 21:20, Philippe Mathieu-Daudé wrote: > On 9/4/20 3:45 PM, Pan Nengyuan wrote: >> 'err' is unnecessary in x86_cpu_class_check_missing_features(), we can >> change x86_cpu_expand_features() >> to return true on success, false on failure, then pass NULL here

Re: [PATCH v2 00/10] fix some error memleaks

2020-10-10 Thread Pan Nengyuan
ping! Hello, Some patches have been reviewed a few weeks ago but missed to queue. The rest patches are the following: https://patchwork.kernel.org/patch/11745621/ https://patchwork.kernel.org/patch/11745633/ https://patchwork.kernel.org/patch/11745629/ https://patchwork.kernel.org/patch/11745625

[PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-10 Thread Chen Qun
This if statement judgment is redundant and it will cause a warning: migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used uninitialized in this function [-Wmaybe-uninitialized] g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name)); ^~~~

Re: [PATCH v2 10/15] hw/misc/bcm2835_cprman: add a clock mux skeleton implementation

2020-10-10 Thread Luc Michel
On 10:40 Tue 06 Oct , Philippe Mathieu-Daudé wrote: > On 10/5/20 9:56 PM, Luc Michel wrote: > > 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.

Re: [PATCH v2 10/15] hw/misc/bcm2835_cprman: add a clock mux skeleton implementation

2020-10-10 Thread Luc Michel
On 13:33 Sat 10 Oct , Luc Michel wrote: > On 10:40 Tue 06 Oct , Philippe Mathieu-Daudé wrote: > > On 10/5/20 9:56 PM, Luc Michel wrote: > > > 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 > > > p

  1   2   >