Re: [Qemu-devel] [RFC 10/15] s390-bios: Support for running format-0/1 channel programs

2018-07-06 Thread Christian Borntraeger
On 07/05/2018 07:25 PM, Jason J. Herne wrote: > From: "Jason J. Herne" > > Add struct for format-0 ccws. Support executing format-0 channel > programs and waiting for their completion before continuing execution. > This will be used for real dasd ipl. > > Add cu_type() to channel io library.

Re: [Qemu-devel] [Qemu-ppc] [PATCH] vga: make stdvga the global default

2018-07-06 Thread Gerd Hoffmann
On Thu, Jul 05, 2018 at 05:24:09PM +0100, Mark Cave-Ayland wrote: > On 05/07/18 14:12, Eduardo Habkost wrote: > > > > I also checked the code, default values are used also for other fields in > > > that struct (e.g., default_cpus). If default values are considered > > > fragile, > > > they must b

Re: [Qemu-devel] [PATCH v3 0/4] fix image fleecing

2018-07-06 Thread Fam Zheng
On Thu, 07/05 10:46, Vladimir Sementsov-Ogievskiy wrote: > Hi all. > > This fixes image fleecing scheme for 3.0, details are in 04 patch. Looks like this breaks 'test-replication': http://patchew.org/QEMU/20180705074638.770905-1-vsement...@virtuozzo.com/ test-replication: /stor/work/qemu/block/

Re: [Qemu-devel] [RFC 01/15] s390 vfio-ccw: Add bootindex property and IPLB data

2018-07-06 Thread Cornelia Huck
On Thu, 5 Jul 2018 13:25:29 -0400 "Jason J. Herne" wrote: > From: "Jason J. Herne" > > Add bootindex property and iplb data for vfio-ccw devices. This allows us to > forward boot information into the bios for vfio-ccw devices. > > Signed-off-by: Jason J. Herne > Acked-by: Halil Pasic > Sign

Re: [Qemu-devel] [PATCH] monitor: fix double-free of request error

2018-07-06 Thread Peter Xu
On Fri, Jul 06, 2018 at 08:25:57AM +0200, Markus Armbruster wrote: > Peter Xu writes: > > > On Thu, Jul 05, 2018 at 06:42:01PM +0200, Marc-André Lureau wrote: > >> qmp_error_response() will free the given error. Fix double-free in > >> later qmp_request_free(). > >> > >> Signed-off-by: Marc-Andr

Re: [Qemu-devel] [RFC 02/15] s390-bios: decouple cio setup from virtio

2018-07-06 Thread Cornelia Huck
On Thu, 5 Jul 2018 13:25:30 -0400 "Jason J. Herne" wrote: > From: "Jason J. Herne" > > Move channel i/o setup code out to a separate function. This decouples cio > setup from the virtio code path and allows us to make use of it for booting > dasd devices. > > Signed-off-by: Jason J. Herne >

Re: [Qemu-devel] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space

2018-07-06 Thread Cédric Le Goater
On 07/06/2018 07:44 AM, David Gibson wrote: > On Tue, Jul 03, 2018 at 05:19:56PM +0200, Cédric Le Goater wrote: >> On 07/02/2018 01:11 PM, Cédric Le Goater wrote: >>> On 07/02/2018 12:03 PM, Cédric Le Goater wrote: > --- a/hw/ppc/spapr_vio.c > +++ b/hw/ppc/spapr_vio.c > @@ -436,6 +436,9

Re: [Qemu-devel] [RFC 08/15] s390-bios: Map low core memory

2018-07-06 Thread Cornelia Huck
On Thu, 5 Jul 2018 13:25:36 -0400 "Jason J. Herne" wrote: > From: "Jason J. Herne" > > Create a new header for basic architecture specific definitions and add a > mapping of low core memory. This mapping will be used by the real dasd boot > process. > > Signed-off-by: Jason J. Herne > Signed

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 1/3] spapr: introduce a fixed IRQ number space

2018-07-06 Thread Cédric Le Goater
On 07/06/2018 09:40 AM, Cédric Le Goater wrote: > On 07/06/2018 07:44 AM, David Gibson wrote: >> On Tue, Jul 03, 2018 at 05:19:56PM +0200, Cédric Le Goater wrote: >>> On 07/02/2018 01:11 PM, Cédric Le Goater wrote: On 07/02/2018 12:03 PM, Cédric Le Goater wrote: >> --- a/hw/ppc/spapr_vio.c

[Qemu-devel] [PATCH for-3.0] ppc: fix default VGA display for PReP machines

2018-07-06 Thread Mark Cave-Ayland
Commit 29f9cef "ppc: Include vga cirrus card into the compiling process" changed the default display adapter for all PPC machines to cirrus. Unfortunately it missed setting the default display type to stdvga for both PReP machines causing the display to fail to initialise under OpenHackWare. Upda

Re: [Qemu-devel] [Qemu-ppc] [PATCH] vga: make stdvga the global default

2018-07-06 Thread Mark Cave-Ayland
On 06/07/18 08:14, Gerd Hoffmann wrote: On Thu, Jul 05, 2018 at 05:24:09PM +0100, Mark Cave-Ayland wrote: On 05/07/18 14:12, Eduardo Habkost wrote: I also checked the code, default values are used also for other fields in that struct (e.g., default_cpus). If default values are considered frag

