[Qemu-devel] [PATCH] virtio-blk: fix comment for virtio_blk_rw_complete

2018-07-27 Thread Yaowei Bai
Here should be submit_requests, there is no submit_merged_requests function. Signed-off-by: Yaowei Bai --- hw/block/virtio-blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 50b5c86..91cbede 100644 --- a/hw/block/virt

Re: [Qemu-devel] [RFC PATCH] rbd: Don't convert keypairs to JSON and back

2018-07-27 Thread Jeff Cody
On Wed, Jul 25, 2018 at 05:01:44PM +0100, Daniel P. Berrangé wrote: > On Wed, Jul 25, 2018 at 10:56:48AM -0500, Eric Blake wrote: > > On 07/25/2018 10:10 AM, Markus Armbruster wrote: > > > qemu_rbd_parse_filename() builds a keypairs QList, converts it to JSON, > > > and > > > stores the resulting

Re: [Qemu-devel] [RFC PATCH] rbd: Don't convert keypairs to JSON and back

2018-07-27 Thread Jeff Cody
On Wed, Jul 25, 2018 at 10:56:48AM -0500, Eric Blake wrote: > On 07/25/2018 10:10 AM, Markus Armbruster wrote: > >qemu_rbd_parse_filename() builds a keypairs QList, converts it to JSON, and > >stores the resulting QString in a QDict. > > > >qemu_rbd_co_create_opts() and qemu_rbd_open() get the QStr

Re: [Qemu-devel] [PATCH v3] block/gluster: Handle changed glfs_ftruncate signature

2018-07-27 Thread Jeff Cody
On Fri, Jul 27, 2018 at 08:24:05AM -0500, Eric Blake wrote: > On 07/27/2018 03:19 AM, Niels de Vos wrote: > >From: Prasanna Kumar Kalever > > > >New versions of Glusters libgfapi.so have an updated glfs_ftruncate() > >function that returns additional 'struct stat' structures to enable > >advanced

Re: [Qemu-devel] [PATCH v1 1/1] configure: Add RISC-V host support

2018-07-27 Thread Michael Clark
On Sat, Jul 28, 2018 at 11:49 AM, Alistair Francis wrote: > Allow QEMU to be built to run on a RISC-V host. > > QEMU does not yet have a RISC-V TCG or user mode target port, but > running other architectures on RISC-V using TCI does work. > There is this RISC-V TCG backend here: https://github.

Re: [Qemu-devel] RDMA wrongly detected as being supported on FreeBSD

2018-07-27 Thread Rebecca Cran via Qemu-devel
On 7/25/18 5:14 AM, Thomas Huth wrote: > > Note that the error has been reported to happen on FreeBSD - so I doubt > that this header should be here. > > Anyway, our include/standard-headers/linux/types.h is also empty ... so > could you try whether it compiles if you simply remove this #include

Re: [Qemu-devel] [Qemu-arm] [PATCH v3 7/7] Add QTest testcase for the Intel Hexadecimal

2018-07-27 Thread Su Hang
> > +#define BIN_SIZE 146 > > + > > +static unsigned char pre_store[BIN_SIZE] = { > > +4, 208, 159, 229, 22, 0, 0, 235, 254, 255, 255, 234, 152, 16, > > 1, > > +0, 4, 176, 45, 229, 0, 176, 141, 226, 12, 208, 77, 226, 8, > > 0, > > +11, 229, 6, 0, 0, 234, 8,

[Qemu-devel] [PATCH v1 1/1] configure: Add RISC-V host support

2018-07-27 Thread Alistair Francis
Allow QEMU to be built to run on a RISC-V host. QEMU does not yet have a RISC-V TCG or user mode target port, but running other architectures on RISC-V using TCI does work. Signed-off-by: Alistair Francis --- configure | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) di