Re: [Qemu-devel] [PATCH 5/9] monitor: suspend monitor instead of send CMD_DROP

2018-07-06 Thread Markus Armbruster
Peter Xu writes: > On Thu, Jul 05, 2018 at 11:47:30AM -0500, Eric Blake wrote: >> On 07/04/2018 03:45 AM, Peter Xu wrote: >> > When we received too many qmp commands, previously we'll send >> > COMMAND_DROPPED events to monitors, then we'll drop the requests. It >> > can only solve the flow cont

Re: [Qemu-devel] [RFC 10/15] s390-bios: Support for running format-0/1 channel programs

2018-07-06 Thread Cornelia Huck
On Thu, 5 Jul 2018 13:25:38 -0400 "Jason J. Herne" wrote: > From: "Jason J. Herne" > > Add struct for format-0 ccws. Support executing format-0 channel > programs and waiting for their completion before continuing execution. > This will be used for real dasd ipl. > > Add cu_type() to channel

[Qemu-devel] [RFC for 3.0] tests/tpm-emu: double the timeout

2018-07-06 Thread Alex Bennée
We see various failures on Travis so lets just double the timeout and see if that makes them go away. Signed-off-by: Alex Bennée --- tests/tpm-emu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tpm-emu.c b/tests/tpm-emu.c index 8c2bd53cad..308f1884f6 100644 --- a/tes

Re: [Qemu-devel] [PATCH 1/2] tcg: Restrict check_size_impl to multiples of the line size

2018-07-06 Thread Alex Bennée
Richard Henderson writes: > Normally this is automatic in the size restrictions that are placed > on vector sizes coming from the implementation. However, for the > legitimate size tuple [oprsz=8, maxsz=32], we need to clear the final > 24 bytes of the vector register. Without this check, do_

Re: [Qemu-devel] [PATCH 5/9] monitor: suspend monitor instead of send CMD_DROP

2018-07-06 Thread Markus Armbruster
Peter Xu writes: > When we received too many qmp commands, previously we'll send > COMMAND_DROPPED events to monitors, then we'll drop the requests. It > can only solve the flow control of the request queue, however it'll not > really work since we might queue unlimited events in the response qu

Re: [Qemu-devel] [PATCH 2/2] target/arm: Fix do_predset for large VL

2018-07-06 Thread Alex Bennée
Richard Henderson writes: > Use MAKE_64BIT_MASK instead of open-coding. Remove an odd > vector size check that is unlikely to be more profitable > than 3 64-bit integer stores. Correct the iteration for WORD > to avoid writing too much data. > > Fixes RISU tests of PTRUE for VL 256. > > Signe

Re: [Qemu-devel] [PATCH] i386: Add support to get/set/migrate MSR (33H)

2018-07-06 Thread Liu, Jingqi
On 04/07/2018 21:37, Paolo Bonzini wrote: > On 04/07/2018 15:21, Jingqi Liu wrote: > > The MSR (33H) controls support for #AC exception for split locked > > accesses. When bit 29 of the MSR (33H) is set, the processor causes an > > #AC exception to be issued instead of suppressing LOCK on bus (du

Re: [Qemu-devel] [PATCH] i386: Add support to get/set/migrate MSR (33H)

2018-07-06 Thread Liu, Jingqi
On 05/07/2018 03:43, Eduardo Habkost wrote: > On Wed, Jul 04, 2018 at 09:21:06PM +0800, Jingqi Liu wrote: > > The MSR (33H) controls support for #AC exception for split locked > > accesses. When bit 29 of the MSR (33H) is set, the processor causes an > > #AC exception to be issued instead of supp

Re: [Qemu-devel] [PATCH] i386: Add support to get/set/migrate MSR (33H)

2018-07-06 Thread Daniel P . Berrangé
On Wed, Jul 04, 2018 at 04:43:27PM -0300, Eduardo Habkost wrote: > On Wed, Jul 04, 2018 at 09:21:06PM +0800, Jingqi Liu wrote: > > The MSR (33H) controls support for #AC exception > > for split locked accesses. When bit 29 of the MSR (33H) > > is set, the processor causes an #AC exception to > > be

Re: [Qemu-devel] [PATCH v3 0/4] migation: unbreak postcopy recovery

2018-07-06 Thread Dr. David Alan Gilbert
Queued * Peter Xu (pet...@redhat.com) wrote: > v3: > - keep the recovery logic even for RDMA by dropping the 3rd patch and > touch up the original 4th patch (current 3rd patch) to suite that [Dave] > > v2: > - break the first patch into several > - fix a QEMUFile leak > > Please review. Thank

Re: [Qemu-devel] [PATCH v2 6/9] block: Use common req handling for discard

2018-07-06 Thread Kevin Wolf
Am 06.07.2018 um 08:51 hat Fam Zheng geschrieben: > On Thu, 07/05 14:44, Kevin Wolf wrote: > > Am 05.07.2018 um 09:36 hat Fam Zheng geschrieben: > > > Reuse the new bdrv_co_write_req_prepare/finish helpers. The variation > > > here is that discard requests don't affect bs->wr_highest_offset. > > >

Re: [Qemu-devel] [Qemu-ppc] [PATCH 7/7] target/ppc: Use non-arithmetic conversions for fp load/store