Re: [Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size

2018-07-27 Thread Eduardo Habkost
On Fri, Jul 27, 2018 at 04:50:31PM +0200, Igor Mammedov wrote: [...] > NOTE TO MAINTAINER: UPDATE REFERRENCE APCI TABLE BLOBS IN TESTS Why this needs to be done manually? Can't the ACPI table update be included in the e-mailed patch? -- Eduardo

Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master

2018-07-27 Thread Alex Williamson
On Fri, 27 Jul 2018 09:58:05 +0800 Tiwei Bie wrote: > On Thu, Jul 26, 2018 at 02:45:39PM -0600, Alex Williamson wrote: > > On Mon, 23 Jul 2018 12:59:56 +0800 > > Tiwei Bie wrote: > > > [...] > > > > > > +static int vhost_user_slave_handle_vfio_group(struct vhost_dev *dev, > > > +

Re: [Qemu-devel] [PATCH v2 22/23] libqtest: Replace qtest_startf() by qtest_initf()

2018-07-27 Thread Eric Blake
On 07/27/2018 12:18 PM, Thomas Huth wrote: On 07/27/2018 05:13 PM, Markus Armbruster wrote: qtest_init() creates a new QTestState, and leaves @global_qtest alone. qtest_start() additionally assigns it to @global_qtest, but qtest_startf() additionall sets assigns NULL to @global_qtest. This make

Re: [Qemu-devel] [PATCH V10 08/20] ram/COLO: Record the dirty pages that SVM received

2018-07-27 Thread Dr. David Alan Gilbert
* Zhang Chen (zhangc...@gmail.com) wrote: > We record the address of the dirty pages that received, > it will help flushing pages that cached into SVM. > > Here, it is a trick, we record dirty pages by re-using migration > dirty bitmap. In the later patch, we will start the dirty log > for SVM, ju

Re: [Qemu-devel] [PATCH v1 for 3.0 0/2] fix for bug 1783362

2018-07-27 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180726132947.28538-1-alex.ben...@linaro.org Subject: [Qemu-devel] [PATCH v1 for 3.0 0/2] fix for bug 1783362 === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(gi

Re: [Qemu-devel] [PATCH v2 23/23] libqtest: Rename qtest_FOOv() to qtest_vFOO() for consistency

2018-07-27 Thread Thomas Huth
On 07/27/2018 05:13 PM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > tests/libqtest.c | 12 ++-- > tests/libqtest.h | 4 ++-- > 2 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/tests/libqtest.c b/tests/libqtest.c > index a0d44793fa..3706f30aa2 100

Re: [Qemu-devel] [PULL 0/3] QObject patches for 2018-07-27 (3.0.0-rc3)

2018-07-27 Thread Peter Maydell
On 27 July 2018 at 16:55, Markus Armbruster wrote: > The following changes since commit 18a398f6a39df4b08ff86ac0d38384193ca5f4cc: > > Update version for v3.0.0-rc2 release (2018-07-24 22:06:31 +0100) > > are available in the Git repository at: > > git://repo.or.cz/qemu/armbru.git tags/pull-qob

Re: [Qemu-devel] [PATCH v2 22/23] libqtest: Replace qtest_startf() by qtest_initf()

2018-07-27 Thread Thomas Huth
On 07/27/2018 05:13 PM, Markus Armbruster wrote: > qtest_init() creates a new QTestState, and leaves @global_qtest alone. > qtest_start() additionally assigns it to @global_qtest, but > qtest_startf() additionall sets assigns NULL to @global_qtest. This > makes no sense. Replace it by qtest_initf

Re: [Qemu-devel] [RFC PATCH 4/6] cadence_uart: add clock/power gating support

2018-07-27 Thread Philippe Mathieu-Daudé
On 07/27/2018 11:37 AM, Damien Hedde wrote: > Only discard input characters when unpowered/unclocked. > As it is a sysbus device, mmio are already disabled when unpowered > or unclocked. This is common to all Chardev frontends (also Ethernet/CAN devices, see NetClientInfo). Maybe qemu_chr_fe_acce

Re: [Qemu-devel] [PATCH v2 23/23] libqtest: Rename qtest_FOOv() to qtest_vFOO() for consistency

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Signed-off-by: Markus Armbruster Might be worth adding mention of WHAT it is consistent with (as Thomas pointed out on 2/23, we still have inconsistencies with object_new_with_propv and such) --- tests/libqtest.c | 12 ++-- tests

Re: [Qemu-devel] [PATCH v2 22/23] libqtest: Replace qtest_startf() by qtest_initf()

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: qtest_init() creates a new QTestState, and leaves @global_qtest alone. qtest_start() additionally assigns it to @global_qtest, but qtest_startf() additionall sets assigns NULL to @global_qtest. This s/additionall sets/additionally/ makes no se

Re: [Qemu-devel] [PATCH v2 02/23] libqtest: Rename functions to send QMP messages

2018-07-27 Thread Eric Blake
On 07/27/2018 11:35 AM, Thomas Huth wrote: On 07/27/2018 05:13 PM, Markus Armbruster wrote: [...] Rename qmp_fd_sendv() to qmp_fd_vsend(). Why? I think it's also quite common to have the "v" at the end, e.g. object_new_with_propv, gdb_do_syscallv, qobject_from_jsonv, etc. Actually, I think '

Re: [Qemu-devel] [PATCH v2 21/23] libqtest: Remove qtest_qmp_discard_response() & friends

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: qtest_qmp_discard_response(...) is shorthand for qobject_unref(qtest_qmp(...), except it's not actually shorter. Moreover, the presence of these functions encourage sloppy testing. Remove them. Signed-off-by: Markus Armbruster --- Reviewed-by:

Re: [Qemu-devel] [PATCH v2 21/23] libqtest: Remove qtest_qmp_discard_response() & friends

2018-07-27 Thread Eric Blake
On 07/27/2018 11:46 AM, Thomas Huth wrote: On 07/27/2018 05:13 PM, Markus Armbruster wrote: qtest_qmp_discard_response(...) is shorthand for qobject_unref(qtest_qmp(...), except it's not actually shorter. But the latter is IMHO harder to read. Maybe, but then it lends itself well to: QObjec

Re: [Qemu-devel] [PATCH v2 21/23] libqtest: Remove qtest_qmp_discard_response() & friends

2018-07-27 Thread Thomas Huth
On 07/27/2018 05:13 PM, Markus Armbruster wrote: > qtest_qmp_discard_response(...) is shorthand for > qobject_unref(qtest_qmp(...), except it's not actually shorter. But the latter is IMHO harder to read. And it might be shorter in the compiled binary (one function call vs. two). > Moreover, the

Re: [Qemu-devel] [PATCH v5 23/24] replay: add BH oneshot event for block layer

2018-07-27 Thread Alex Bennée
Pavel Dovgalyuk writes: >> From: Alex Bennée [mailto:alex.ben...@linaro.org] >> > Replay is capable of recording normal BH events, but sometimes >> > there are single use callbacks scheduled with aio_bh_schedule_oneshot >> > function. This patch enables recording and replaying such callbacks. >

Re: [Qemu-devel] [RFC PATCH 3/6] sysbus: Specialize gating_update to enable/disable memory regions

2018-07-27 Thread Philippe Mathieu-Daudé
On 07/27/2018 11:37 AM, Damien Hedde wrote: > The default methods are overriden to add the activation/deactivation > of the memory regions according to the gating state: Regions are > enabled only when powered and clocked. > As powering-up triggers a reset call, memory regions should > be reset in

Re: [Qemu-devel] [Qemu-arm] [RFC PATCH 2/6] qdev: add power/clock gating control on bus tree

2018-07-27 Thread Philippe Mathieu-Daudé
Hi Damien, On 07/27/2018 11:37 AM, Damien Hedde wrote: > Add functions [qdev|qbus]_set_[power|clock]_all(_fn). > Theses allow to control power and clock gating along a bus hierarchy. > > Signed-off-by: Damien Hedde > --- > include/hw/qdev-core.h | 20 + > hw/core/qdev.c

Re: [Qemu-devel] [PATCH v2 02/23] libqtest: Rename functions to send QMP messages

2018-07-27 Thread Thomas Huth
On 07/27/2018 05:13 PM, Markus Armbruster wrote: > [...] Rename qmp_fd_sendv() to qmp_fd_vsend(). Why? I think it's also quite common to have the "v" at the end, e.g. object_new_with_propv, gdb_do_syscallv, qobject_from_jsonv, etc. Thomas

Re: [Qemu-devel] [PATCH v2 0/6] Avocado: start multi-arch tests, add a Travis job

2018-07-27 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Hi Alex, > > On 06/28/2018 01:01 PM, Alex Bennée wrote: >> Philippe Mathieu-Daudé writes: >>> >>> Another neanderthal approach to add multi-arch acceptance tests using >>> Avocado. >>> >>> Since Cleber Rosa work got merged [0], I can restart my previous attempt

Re: [Qemu-devel] [PATCH v2 16/23] migration-test: Make wait_command() cope with '%'

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: wait_command() passes its argument @command to qtest_qmp_send(). Falls apart if @command contain '%'. Two ways to disarm this trap: suppress interpretation of '%' by passing @command as argument to format string "%s", or fix it by having wait_comm

Re: [Qemu-devel] [PATCH v2 19/23] migration-test: Clean up string interpolation into QMP, part 3

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migration-test.c interpolates strings into JSON in a

Re: [Qemu-devel] [PATCH v2 15/23] tests: New helper qtest_qmp_receive_success()

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Commit b21373d0713 copied wait_command() from tests/migration-test.c to tests/tpm-util.c. Replace both copies by new libqtest helper qtest_qmp_receive_success(). Also use it to simplify qtest_qmp_device_del(). Bonus: gets rid of a non-literal fo

Re: [Qemu-devel] [PATCH v2 18/23] migration-test: Clean up string interpolation into QMP, part 2

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migrate() interpolates members into a JSON object. C

Re: [Qemu-devel] [PATCH v2 17/23] migration-test: Clean up string interpolation into QMP, part 1

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migrate_recover() builds QMP input manually because w

Re: [Qemu-devel] [PATCH for-3.0 3/3] qemu-iotests: Test query-blockstats with -drive and -blockdev

2018-07-27 Thread Kevin Wolf
Am 27.07.2018 um 17:12 hat Eric Blake geschrieben: > On 07/27/2018 09:15 AM, Kevin Wolf wrote: > > Make sure that query-blockstats returns information for every > > BlockBackend that is named or attached to a device model (or both). > > Needed for libvirt switching over to -blockdev, so even thoug

Re: [Qemu-devel] [PATCH v2 20/23] libqtest: Enable compile-time format string checking

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: qtest_qmp() & friends pass their format string and variable arguments to qobject_from_vjsonf_nofail(). Unlike qobject_from_jsonv(), they aren't decorated with GCC_FMT_ATTR(). Fix that to get compile-time format string checking. Signed-off-by: Ma

[Qemu-devel] [PULL 2/3] qstring: Assert size calculations don't overflow

2018-07-27 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Message-Id: <20180727062204.10401-2-arm...@redhat.com> Reviewed-by: Eric Blake --- qobject/qstring.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qobject/qstring.c b/qobject/qstring.c index 18b8eb82f8..1bb7784a88 100644 --- a/qobject/q

[Qemu-devel] [PULL 3/3] qstring: Move qstring_from_substr()'s @end one to the right

2018-07-27 Thread Markus Armbruster
qstring_from_substr() takes the index of the substring's first and last character. qstring_from_substr(s, 0, SIZE_MAX) denotes an empty substring. Awkward. Shift the end index one to the right. This simplifies both qstring_from_substr() and its callers. Signed-off-by: Markus Armbruster Review

Re: [Qemu-devel] [PATCH for-3.0 1/3] block/qapi: Add 'qdev' field to query-blockstats result

2018-07-27 Thread Kevin Wolf
Am 27.07.2018 um 17:07 hat Eric Blake geschrieben: > On 07/27/2018 09:15 AM, Kevin Wolf wrote: > > Like for query-block, the client needs to identify which BlockBackend > > the returned data is for. Anonymous BlockBackends are identified by the > > device model they are attached to. Add a 'qdev' fi

[Qemu-devel] [PULL 0/3] QObject patches for 2018-07-27 (3.0.0-rc3)

2018-07-27 Thread Markus Armbruster
The following changes since commit 18a398f6a39df4b08ff86ac0d38384193ca5f4cc: Update version for v3.0.0-rc2 release (2018-07-24 22:06:31 +0100) are available in the Git repository at: git://repo.or.cz/qemu/armbru.git tags/pull-qobject-2018-07-27 for you to fetch changes up to 307fb894ce0608a

[Qemu-devel] [PULL 1/3] qstring: Fix qstring_from_substr() not to provoke int overflow

2018-07-27 Thread Markus Armbruster
From: liujunjie qstring_from_substr() parameters @start and @end are of type int. blkdebug_parse_filename(), blkverify_parse_filename(), nbd_parse_uri(), and qstring_from_str() pass @end values of type size_t or ptrdiff_t. Values exceeding INT_MAX get truncated, with possibly disastrous results.

Re: [Qemu-devel] [PATCH v2 14/23] migration-test: Make wait_command() return the "return" member

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: All callers of wait_command() are only interested in the success response's "return" member. Lift its extraction into wait_command(). Cc: Juan Quintela Cc: Dr. David Alan Gilbert Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela ---

Re: [Qemu-devel] [PATCH v3 23/40] target/mips: Implement emulation of nanoMIPS LLWP/SCWP pair

2018-07-27 Thread Richard Henderson
On 07/27/2018 08:29 AM, Aleksandar Markovic wrote: > static void gen_llwp(DisasContext *ctx, uint32_t base, int16_t offset, > uint32_t reg1, uint32_t reg2) > { > TCGv taddr = tcg_temp_new(); > TCGv_i64 tval = tcg_temp_new_i64(); > TCGv tmp1 = tcg_temp_new(); > T

Re: [Qemu-devel] [PATCH v2 13/23] tests: Clean up string interpolation around qtest_qmp_device_add()

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the commit before previous. qtest_qmp_device_add() and its wrappers interpolate into JSON as follows: * qtest_qmp_device_add() interpolates

Re: [Qemu-devel] [PATCH] macio/pmu: Fix missing vmsd terminator

2018-07-27 Thread Dr. David Alan Gilbert
* Mark Cave-Ayland (mark.cave-ayl...@ilande.co.uk) wrote: > On 27/07/18 14:44, Dr. David Alan Gilbert wrote: > > > * Mark Cave-Ayland (mark.cave-ayl...@ilande.co.uk) wrote: > > > On 27/07/18 13:31, Dr. David Alan Gilbert (git) wrote: > > > > > > > From: "Dr. David Alan Gilbert" > > > > > > > >

Re: [Qemu-devel] [PATCH v2 03/23] libqtest: Clean up how we read device_del messages

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: qtest_qmp_device_del() still uses the qmp("") hack to receive a message, even though we have qmp_receive() since commit 66e0c7b187e. Put it to use. Bonus: gets rid of empty format strings. A step towards compile-time format string checking withou

Re: [Qemu-devel] [PATCH v2 12/23] cpu-plug-test: Don't pass integers as strings to device_add

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: test_plug_with_device_add_x86() plugs Haswell-i386-cpu and Haswell-x86_64-cpu with device_add. It passes socket-id, core-id, thread-id as JSON strings. The properties are actually integers. test_plug_with_device_add_coreid() plugs power8_v2.0-sp

[Qemu-devel] [PATCH v2 04/23] libqtest: Clean up how we read the QMP greeting

2018-07-27 Thread Markus Armbruster
qtest_init() still uses the qtest_qmp_discard_response(s, "") hack to receive the greeting, even though we have qtest_qmp_receive() since commit 66e0c7b187e. Put it to use. Bonus: gets rid of an empty format string. A step towards compile-time format string checking without triggering -Wformat-z

[Qemu-devel] [PATCH v2 14/23] migration-test: Make wait_command() return the "return" member

2018-07-27 Thread Markus Armbruster
All callers of wait_command() are only interested in the success response's "return" member. Lift its extraction into wait_command(). Cc: Juan Quintela Cc: Dr. David Alan Gilbert Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela --- tests/migration-test.c | 38 +++--

Re: [Qemu-devel] [PATCH v2 04/23] libqtest: Clean up how we read the QMP greeting

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: qtest_init() still uses the qtest_qmp_discard_response(s, "") hack to receive the greeting, even though we have qtest_qmp_receive() since commit 66e0c7b187e. Put it to use. Bonus: gets rid of an empty format string. A step towards compile-time f

[Qemu-devel] [PATCH v2 11/23] tests: Clean up string interpolation into QMP input (simple cases)

2018-07-27 Thread Markus Armbruster
When you build QMP input manually like this cmd = g_strdup_printf("{ 'execute': 'migrate'," "'arguments': { 'uri': '%s' } }", uri); rsp = qmp(cmd); g_free(cmd); you're responsible for escaping the interpolated values for JSON. Not d

[Qemu-devel] [PATCH v2 00/23] tests: Compile-time format string checking for libqtest.h

2018-07-27 Thread Markus Armbruster
This is a reboot of "[PATCH 0/9] tests: Clean up around qmp() and hmp()" I sent about a year ago. Back then, Eric folded it into his "Clean up around qmp() and hmp()" series, which stalled after v4. My reboot tries to avoid that fate by reducing mission creep. There are plenty of good ideas in E

Re: [Qemu-devel] [PATCH v2 09/23] qobject: qobject_from_jsonv() is dangerous, hide it away

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: qobject_from_jsonv() takes ownership of %p arguments. On failure, we can't generally know whether we failed before or after %p, so ownership becomes indeterminate. To avoid leaks, callers passing %p must terminate on error, e.g. by passing &error

[Qemu-devel] [PATCH v2 10/23] tests: Pass literal format strings directly to qmp_FOO()

2018-07-27 Thread Markus Armbruster
The qmp_FOO() take a printf-like format string. In a few places, we assign a string literal to a variable and pass that instead of simply passing the literal. Clean that up. Bonus: gets rid of non-literal format strings. A step towards compile-time format string checking without triggering -Wfo

[Qemu-devel] [PATCH v2 22/23] libqtest: Replace qtest_startf() by qtest_initf()

2018-07-27 Thread Markus Armbruster
qtest_init() creates a new QTestState, and leaves @global_qtest alone. qtest_start() additionally assigns it to @global_qtest, but qtest_startf() additionall sets assigns NULL to @global_qtest. This makes no sense. Replace it by qtest_initf() that works like qtest_init(), i.e. leaves @global_qtes

Re: [Qemu-devel] [PATCH v2 02/23] libqtest: Rename functions to send QMP messages

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: The functions to receive messages are called qtest_qmp_receive() and qmp_receive(), qmp_fd_receive(). The ones to send messages are called qtest_async_qmp(), qtest_async_qmpv(), qmp_async(), qmp_fd_send(), qmp_fd_sendv(). Inconsistent. Rename th

Re: [Qemu-devel] [PATCH v2 08/23] test-qobject-input-visitor: Avoid format string ambiguity

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: When visitor_input_test_init_internal()'s argument @ap is null, then @json_string is interpreted literally, else it's gets %-escapes interpolated. This is awkward. One caller always passes null @ap, and the others never do. Lift the building of

[Qemu-devel] [PATCH v2 13/23] tests: Clean up string interpolation around qtest_qmp_device_add()

2018-07-27 Thread Markus Armbruster
Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the commit before previous. qtest_qmp_device_add() and its wrappers interpolate into JSON as follows: * qtest_qmp_device_add() interpolates members into a JSON object. * So do its wrappers q

[Qemu-devel] [PATCH v2 07/23] libqtest: Simplify qmp_fd_vsend() a bit

2018-07-27 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé --- tests/libqtest.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index c2c08a890c..3bfb062fcb 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c

Re: [Qemu-devel] [PATCH v2 06/23] qobject: New qobject_from_vjsonf_nofail(), qdict_from_vjsonf_nofail()

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Every printf()-like function sooner or later needs its vprintf()-like buddy. The next commit will need qobject_from_jsonf_nofail()'s buddy, and qdict_from_jsonf_nofail()'s buddy will be used later in this series. Add both. Signed-off-by: Markus

Re: [Qemu-devel] [PATCH v2 05/23] qobject: Replace qobject_from_jsonf() by qobject_from_jsonf_nofail()

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Commit ab45015a968 "qobject: Let qobject_from_jsonf() fail instead of abort" fails to accomplish its stated aim: the function can still abort due to its use of &error_abort. Its rationale for letting it fail is that all remaining users cope fine w

Re: [Qemu-devel] [PATCH v3 23/40] target/mips: Implement emulation of nanoMIPS LLWP/SCWP pair

2018-07-27 Thread Aleksandar Markovic
Hi, Richard. > From: Richard Henderson > Sent: Saturday, July 21, 2018 8:15 PM > > On 07/19/2018 05:54 AM, Stefan Markovic wrote: > > From: Yongbok Kim > > > > Implement nanoMIPS LLWP and SCWP instruction pair. > > > > Signed-off-by: Yongbok Kim > > Signed-off-by: Aleksandar Markovic > > Sign

[Qemu-devel] [PATCH v2 02/23] libqtest: Rename functions to send QMP messages

2018-07-27 Thread Markus Armbruster
The functions to receive messages are called qtest_qmp_receive() and qmp_receive(), qmp_fd_receive(). The ones to send messages are called qtest_async_qmp(), qtest_async_qmpv(), qmp_async(), qmp_fd_send(), qmp_fd_sendv(). Inconsistent. Rename the *_async* ones to qmp_send(), qtest_qmp_send(), qt

Re: [Qemu-devel] [PATCH v2 10/23] tests: Pass literal format strings directly to qmp_FOO()

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: The qmp_FOO() take a printf-like format string. In a few places, we assign a string literal to a variable and pass that instead of simply passing the literal. Clean that up. Bonus: gets rid of non-literal format strings. A step towards compile-

Re: [Qemu-devel] [PATCH v2 11/23] tests: Clean up string interpolation into QMP input (simple cases)

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: When you build QMP input manually like this cmd = g_strdup_printf("{ 'execute': 'migrate'," "'arguments': { 'uri': '%s' } }", uri); rsp = qmp(cmd); g_free(cmd); you're responsib

Re: [Qemu-devel] [PATCH v2 07/23] libqtest: Simplify qmp_fd_vsend() a bit

2018-07-27 Thread Eric Blake
On 07/27/2018 10:13 AM, Markus Armbruster wrote: Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé --- tests/libqtest.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat

[Qemu-devel] [PATCH v2 18/23] migration-test: Clean up string interpolation into QMP, part 2

2018-07-27 Thread Markus Armbruster
Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migrate() interpolates members into a JSON object. Change it to take its extra QMP arguments as argumen

[Qemu-devel] [PATCH v2 09/23] qobject: qobject_from_jsonv() is dangerous, hide it away

2018-07-27 Thread Markus Armbruster
qobject_from_jsonv() takes ownership of %p arguments. On failure, we can't generally know whether we failed before or after %p, so ownership becomes indeterminate. To avoid leaks, callers passing %p must terminate on error, e.g. by passing &error_abort. Trap for the unwary; document and give the

[Qemu-devel] [PATCH v2 01/23] libqtest: Document calling conventions

2018-07-27 Thread Markus Armbruster
From: Eric Blake We have two flavors of vararg usage in qtest: qtest_hmp() etc. work like sprintf(), and qtest_qmp() etc. work like qobject_from_jsonf(). Spell that out in the comments. Also add GCC_FMT_ATTR() to qtest_hmp() etc. so that the compiler can flag incorrect use. We have some cleanup

[Qemu-devel] [PATCH v2 16/23] migration-test: Make wait_command() cope with '%'

2018-07-27 Thread Markus Armbruster
wait_command() passes its argument @command to qtest_qmp_send(). Falls apart if @command contain '%'. Two ways to disarm this trap: suppress interpretation of '%' by passing @command as argument to format string "%s", or fix it by having wait_command() take the variable arguments to go with @comma

[Qemu-devel] [PATCH v2 05/23] qobject: Replace qobject_from_jsonf() by qobject_from_jsonf_nofail()

2018-07-27 Thread Markus Armbruster
Commit ab45015a968 "qobject: Let qobject_from_jsonf() fail instead of abort" fails to accomplish its stated aim: the function can still abort due to its use of &error_abort. Its rationale for letting it fail is that all remaining users cope fine with failure. Well, they're just fine with aborting

[Qemu-devel] [PATCH v2 21/23] libqtest: Remove qtest_qmp_discard_response() & friends

2018-07-27 Thread Markus Armbruster
qtest_qmp_discard_response(...) is shorthand for qobject_unref(qtest_qmp(...), except it's not actually shorter. Moreover, the presence of these functions encourage sloppy testing. Remove them. Signed-off-by: Markus Armbruster --- tests/ahci-test.c | 12 ++-- tests/boot-orde

[Qemu-devel] [PATCH v2 19/23] migration-test: Clean up string interpolation into QMP, part 3

2018-07-27 Thread Markus Armbruster
Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migration-test.c interpolates strings into JSON in a few places: * migrate_set_parameter() interpolates

[Qemu-devel] [PATCH v2 20/23] libqtest: Enable compile-time format string checking

2018-07-27 Thread Markus Armbruster
qtest_qmp() & friends pass their format string and variable arguments to qobject_from_vjsonf_nofail(). Unlike qobject_from_jsonv(), they aren't decorated with GCC_FMT_ATTR(). Fix that to get compile-time format string checking. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud

[Qemu-devel] [PATCH v2 12/23] cpu-plug-test: Don't pass integers as strings to device_add

2018-07-27 Thread Markus Armbruster
test_plug_with_device_add_x86() plugs Haswell-i386-cpu and Haswell-x86_64-cpu with device_add. It passes socket-id, core-id, thread-id as JSON strings. The properties are actually integers. test_plug_with_device_add_coreid() plugs power8_v2.0-spapr-cpu-core and qemu-s390x-cpu with device_add. I

[Qemu-devel] [PATCH v2 15/23] tests: New helper qtest_qmp_receive_success()

2018-07-27 Thread Markus Armbruster
Commit b21373d0713 copied wait_command() from tests/migration-test.c to tests/tpm-util.c. Replace both copies by new libqtest helper qtest_qmp_receive_success(). Also use it to simplify qtest_qmp_device_del(). Bonus: gets rid of a non-literal format string. A step towards compile-time format st

[Qemu-devel] [PATCH v2 06/23] qobject: New qobject_from_vjsonf_nofail(), qdict_from_vjsonf_nofail()

2018-07-27 Thread Markus Armbruster
Every printf()-like function sooner or later needs its vprintf()-like buddy. The next commit will need qobject_from_jsonf_nofail()'s buddy, and qdict_from_jsonf_nofail()'s buddy will be used later in this series. Add both. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé --

Re: [Qemu-devel] [PATCH for-3.0 1/3] block/qapi: Add 'qdev' field to query-blockstats result

2018-07-27 Thread Eric Blake
On 07/27/2018 09:15 AM, Kevin Wolf wrote: Like for query-block, the client needs to identify which BlockBackend the returned data is for. Anonymous BlockBackends are identified by the device model they are attached to. Add a 'qdev' field that contains the qdev ID or QOM path of the attached devic

[Qemu-devel] [PATCH v2 03/23] libqtest: Clean up how we read device_del messages

2018-07-27 Thread Markus Armbruster
qtest_qmp_device_del() still uses the qmp("") hack to receive a message, even though we have qmp_receive() since commit 66e0c7b187e. Put it to use. Bonus: gets rid of empty format strings. A step towards compile-time format string checking without triggering -Wformat-zero-length. Signed-off-by:

Re: [Qemu-devel] [PATCH] macio/pmu: Fix missing vmsd terminator

2018-07-27 Thread Mark Cave-Ayland
On 27/07/18 14:44, Dr. David Alan Gilbert wrote: * Mark Cave-Ayland (mark.cave-ayl...@ilande.co.uk) wrote: On 27/07/18 13:31, Dr. David Alan Gilbert (git) wrote: From: "Dr. David Alan Gilbert" Fix missing terminator in VMStateDescription Fixes: d811d61fbc6ca5f2be2185fd7cfa916e7ba613ce Sign

[Qemu-devel] [PATCH v2 08/23] test-qobject-input-visitor: Avoid format string ambiguity

2018-07-27 Thread Markus Armbruster
When visitor_input_test_init_internal()'s argument @ap is null, then @json_string is interpreted literally, else it's gets %-escapes interpolated. This is awkward. One caller always passes null @ap, and the others never do. Lift the building of the QObject into the callers, where it can be done

[Qemu-devel] [PATCH v2 17/23] migration-test: Clean up string interpolation into QMP, part 1

2018-07-27 Thread Markus Armbruster
Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migrate_recover() builds QMP input manually because wait_command() can't interpolate. Well, it can sinc

[Qemu-devel] [PATCH v2 23/23] libqtest: Rename qtest_FOOv() to qtest_vFOO() for consistency

2018-07-27 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- tests/libqtest.c | 12 ++-- tests/libqtest.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index a0d44793fa..3706f30aa2 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -538,7 +538,

Re: [Qemu-devel] [PATCH for-3.0 2/3] block/qapi: Include anonymous BBs in query-blockstats

2018-07-27 Thread Eric Blake
On 07/27/2018 09:15 AM, Kevin Wolf wrote: Consistent with query-block, query-blockstats should not only include named BlockBackends, but also those that are anonmyous, but belong to a s/anonmyous/anonymous/ device model. Signed-off-by: Kevin Wolf --- block/qapi.c | 6 +- 1 file chang

Re: [Qemu-devel] [RFC PATCH 0/6] Clock and power gating support

2018-07-27 Thread KONRAD Frederic
Le 07/27/2018 à 04:59 PM, Peter Maydell a écrit : On 27 July 2018 at 15:37, Damien Hedde wrote: This set of patches add support for power and clock gating in device objects. It adds two booleans to the state, one for power state and one of clock state. The state is controlled trough 2 funct

Re: [Qemu-devel] [PATCH for-3.0 3/3] qemu-iotests: Test query-blockstats with -drive and -blockdev

2018-07-27 Thread Eric Blake
On 07/27/2018 09:15 AM, Kevin Wolf wrote: Make sure that query-blockstats returns information for every BlockBackend that is named or attached to a device model (or both). Needed for libvirt switching over to -blockdev, so even though we're rather late in the 3.0 cycle, I can understand it goi

Re: [Qemu-devel] [PATCH hack dontapply v2 7/7] pc: HACK: acpi: tie in _CST object to Processor

2018-07-27 Thread Igor Mammedov
On Thu, 26 Jul 2018 18:49:57 +0300 "Michael S. Tsirkin" wrote: > On Wed, Jul 25, 2018 at 04:49:08PM +0200, Igor Mammedov wrote: > > On Wed, 25 Jul 2018 15:50:09 +0300 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Jul 25, 2018 at 02:37:24PM +0200, Igor Mammedov wrote: > > > > On Tue, 10

Re: [Qemu-devel] [RFC PATCH 0/6] Clock and power gating support

2018-07-27 Thread Peter Maydell
On 27 July 2018 at 15:37, Damien Hedde wrote: > This set of patches add support for power and clock gating in device objects. > It adds two booleans to the state, one for power state and one of clock state. > > The state is controlled trough 2 functions, one for power and one for clock. > Two new

Re: [Qemu-devel] [qemu-s390x] [PATCH v1] s390x/cpu_models: Add "-cpu max" support

2018-07-27 Thread David Hildenbrand
> If we had a S390KVMAccelerator object on machine->accelerator, > S390KVMAccelerator::host_model would be a good candidate? Depends if at that point the machine would already be initialized (we disable CPU model support for KVM on some legacy machine due to interactions). It's complicated :) [...

Re: [Qemu-devel] [Qemu-block] [PATCH] block/file-posix: add bdrv_attach_aio_context callback for host dev and cdrom

2018-07-27 Thread Farhan Ali
On 07/27/2018 09:26 AM, Stefan Hajnoczi wrote: On Mon, Jul 23, 2018 at 12:42:02PM -0400, Farhan Ali wrote: On 07/23/2018 12:30 PM, Stefan Hajnoczi wrote: On Fri, Jul 20, 2018 at 03:11:14PM -0400, Farhan Ali wrote: I am seeing another issue pop up, in a different test. Even though it's a d

Re: [Qemu-devel] [PATCH RFC for-3.0-rc3 0/3] qemu-img: Disable copy offloading by default

2018-07-27 Thread Kevin Wolf
Am 27.07.2018 um 14:14 hat Fam Zheng geschrieben: > On Fri, Jul 27, 2018 at 6:29 PM Kevin Wolf wrote: > > > > Am 27.07.2018 um 05:33 hat Fam Zheng geschrieben: > > > Kevin pointed out that both glibc and kernel provides a slow fallback of > > > copy_file_range which hurts thin provisioning. This i

[Qemu-devel] [PATCH for-3.0] pc: acpi: fix memhp regression by reducing stub SRAT entry size

2018-07-27 Thread Igor Mammedov
Commit 848a1cc1e (hw/acpi-build: build SRAT memory affinity structures for DIMM devices) broke the first dimm hotplug in following cases: 1: there is no coldplugged dimm in the last numa node but there is a coldplugged dimm in another node -m 4096,slots=4,maxmem=32G \ -obj

[Qemu-devel] [RFC PATCH 0/6] Clock and power gating support

2018-07-27 Thread Damien Hedde
This set of patches add support for power and clock gating in device objects. It adds two booleans to the state, one for power state and one of clock state. The state is controlled trough 2 functions, one for power and one for clock. Two new methods *power_update* and *clock_update* is added to th

[Qemu-devel] [RFC PATCH 1/6] qdev: add a power and clock gating support

2018-07-27 Thread Damien Hedde
Add two boolean new fields _powered_ and _clocked_ to hold the gating state. Also add methods to act on each gating change. The power/clock gating is controlled by 2 functions *device_set_power* and *device_set_clock*. Add a default behavior to do a device_reset at power-up. Signed-off-by: Damien

[Qemu-devel] [RFC PATCH 2/6] qdev: add power/clock gating control on bus tree

2018-07-27 Thread Damien Hedde
Add functions [qdev|qbus]_set_[power|clock]_all(_fn). Theses allow to control power and clock gating along a bus hierarchy. Signed-off-by: Damien Hedde --- include/hw/qdev-core.h | 20 + hw/core/qdev.c | 51 ++ 2 files changed, 71 i

[Qemu-devel] [RFC PATCH 3/6] sysbus: Specialize gating_update to enable/disable memory regions

2018-07-27 Thread Damien Hedde
The default methods are overriden to add the activation/deactivation of the memory regions according to the gating state: Regions are enabled only when powered and clocked. As powering-up triggers a reset call, memory regions should be reset in specialized sysbus devices. Signed-off-by: Damien Hed

[Qemu-devel] [RFC PATCH 6/6] xilinx_zynq: add uart clock gating support

2018-07-27 Thread Damien Hedde
Add the link between the clock controller _slcr_ and the two uarts _uart0_ and _uart1_ so that the controller can do the gating. Signed-off-by: Damien Hedde --- hw/arm/xilinx_zynq.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/arm/xilinx_zynq.c b/h

[Qemu-devel] [RFC PATCH 4/6] cadence_uart: add clock/power gating support

2018-07-27 Thread Damien Hedde
Only discard input characters when unpowered/unclocked. As it is a sysbus device, mmio are already disabled when unpowered or unclocked. Signed-off-by: Damien Hedde --- hw/char/cadence_uart.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/hw/char/ca

[Qemu-devel] [RFC PATCH 5/6] zynq_slcr: add uart clock gating and soft reset support

2018-07-27 Thread Damien Hedde
Clock gating and reset of uart0 and uart1 is controlled by UART_CLK_CTRL and UART_RST_CTRL. Uart0 and uart1 links are kept in properties to allow taking action. The CLKACT bit in UART_CLK_CTRL is used to driver the clock gating. In order to implement the reset behavior, which can be hold: when re

[Qemu-devel] [PATCH for-3.0 1/3] block/qapi: Add 'qdev' field to query-blockstats result

2018-07-27 Thread Kevin Wolf
Like for query-block, the client needs to identify which BlockBackend the returned data is for. Anonymous BlockBackends are identified by the device model they are attached to. Add a 'qdev' field that contains the qdev ID or QOM path of the attached device model. Signed-off-by: Kevin Wolf --- qa

[Qemu-devel] [PATCH for-3.0 2/3] block/qapi: Include anonymous BBs in query-blockstats

2018-07-27 Thread Kevin Wolf
Consistent with query-block, query-blockstats should not only include named BlockBackends, but also those that are anonmyous, but belong to a device model. Signed-off-by: Kevin Wolf --- block/qapi.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/qapi.c b/block/qap

  1   2   >