2018-07-06 Thread Mark Cave-Ayland
On 05/07/18 17:48, Richard Henderson wrote: On 07/05/2018 09:31 AM, Programmingkid wrote: On Jul 3, 2018, at 11:17 AM, Richard Henderson wrote: Memory operations have no side effects on fp state. The use of a "real" conversions between float64 and float32 would raise exceptions for SNaN and

Re: [Qemu-devel] [PATCH v3 4/8] target/mips: Avoid case statements formulated by ranges

2018-07-06 Thread Aleksandar Markovic
> > case 18: > > switch (sel) { > > -case 0 ... 7: > > +case 0: > > +case 1: > > +case 2: > > +case 3: > > +case 4: > > +case 5: > > +case 6: > > +case 7: > > I don't see the point in this. It is clear what 0 ...

[Qemu-devel] [PATCH v4 0/3] spapr: introduce a fixed IRQ number space and an IRQ controller backend

2018-07-06 Thread Cédric Le Goater
Here is a proposal for a new IRQ number space layout using static numbers and a bitmap allocator for the MSIs. The previous layout is kept for compatibly in machines raising the 'legacy_irq_allocation' flag. The patchset also introduces a sPAPR IRQ interface which offers the possibility to provide

[Qemu-devel] [PATCH v4 1/3] spapr: introduce a fixed IRQ number space

2018-07-06 Thread Cédric Le Goater
This proposal introduces a new IRQ number space layout using static numbers for all devices, depending on a device index, and a bitmap allocator for the MSI IRQ numbers which are negotiated by the guest at runtime. As the VIO device model does not have a device index but a "reg" property, we intro

[Qemu-devel] [PATCH v4 2/3] spapr: introduce a IRQ controller backend to the machine

2018-07-06 Thread Cédric Le Goater
This proposal moves all the related IRQ routines of the sPAPR machine behind a sPAPR IRQ backend interface 'spapr_irq' to prepare for future changes. First of which will be to increase the size of the IRQ number space, then, will follow a new backend for the POWER9 XIVE IRQ controller. Signed-off-

[Qemu-devel] [PATCH v4 3/3] spapr: increase the size of the IRQ number space

2018-07-06 Thread Cédric Le Goater
The new layout using static IRQ number does not leave much space to the dynamic MSI range, only 0x100 IRQ numbers. Increase the total number of IRQS for newer machines and introduce a legacy XICS backend for pre-3.1 machines to maintain compatibility. Signed-off-by: Cédric Le Goater --- The new

Re: [Qemu-devel] [PULL v3 0/7] riscv-pull queue

2018-07-06 Thread Peter Maydell
On 6 July 2018 at 02:24, Alistair Francis wrote: > I think the SoC device should map it's own ROM (it lines up more with > the physical SoC). > > I think that is how other SoC devices do it as well. I'm not really > sure what other address space to map it to. I generally suggest the approach wher

Re: [Qemu-devel] [PATCH v2] ui/cocoa.m: replace scrollingDeltaY with deltaY

2018-07-06 Thread Peter Maydell
On 6 July 2018 at 03:53, John Arbuckle wrote: > The NSEvent class method scrollingDeltaY is available > for Mac OS 10.7 and newer. Since QEMU supports Mac OS > 10.5 and up, we need to be using a method that is > available on these version of Mac OS X. The deltaY > method is a method that does the

Re: [Qemu-devel] [PATCH for-3.0 0/9] migration: postcopy recovery unit test, bug fixes

2018-07-06 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Based-on: <20180627132246.5576-1-pet...@redhat.com> > > Based on the series to unbreak postcopy: > Subject: [PATCH v3 0/4] migation: unbreak postcopy recovery > Message-Id: <20180627132246.5576-1-pet...@redhat.com> > > This series introduce a new postco

Re: [Qemu-devel] [PATCH v3 20/20] arm/virt: Add support for GICv2 virtualization extensions

2018-07-06 Thread Jan Kiszka
On 2018-07-05 10:00, Jan Kiszka wrote: > On 2018-07-05 08:51, Jan Kiszka wrote: >> On 2018-06-29 15:29, Luc Michel wrote: >>> Add support for GICv2 virtualization extensions by mapping the necessary >>> I/O regions and connecting the maintenance IRQ lines. >>> >>> Declare those additions in the dev

Re: [Qemu-devel] [RFC for 3.0] tests/tpm-emu: double the timeout

2018-07-06 Thread Marc-André Lureau
Hi On Fri, Jul 6, 2018 at 10:06 AM, Alex Bennée wrote: > We see various failures on Travis so lets just double the timeout and > see if that makes them go away. This is just waiting for the thread to start and open a socket. It shouldn't be a problem to wait longer, but do you have a Travis erro

Re: [Qemu-devel] [PATCH] i386: Add support to get/set/migrate MSR (33H)

2018-07-06 Thread Paolo Bonzini
On 06/07/2018 10:43, Daniel P. Berrangé wrote: >> Based on the Linux patch at [1], guests may try to detect the >> feature by writing to the MSR unconditionally. >> >> If this happens, KVM needs to provide a mechanism to >> enable/disable the MSR emulation. Otherwise users will end up >> with VMs

Re: [Qemu-devel] [PATCH 5/9] monitor: suspend monitor instead of send CMD_DROP

2018-07-06 Thread Peter Xu
On Fri, Jul 06, 2018 at 10:09:58AM +0200, Markus Armbruster wrote: > If I understand the code correctly, the response queue > mon->qmp..qmp_requests gets drained into the output buffer mon->outbuf > by bottom half monitor_qmp_bh_responder(). The response queue remains > small, it's the output buff

Re: [Qemu-devel] [PATCH] migration: release MigrationIncomingState in migration_object_finalize

2018-07-06 Thread Dr. David Alan Gilbert
* Lidong Chen (jemmy858...@gmail.com) wrote: > Qemu initialize the MigrationIncomingState structure in migration_object_init, > but not release it. this patch release it in migration_object_finalize. > > Signed-off-by: Lidong Chen Queued > --- > migration/migration.c | 7 +++ > 1 file chan

Re: [Qemu-devel] [RFC 15/15] s390-bios: Use sense ccw to ensure consistent device state at boot time

2018-07-06 Thread Cornelia Huck
On Thu, 5 Jul 2018 13:25:43 -0400 "Jason J. Herne" wrote: > If a vfio-ccw device is left in an error state (example: pending unit > check) then it is possible for that state to persist for a vfio-ccw device > even > after the enable subchannel that we do to bring the device online. If this > s

Re: [Qemu-devel] [PATCH 2/2] qapi: add transaction support for x-block-dirty-bitmap-merge

2018-07-06 Thread Vladimir Sementsov-Ogievskiy
05.07.2018 23:40, John Snow wrote: On 07/03/2018 06:53 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/transaction.json | 2 ++ blockdev.c| 53 ++- 2 files changed, 54 insertions(+), 1

Re: [Qemu-devel] [PULL v4 0/7] riscv-pull queue

2018-07-06 Thread Peter Maydell
On 6 July 2018 at 02:22, Alistair Francis wrote: > The following changes since commit cee35138b59c6d6b0808c5fa644e3f063832860f: > > Merge remote-tracking branch > 'remotes/stsquad/tags/pull-code-coverage-and-build-tweaks-050718-3' into > staging (2018-07-05 18:24:28 +0100) > > are available in

Re: [Qemu-devel] [RFC for 3.0] tests/tpm-emu: double the timeout

2018-07-06 Thread Alex Bennée
Marc-André Lureau writes: > Hi > > On Fri, Jul 6, 2018 at 10:06 AM, Alex Bennée wrote: >> We see various failures on Travis so lets just double the timeout and >> see if that makes them go away. > > This is just waiting for the thread to start and open a socket. It > shouldn't be a problem to

Re: [Qemu-devel] [RFC for 3.0] tests/tpm-emu: double the timeout

2018-07-06 Thread Marc-André Lureau
On Fri, Jul 6, 2018 at 12:19 PM, Alex Bennée wrote: > > Marc-André Lureau writes: > >> Hi >> >> On Fri, Jul 6, 2018 at 10:06 AM, Alex Bennée wrote: >>> We see various failures on Travis so lets just double the timeout and >>> see if that makes them go away. >> >> This is just waiting for the thr

Re: [Qemu-devel] [qemu-s390x] [RFC 10/15] s390-bios: Support for running format-0/1 channel programs

2018-07-06 Thread Christian Borntraeger
On 07/06/2018 09:04 AM, Christian Borntraeger wrote: > > > On 07/05/2018 07:25 PM, Jason J. Herne wrote: >> From: "Jason J. Herne" >> >> Add struct for format-0 ccws. Support executing format-0 channel >> programs and waiting for their completion before continuing execution. >> This will be u

Re: [Qemu-devel] [PATCH for-3.0 5/9] tests: allow migrate() to take extra flags

2018-07-06 Thread Balamuruhan S
On Thu, Jul 05, 2018 at 11:17:51AM +0800, Peter Xu wrote: > For example, we can pass in '"resume": true' to resume a migration. > > Signed-off-by: Peter Xu > --- Reviewed-by: Balamuruhan S > tests/migration-test.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff

Re: [Qemu-devel] [PATCH for-3.0 7/9] tests: introduce wait_for_migration_status()

2018-07-06 Thread Balamuruhan S
On Thu, Jul 05, 2018 at 11:17:53AM +0800, Peter Xu wrote: > It's generalized from wait_for_migration_complete() to allow us to wait > for any migration status besides failure. > > Signed-off-by: Peter Xu > --- Reviewed-by: Balamuruhan S > tests/migration-test.c | 10 -- > 1 file chang

Re: [Qemu-devel] [PATCH] migration: release MigrationIncomingState in migration_object_finalize

2018-07-06 Thread Dr. David Alan Gilbert
* Dr. David Alan Gilbert (dgilb...@redhat.com) wrote: > * Lidong Chen (jemmy858...@gmail.com) wrote: > > Qemu initialize the MigrationIncomingState structure in > > migration_object_init, > > but not release it. this patch release it in migration_object_finalize. > > > > Signed-off-by: Lidong Che

Re: [Qemu-devel] [RFC] target/arm: Suppress Coverity warning for PRF

2018-07-06 Thread Peter Maydell
On 5 July 2018 at 19:07, Peter Maydell wrote: > On 5 July 2018 at 19:04, Richard Henderson > wrote: >> These instructions must perform the sve_access_check, but >> since they are implemented as NOPs there is no generated >> code to elide when the access check fails. >> >> Fixes: Coverity issues

Re: [Qemu-devel] [PATCH 0/2] target/arm: SVE fixes

2018-07-06 Thread Peter Maydell
On 5 July 2018 at 20:19, Richard Henderson wrote: > RISU testing with ARM Fast Models and VQ=16 showed up two bugs, > both affecting the PTRUE instruction. > > > r~ > > > Richard Henderson (2): > tcg: Restrict check_size_impl to multiples of the line size > target/arm: Fix do_predset for large

Re: [Qemu-devel] [PATCH for-3.0 0/9] migration: postcopy recovery unit test, bug fixes

2018-07-06 Thread Dr. David Alan Gilbert
* Dr. David Alan Gilbert (dgilb...@redhat.com) wrote: > * Peter Xu (pet...@redhat.com) wrote: > > Based-on: <20180627132246.5576-1-pet...@redhat.com> > > > > Based on the series to unbreak postcopy: > > Subject: [PATCH v3 0/4] migation: unbreak postcopy recovery > > Message-Id: <20180627132246

Re: [Qemu-devel] [PULL 10/16] migration: Create ram_save_multifd_page

2018-07-06 Thread Peter Maydell
On 27 June 2018 at 13:55, Juan Quintela wrote: > The function still don't use multifd, but we have simplified > ram_save_page, xbzrle and RDMA stuff is gone. We have added a new > counter. > > Signed-off-by: Juan Quintela > Reviewed-by: Dr. David Alan Gilbert > > -- > Add last_page parameter >

[Qemu-devel] [PATCH v6 00/27] qapi: add #if pre-processor conditions to generated code (part 2)

2018-07-06 Thread Marc-André Lureau
Hi, This is the second part of the "add #if pre-processor conditions to generated code" series, adding schema member conditions (roughly 16-38/49). Members can be exploded as dictionnary with 'type'/'if' keys: { 'struct': 'TestIfStruct', 'data': { 'foo': 'int', 'bar': { 'type': 'int', 'if'

[Qemu-devel] [PATCH v6 01/27] qmp-shell: learn to send commands with quoted arguments

2018-07-06 Thread Marc-André Lureau
Use shlex to split the CLI command, respecting quoted arguments, and also comments. This allows to call for ex: (QEMU) human-monitor-command command-line="screendump /dev/null" {"execute": "human-monitor-command", "arguments": {"command-line": "screendump /dev/null"}} Signed-off-by: Marc-André L

[Qemu-devel] [PATCH v6 07/27] qapi: rename QAPISchemaEnumType.values to .members

2018-07-06 Thread Marc-André Lureau
Rename QAPISchemaEnumType.values and related variables to members. Makes sense ever since commit 93bda4dd4 changed .values from list of string to list of QAPISchemaMember. Obvious no-op. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 24 1 file changed, 12

[Qemu-devel] [PATCH v6 02/27] json: remove useless return value from lexer/parser

2018-07-06 Thread Marc-André Lureau
The lexer always returns 0 when char feeding. Furthermore, none of the caller care about the return value. Signed-off-by: Marc-André Lureau Message-Id: <20180326150916.9602-10-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- include/qapi/qmp/json

[Qemu-devel] [PATCH v6 03/27] tests: change /0.15/* tests to /qmp/*

2018-07-06 Thread Marc-André Lureau
Presumably 0.15 was the version it was first introduced, but qmp keeps evolving. There is no point in having that version as test prefix, 'qmp' makes more sense here. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Message-Id: <20180326150916.9602-12-marcandre.lur...@redhat.com> Reviewe

[Qemu-devel] [PATCH v6 08/27] qapi: change enum visitor and gen_enum* to take QAPISchemaMember

2018-07-06 Thread Marc-André Lureau
This will allow to add and access more properties associated with enum values/members, like the associated 'if' condition. We may want to have a specialized type QAPISchemaEnumMember, for now this will do. While at it, also modify gen_enum() and gen_enum_lookup() for the same reason. Suggested-by

[Qemu-devel] [PATCH v6 06/27] qapi: do not define enumeration value explicitly

2018-07-06 Thread Marc-André Lureau
The C standard has the initial value at 0 and the subsequent values incremented by 1. No need to set this explicitely. This will prevent from artificial "gaps" when compiling out some enum values and having unnecessarily large MAX values & enums arrays, or simplifying iterating over valid enum val

[Qemu-devel] [PATCH v6 04/27] qapi: Fix some pycodestyle-3 complaints

2018-07-06 Thread Marc-André Lureau
From: Markus Armbruster Fix the following issues: common.py:873:13: E129 visually indented line with same indent as next logical line common.py:1766:5: E741 ambiguous variable name 'l' common.py:1784:1: E305 expected 2 blank lines after class or function definition, found 1 com

[Qemu-devel] [PATCH v6 23/27] qapi: add 'If:' condition to enum values documentation

2018-07-06 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 5 - tests/qapi-schema/doc-good.json | 4 +++- tests/qapi-schema/doc-good.out | 1 + tests/qapi-schema/doc-good.texi | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/doc.py b/scripts/qa

[Qemu-devel] [PATCH v6 11/27] qapi: improve reporting of unknown or missing keys

2018-07-06 Thread Marc-André Lureau
Report the set of missing or unknown keys. And give a hint about the accepted keys. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 23 +++ tests/qapi-schema/alternate-base.err| 1 + tests/qapi-schema/double-type.err | 1 + tests/qap

[Qemu-devel] [PATCH v6 13/27] qapi: add 'if' to enum members

2018-07-06 Thread Marc-André Lureau
QAPISchemaMember gains .ifcond for enum members: inherited classes, such as QAPISchemaObjectTypeMember, will thus have an ifcond member after this (those different types will also use the .ifcond to store the condition and generate conditional code in the following patches). Generated code is not

[Qemu-devel] [PATCH v6 10/27] qapi: factor out checking for keys

2018-07-06 Thread Marc-André Lureau
Introduce a new helper function to check if the given keys are known, and if mandatory keys are present. The function will be reused in other places in the following code changes. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 20 +--- 1 file changed, 13 insertions

[Qemu-devel] [PATCH v6 05/27] qapi: include osdep.h in type headers

2018-07-06 Thread Marc-André Lureau
Now that the schema can be configured, it is crucial that all types are configured the same. Make sure config-host.h is included, so build-sys tracks the dependency and rebuilds the types, by including osdep.h first. Signed-off-by: Marc-André Lureau --- scripts/qapi/types.py | 1 + 1 file change

[Qemu-devel] [PATCH v6 25/27] qapi: add condition to variants documentation

2018-07-06 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 5 +++-- tests/qapi-schema/doc-good.json | 4 ++-- tests/qapi-schema/doc-good.out | 3 +++ tests/qapi-schema/doc-good.texi | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/qapi/doc.py b/script

[Qemu-devel] [PATCH v6 12/27] qapi: add a dictionnary form with 'name' key for enum members

2018-07-06 Thread Marc-André Lureau
Desugar the enum NAME form to { 'name': NAME }. This will allow to add new enum members, such as 'if' in the following patch. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py| 47 --- tests/Makefile.include| 3 +- tests/

[Qemu-devel] [PATCH v6 09/27] tests: print enum type members more like object type members

2018-07-06 Thread Marc-André Lureau
Commit 93bda4dd461 changed the internal representation of enum type members from str to QAPISchemaMember, but we still print only a string. Has been good enough, as the name is the member's only attribute of interest, but that's about to change. To prepare, print them more like object type member

[Qemu-devel] [PATCH v6 18/27] qapi: add an error in case a discriminator is conditionnal

2018-07-06 Thread Marc-André Lureau
Making a discriminator conditonal doesn't make much sense. Instead, the union could be made conditional. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 11 +-- tests/Makefile.include | 1 + .../flat-union-invalid-if-discri

[Qemu-devel] [PATCH v6 27/27] qapi: add conditions to REPLICATION type/commands on the schema

2018-07-06 Thread Marc-André Lureau
Add #if defined(CONFIG_REPLICATION) in generated code, and adjust the code accordingly. Made conditional: * xen-set-replication, query-xen-replication-status, xen-colo-do-checkpoint Before the patch, we first register the commands unconditionally in generated code (requires a stub), then c

[Qemu-devel] [PATCH v6 16/27] qapi: add a dictionary form with 'type' key for members

2018-07-06 Thread Marc-André Lureau
Wherever a struct/union/alternate/command/event member with NAME: TYPE form is accepted, desugar it to a NAME: { 'type': TYPE } form. This will allow to add new member details, such as 'if' in the following patch to introduce conditionals, or 'default' for default values etc. Signed-off-by: Marc-

[Qemu-devel] [PATCH v6 19/27] qapi: add 'if' on union members

2018-07-06 Thread Marc-André Lureau
Add 'if' key to union members: { 'union': 'TestIfUnion', 'data': 'mem': { 'type': 'str', 'if': 'COND'} } Generated code is not changed by this patch but with "qapi: add #if conditions to generated code". Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 17

[Qemu-devel] [PATCH v6 15/27] qapi: rename allow_dict to allow_implicit

2018-07-06 Thread Marc-André Lureau
This makes it a bit clearer what is the intent of the dictionnary for the check_type() function, since there was some confusion on a previous iteration of this series. Suggested-by: Markus Armbruster Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 12 ++-- 1 file changed,

[Qemu-devel] [PATCH v6 17/27] qapi: add 'if' to implicit struct members

2018-07-06 Thread Marc-André Lureau
Generated code is not changed by this patch, but with "qapi: add #if conditions to generated code" patch. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 14 +++--- tests/qapi-schema/qapi-schema-test.json | 12 +--- tests/qapi-schema/qapi-schema-tes

[Qemu-devel] [PATCH v6 14/27] qapi-event: add 'if' condition to implicit event enum

2018-07-06 Thread Marc-André Lureau
Add condition to QAPIEvent enum members based on the event 'if'. Generated code is not changed by this patch, but with "qapi: add #if conditions to generated code" patch. There is no coverage of this change in qapi-schema-test.out since the event_names enum is an implicit type created by qapi-eve

[Qemu-devel] [PATCH v6 24/27] qapi: add 'If:' condition to struct members documentation

2018-07-06 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 4 +++- tests/qapi-schema/doc-good.json | 3 ++- tests/qapi-schema/doc-good.out | 1 + tests/qapi-schema/doc-good.texi | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/doc.py b/scripts/qapi/

[Qemu-devel] [PATCH v6 20/27] qapi: add 'if' to alternate members

2018-07-06 Thread Marc-André Lureau
Add 'if' key to alternate members: { 'alternate': 'TestIfAlternate', 'data': { 'alt': { 'type': 'TestStruct', 'if': 'COND' } } } Generated code is not changed by this patch but with "qapi: add #if conditions to generated code". Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py

[Qemu-devel] [PATCH v6 21/27] qapi: add #if conditions to generated code members

2018-07-06 Thread Marc-André Lureau
Wrap generated enum/struct members and code with #if/#endif, using the .ifcond members added in the previous patches. Some types generate both enum and struct members for example, so a step-by-step is unnecessarily complicated to deal with (it would easily generate invalid intermediary code). Sig

[Qemu-devel] [PATCH v6 22/27] docs: document schema configuration

2018-07-06 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- docs/devel/qapi-code-gen.txt | 19 +++ 1 file changed, 19 insertions(+) diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index c2e11465f0..799aef7728 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-

[Qemu-devel] [PATCH v6 26/27] qapi: add more conditions to SPICE

2018-07-06 Thread Marc-André Lureau
Now that member can be made conditional, let's make SPICE chardev conditional: * spiceport, spicevmc Before and after the patch for !CONFIG_SPICE, the error is the same ('spiceport' is not a valid char driver name). Signed-off-by: Marc-André Lureau --- qapi/char.json | 16

[Qemu-devel] [PATCH 05/12] monitor: no need to save need_resume

2018-07-06 Thread Marc-André Lureau
There is no need for per-command need_resume granularity, it should resume after running an non-oob command on oob-disabled monitor. Signed-off-by: Marc-André Lureau --- monitor.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/monitor.c b/monitor.c index 462cf96

[Qemu-devel] [PATCH 06/12] qga: process_event() simplification and leak fix

2018-07-06 Thread Marc-André Lureau
json_parser_parse_err() may return something else than a QDict, in which case we loose the object. Let's keep track of the original object to avoid leaks. When an error occurs, "qdict" contains the response, but we still check the "execute" key there. Untangle a bit this code, by having a clear er

[Qemu-devel] [PATCH 08/12] json-lexer: make it safe to call multiple times

2018-07-06 Thread Marc-André Lureau
We can easily avoid the burden of checking if the lexer was initialized prior to calling destroy by the caller, let's do it. This allows simplification in state tracking in later patches of the qmp-async RFC series. Signed-off-by: Marc-André Lureau --- qobject/json-lexer.c | 5 - 1 file cha

[Qemu-devel] [PATCH 07/12] json-parser: always set an error if return NULL

2018-07-06 Thread Marc-André Lureau
Let's make json_parser_parse_err() suck less, and simplify caller error handling. * qga/main.c process_event() doesn't need further changes after previous cleanup. * qobject/json-parser.c json_parser_parse() Ignores the error. * qobject/qjson.c qobject_from_jsonv() via parse_json() -

[Qemu-devel] [PATCH 04/12] Revert "qmp: isolate responses into io thread"

2018-07-06 Thread Marc-André Lureau
This reverts commit abe3cd0ff7f774966da6842620806ab7576fe4f3. There is no need to add an additional queue to send the reply to the IOThread, because QMP response is thread safe, and chardev write path is thread safe. It will schedule the watcher in the associated IOThread. Signed-off-by: Marc-And

[Qemu-devel] [PATCH 09/12] tests: add a few qemu-qmp tests

2018-07-06 Thread Marc-André Lureau
These 2 tests exhibited two qmp bugs that were fixed in 2.7 (series from commit e64c75a9752c5d0fd64eb2e684c656a5ea7d03c6 to commit 1382d4abdf9619985e4078e37e49e487cea9935e) Signed-off-by: Marc-André Lureau --- tests/qmp-test.c | 38 ++ 1 file changed, 38 inser

[Qemu-devel] [PATCH 11/12] qga: process_event() simplification

2018-07-06 Thread Marc-André Lureau
Simplify the code around qmp_dispatch(): - rely on qmp_dispatch/check_obj() for message checking - have a single send_response() point - constify send_response() argument - rsp/req variable renaming for clarity Signed-off-by: Marc-André Lureau --- qga/main.c | 58 ++--

[Qemu-devel] [PATCH 10/12] tests: add a qmp success-response test

2018-07-06 Thread Marc-André Lureau
Verify the usage of this schema feature and the API behaviour. This should be the only case where qmp_dispatch() returns NULL without error. Signed-off-by: Marc-André Lureau --- tests/test-qmp-cmds.c | 17 + tests/qapi-schema/qapi-schema-test.json | 2 ++ test

[Qemu-devel] [PATCH 12/12] RFC: qmp: rework 'id' handling

2018-07-06 Thread Marc-André Lureau
Let qmp_dispatch() copy the 'id' field. That way any qmp client will conform to the specification, including QGA. Furthermore, it simplifies the work for qemu monitor. Signed-off-by: Marc-André Lureau --- monitor.c | 31 --- qapi/qmp-dispatch.c | 10

[Qemu-devel] [PATCH v4 2/8] target/mips: Workaround for checkpatch.pl hanging on msa_helper.c

2018-07-06 Thread Aleksandar Markovic
From: Aleksandar Markovic If checkpatch.pl is applied (using switch "-f") on file target/mips/msa_helper.c, it will hang. This is a workaround by correcting the source file. The workaround is found by partial deleting and undeleting of the code in msa_helper.c in binary search fashion. The bug

[Qemu-devel] [PATCH 03/12] qmp: constify qmp_is_oob()

2018-07-06 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- include/qapi/qmp/dispatch.h | 2 +- qapi/qmp-dispatch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h index 4e2e749faf..68a528a9aa 100644 --- a/include/qapi/qmp/dispatch

[Qemu-devel] [PATCH v4 5/8] target/mips: Add CP0 BadInstrX register

2018-07-06 Thread Aleksandar Markovic
From: Stefan Markovic Add CP0 BadInstrX register. This register will be used in nanoMIPS. Signed-off-by: Stefan Markovic Signed-off-by: Yongbok Kim Signed-off-by: Aleksandar Markovic Reviewed-by: Aleksandar Markovic Reviewed-by: Philippe Mathieu-Daudé --- target/mips/cpu.h | 1 + ta

Re: [Qemu-devel] [PATCH v3 5/8] target/mips: Add CP0 BadInstrX register

2018-07-06 Thread Stefan Markovic
Hi Philippe, With solved build issues caused by solution previously proposed, this would be the final fix: --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -5354,6 +5354,11 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel) case 3: CP0_C

Re: [Qemu-devel] [PULL 13/14] spice: add cursor_dmabuf support

2018-07-06 Thread Peter Maydell
On 27 April 2018 at 14:16, Peter Maydell wrote: > On 12 March 2018 at 09:14, Gerd Hoffmann wrote: >> Add support for cursor dmabufs. qemu has to render the cursor for >> that, so in case a cursor is present qemu allocates a new dmabuf, blits >> the scanout, blends in the pointer and passes on th

[Qemu-devel] [PATCH] qapi/block-core.json: Add missing documentation for blklogwrites log-append option

2018-07-06 Thread Ari Sundholm
This was accidentally omitted. Thanks to Eric Blake for spotting this. Signed-off-by: Ari Sundholm --- qapi/block-core.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index 38b3125..62a92fa 100644 --- a/qapi/block-core.json +++ b/qapi/block-

[Qemu-devel] [PATCH] block/blklogwrites: Make sure the log sector size is not too small

2018-07-06 Thread Ari Sundholm
The sector size needs to be large enough to accommodate the data structures for the log super block and log write entries. This was previously not properly checked, which made it possible to cause QEMU to badly misbehave. Signed-off-by: Ari Sundholm --- block/blklogwrites.c | 5 - 1 file cha

Re: [Qemu-devel] [PATCH] i386: Add support to get/set/migrate MSR (33H)

2018-07-06 Thread Eduardo Habkost
On Fri, Jul 06, 2018 at 11:31:38AM +0200, Paolo Bonzini wrote: > On 06/07/2018 10:43, Daniel P. Berrangé wrote: > >> Based on the Linux patch at [1], guests may try to detect the > >> feature by writing to the MSR unconditionally. > >> > >> If this happens, KVM needs to provide a mechanism to > >>

[Qemu-devel] [PATCH 01/12] tests: change /0.15/* tests to /qmp/*

2018-07-06 Thread Marc-André Lureau
Presumably 0.15 was the version it was first introduced, but qmp keeps evolving. There is no point in having that version as test prefix, 'qmp' makes more sense here. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Message-Id: <20180326150916.9602-12-marcandre.lur...@redhat.com> Reviewe

[Qemu-devel] [PATCH 02/12] monitor: consitify qmp_send_response() QDict argument

2018-07-06 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 3c9c97b73f..fc481d902d 100644 --- a/monitor.c +++ b/monitor.c @@ -504,9 +504,9 @@ int monitor_fprintf(FILE *stream, const char *fmt, ...) return

[Qemu-devel] [PATCH v4 0/8] Maintenance and misc fixes and improvements

2018-07-06 Thread Aleksandar Markovic
From: Aleksandar Markovic v3->v4: - accepted suggestion on better format of bit definitions in patch 3 - fixed build errors caused by a mistake in patch 4 - removed spurious comments in patch 4 - added setting lower 16 bits to 0 in patch 5 - used proper email address for a reviewer in

[Qemu-devel] [PATCH 00/12] RFC: monitor: various code simplification and fixes

2018-07-06 Thread Marc-André Lureau
Hi, This series is a rebased subset of "[PATCH v3 00/38] RFC: monitor: add asynchronous command type" with code cleanups and improvements that are worth to consider for 3.0. The series applies on master, and will conflict with the pending series "[PATCH 0/9] monitor: enable OOB by default" from P

[Qemu-devel] [PATCH v4 7/8] target/mips: Don't update BadVAddr register in Debug Mode

2018-07-06 Thread Aleksandar Markovic
From: Yongbok Kim BadVAddr should not be updated if (env->hflags & MIPS_HFLAG_DM) is set. Signed-off-by: Yongbok Kim Signed-off-by: Aleksandar Markovic Reviewed-by: Philippe Mathieu-Daudé --- target/mips/helper.c| 4 +++- target/mips/op_helper.c | 12 +--- 2 files changed, 12 in

[Qemu-devel] [PATCH v4 1/8] target/mips: Update maintainer's email addresses

2018-07-06 Thread Aleksandar Markovic
From: Aleksandar Markovic Update email addresses of Aleksandar Markovic and Paul Burton in the MAINTAINERS file. Also, add corresponding items in the .mailmap file. Signed-off-by: Aleksandar Markovic Reviewed-by: Philippe Mathieu-Daudé --- .mailmap| 7 +-- MAINTAINERS | 9 + 2

  1   2   3   >