If netdev_add tap,id=net0,vhost=on failed in net_init_tap_one(),
the followed up device_add virtio-net-pci,netdev=net0 will fail
too, prints:
TUNSETOFFLOAD ioctl() failed: Bad file descriptor TUNSETOFFLOAD
ioctl() failed: Bad file descriptor
The reason is that the fd of tap is closed when err
At 01/12/2018 03:23 PM, Dou Liyang wrote:
[...]
BTW, I used "make TEST_ACPI_REBUILD_AML=1 check" to create the DSDT
file. Is it correct?
This sounds correct to me. Igor, can you confirm?
It's will rebuild/update reference tables.
I'm for merging it early and tracking/fixing issue Peter s
[...]
BTW, I used "make TEST_ACPI_REBUILD_AML=1 check" to create the DSDT
file. Is it correct?
This sounds correct to me. Igor, can you confirm?
It's will rebuild/update reference tables.
I'm for merging it early and tracking/fixing issue Peter saw during this dev
cycle.
Send an ack th
> From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo
> Bonzini
> On 11/01/2018 09:27, Pavel Dovgalyuk wrote:
> > Virtual clock is wapred from iothread and vcpu thread. When the hardware
> > events associated with warp checkpoint, then interrupt delivering may be
> > non-determ
On Tue, Jan 09, 2018 at 02:52:25PM +, Stefan Hajnoczi wrote:
> On Tue, Dec 19, 2017 at 04:45:55PM +0800, Peter Xu wrote:
> > +To add OOB execution support for a command, we need to make sure the
> > +command handler satisfies at least the following:
>
> It would help to rephrase this in the im
On 01/09/2018 12:09 AM, Stefan Hajnoczi wrote:
On Mon, Jan 08, 2018 at 07:22:37PM +0800, Wei Wang wrote:
On 01/05/2018 11:49 PM, Stefan Hajnoczi wrote:
On Thu, Jan 04, 2018 at 07:15:38PM +0800, Wei Wang wrote:
On 01/04/2018 06:47 PM, Stefan Hajnoczi wrote:
On Thu, Dec 21, 2017 at 06:01:29AM -
On Tue, Jan 09, 2018 at 02:24:35PM +, Stefan Hajnoczi wrote:
> On Tue, Dec 19, 2017 at 04:45:52PM +0800, Peter Xu wrote:
> > +static void monitor_qmp_bh_responder(void *opaque)
> > +{
> > +QMPResponse response;
> > +
> > +while (true) {
> > +response = monitor_qmp_response_pop_o
On Fri, 01/12 07:23, Thomas Huth wrote:
> On 11.01.2018 21:41, no-re...@patchew.org wrote:
> > Hi,
> >
> > This series failed build test on ppc host. Please find the details below.
> [...]
> > Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
> > Submodule 'dtc' (git://git.qemu-project.org/dtc.git
On 01/11/2018 05:56 PM, Stefan Hajnoczi wrote:
On Thu, Jan 11, 2018 at 6:31 AM, Wei Wang wrote:
On 01/11/2018 12:14 AM, Stefan Hajnoczi wrote:
2) requires the driver to join the vhost-user negotiation.
The driver must participate in vhost-user negotiation. The vhost-pci
patches try to avoid
On Tue, Jan 09, 2018 at 02:08:10PM +, Stefan Hajnoczi wrote:
> On Tue, Dec 19, 2017 at 04:45:51PM +0800, Peter Xu wrote:
> > diff --git a/monitor.c b/monitor.c
> > index b571866659..505db439d8 100644
> > --- a/monitor.c
> > +++ b/monitor.c
> > @@ -1090,6 +1090,44 @@ static void qmp_caps_apply(M
On 11.01.2018 21:41, no-re...@patchew.org wrote:
> Hi,
>
> This series failed build test on ppc host. Please find the details below.
[...]
> Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
> Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
> Submodule 'pixman' (git:
On Tue, Jan 09, 2018 at 01:45:28PM +, Stefan Hajnoczi wrote:
> On Tue, Dec 19, 2017 at 04:45:50PM +0800, Peter Xu wrote:
> > We need this for earlier check for OOB, before reaching
> > do_qmp_dispatch(). Meanwhile, a small touch-up to allow "id" field,
> > after all we allow that for sure in t
> From: Paolo Bonzini [mailto:pbonz...@redhat.com]
> On 11/01/2018 14:12, Pavel Dovgalyuk wrote:
> >> From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo
> >> Bonzini
> >> On 11/01/2018 09:27, Pavel Dovgalyuk wrote:
> >>> +} else {
> >>> +qemu_notify_event()
> From: Paolo Bonzini [mailto:pbonz...@redhat.com]
> On 11/01/2018 09:25, Pavel Dovgalyuk wrote:
> > It is needed when exception_index is already set to some meaningful value.
> >
> > Signed-off-by: Pavel Dovgalyuk
> > Signed-off-by: Paolo Bonzini
> > ---
> > accel/tcg/cpu-exec.c |5 -
>
On Tue, Jan 09, 2018 at 01:20:20PM +, Stefan Hajnoczi wrote:
> On Tue, Dec 19, 2017 at 04:45:47PM +0800, Peter Xu wrote:
> > This event will be emitted if one QMP command is dropped. Along,
> > declare an enum for the reasons.
> >
> > Signed-off-by: Peter Xu
> > ---
> > qapi-schema.json | 3
On Mon, Jan 08, 2018 at 05:09:16PM +, Stefan Hajnoczi wrote:
> On Tue, Dec 19, 2017 at 04:45:46PM +0800, Peter Xu wrote:
> > Originally QMP goes throw these steps:
>
> s/throw/through/
>
> >
> > JSON Parser --> QMP Dispatcher --> Respond
> > /|\(2)(3) |
> >
The new H-Call H_GET_CPU_CHARACTERISTICS is used by the guest to query
behaviours and available characteristics of the cpu.
Implement the handler for this new H-Call which formulates its response
based on the setting of the new capabilities added in the previous
patch.
---
hw/ppc/spapr_hcall.c
Currently spapr_caps are tied to boolean values (on or off). This patch
reworks the caps so that they can have any uint8 value. This allows more
capabilities with various values to be represented in the same way
internally. Capabilities are numbered in ascending order. The internal
representation o
The following patch series reworks the implementation of spapr_caps
to allow for a increased number of possible values in the internal
representation.
It also adds 3 new tristate capabilities.
A new H-Call is implemented which a guest will use to query the
requirement for and availability of wor
This patch adds three new capabilities:
cap-cfpc -> safe_cache
cap-sbbc -> safe_bounds_check
cap-ibs -> safe_indirect_branch
Each capability is tristate with the possible values "broken",
"workaround" or "fixed". Add generic getter and setter functions for
this new capability type. Add these new
Hi Jason,
> -Original Message-
> From: Qemu-devel [mailto:qemu-devel-
> bounces+zhiyong.yang=intel@nongnu.org] On Behalf Of Jason Wang
> Sent: Friday, January 12, 2018 11:33 AM
> To: Stefan Hajnoczi
> Cc: Wang, Wei W ; qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] vhost-pci and vi
On Tue, Jan 09, 2018 at 01:42:08PM +, Stefan Hajnoczi wrote:
> On Tue, Dec 19, 2017 at 04:45:48PM +0800, Peter Xu wrote:
> > @@ -4071,6 +4073,9 @@ static void handle_qmp_command(JSONMessageParser
> > *parser, GQueue *tokens)
> > req_obj->req = req;
> > req_obj->need_resume = false;
>
On Mon, Jan 08, 2018 at 04:49:36PM +, Stefan Hajnoczi wrote:
> On Mon, Dec 25, 2017 at 11:26:13AM +0800, Peter Xu wrote:
> > On Thu, Dec 21, 2017 at 07:27:38PM +0800, Fam Zheng wrote:
> > > On Tue, 12/19 16:45, Peter Xu wrote:
> > > > One thing to mention is that for QMPs that are using IOThrea
[Expired for QEMU because there has been no activity for 60 days.]
** Changed in: qemu
Status: Incomplete => Expired
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1086782
Title:
HPET time d
On Thu, Jan 11, 2018 at 05:07:11PM -0600, Eric Blake wrote:
> On 12/19/2017 02:45 AM, Peter Xu wrote:
> > There was no QMP capabilities defined. Define the first "oob" as
>
> s/was/were/
Fixed.
Just to confirm: is "There was no QMP capability" also correct?
>
> > capability to allow out-of-ba
On Fri, Jan 12, 2018 at 01:16:22AM +1100, David Gibson wrote:
> On Fri, Jan 05, 2018 at 10:47:22PM -0200, Jose Ricardo Ziviani wrote:
> > Power9 supports 4 HW threads/core but it's possible to emulate
> > doorbells to implement virtual SMT. KVM has the KVM_CAP_PPC_SMT_POSSIBLE
> > which returns a b
On 01/11/18 20:06 +, Dr. David Alan Gilbert wrote:
> * Haozhong Zhang (haozhong.zh...@intel.com) wrote:
> > This option controls whether QEMU mmap(2) the memory backend file with
> > MAP_SYNC flag, which can fully guarantee the guest write persistence
> > to the backend, if MAP_SYNC flag is sup
On 2018年01月11日 23:23, Stefan Hajnoczi wrote:
On Thu, Jan 11, 2018 at 06:57:03PM +0800, Jason Wang wrote:
On 2018年01月11日 00:14, Stefan Hajnoczi wrote:
Hi Wei,
I wanted to summarize the differences between the vhost-pci and
virtio-vhost-user approaches because previous discussions may have bee
On Fri, Jan 05, 2018 at 05:22:26PM +, Stefan Hajnoczi wrote:
> On Tue, Dec 19, 2017 at 04:45:40PM +0800, Peter Xu wrote:
> > if (monitor_is_qmp(mon)) {
> > -qemu_chr_fe_set_handlers(&mon->chr, monitor_can_read,
> > monitor_qmp_read,
> > - monitor_qm
On Tue, Jan 09, 2018 at 05:37:39PM -0600, Eric Blake wrote:
> On 12/19/2017 02:45 AM, Peter Xu wrote:
>
> Grammar in the subject:
>
> "allow to $VERB" is not idiomatic English; correct is either "allow
> ${VERB}ing" or "allow $SUBJECT to $VERB". Concretely, s/to use/using/
>
> > For each Monito
On Wed, 01/10 08:41, Eric Blake wrote:
> On 01/10/2018 03:18 AM, Fam Zheng wrote:
> > Signed-off-by: Fam Zheng
> > ---
> > qapi/block-core.json | 16 +++-
> > 1 file changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index e9
On Wed, 01/10 08:44, Eric Blake wrote:
> On 01/10/2018 03:18 AM, Fam Zheng wrote:
> > This is a new protocol driver that exclusively opens a host NVMe
> > controller through VFIO. It achieves better latency than linux-aio by
> > completely bypassing host kernel vfs/block layer.
> >
>
> > +static
On Wed, 01/10 18:33, Stefan Hajnoczi wrote:
> > +ret = event_notifier_init(&s->irq_notifier, 0);
> > +if (ret) {
> > +error_setg(errp, "Failed to init event notifier");
> > +return ret;
>
> dma_map_lock should be destroyed.
CoMutexes are initialized by memset so I don't th
On Thu, 11 Jan 2018 09:55:36 PST (-0800), Michael Clark wrote:
On Fri, Jan 12, 2018 at 3:37 AM, Richard Henderson <
richard.hender...@linaro.org> wrote:
On 01/10/2018 06:21 PM, Michael Clark wrote:
> +static inline void cpu_get_tb_cpu_state(CPURISCVState *env,
target_ulong *pc,
> +
From: Chen Hanxiao
If we set mountpoints to qmp_guest_fsfreeze_freeze_list,
we may got nothing to freeze as all mountpoints are
not valid.
Call ga_unset_frozen in this senario.
Cc: Michael Roth
Signed-off-by: Chen Hanxiao
---
Rebase on master
qga/commands-posix.c | 6 ++
1 file changed,
Since used_memslots will be updated to the actual value after
registering memory listener for the first time, move the
memslots limit checking to the right place.
Reviewed-by: Igor Mammedov
Signed-off-by: Jay Zhou
---
hw/virtio/vhost.c | 19 ---
1 file changed, 12 insertions(+),
QEMU will assert on vhost-user backed virtio device hotplug if QEMU is
using more RAM regions than VHOST_MEMORY_MAX_NREGIONS (for example if
it were started with a lot of DIMM devices).
Fix it by returning error instead of asserting and let callers of
vhost_set_mem_table() handle error condition g
Jay Zhou (3):
vhost: remove assertion to prevent crash
vhost: fix memslot limit check
vhost: used_memslots refactoring
hw/virtio/vhost-backend.c | 15 +++-
hw/virtio/vhost-user.c| 74 +++
hw/virtio/vhost.c | 30
Used_memslots is shared by vhost kernel and user, it is equal to
dev->mem->nregions, which is correct for vhost kernel, but not for
vhost user, the latter one uses memory regions that have file
descriptor. E.g. a VM has a vhost-user NIC and 8(vhost user memslot
upper limit) memory slots, it will be
On Wed, 2018-01-10 at 15:13 +1100, David Gibson wrote:
> On Tue, Jan 09, 2018 at 08:21:01PM +1100, Suraj Jitindar Singh wrote:
> > Currently spapr_caps are tied to boolean values (on or off). This
> > patch
> > reworks the caps so that they can have any value between 0 and 127,
> > inclusive. This
On Thu, Jan 11, 2018 at 01:24:30PM +0100, Greg Kurz wrote:
> On Fri, 5 Jan 2018 14:07:29 +1100
> David Gibson wrote:
>
> > On Thu, Jan 04, 2018 at 06:47:18PM +0100, Greg Kurz wrote:
> > > On Thu, 4 Jan 2018 15:24:05 +1100
> > > David Gibson wrote:
> > >
> > > > Currently the pseries machine
On Wed, 01/10 13:09, Alex Williamson wrote:
> On Wed, 10 Jan 2018 17:18:39 +0800
> Fam Zheng wrote:
>
> > This is a library to manage the host vfio interface, which could be used
> > to implement userspace device driver code in QEMU such as NVMe or net
> > controllers.
> >
> > Signed-off-by: Fam
> -Original Message-
> From: Michael S. Tsirkin [mailto:m...@redhat.com]
> Sent: Friday, January 12, 2018 3:56 AM
> To: Zhoujian (jay)
> Cc: Igor Mammedov ; qemu-devel@nongnu.org; Huangweidong
> (C) ; wangxin (U) ;
> Gonglei (Arei) ; Liuzhe (Ahriy, Euler)
>
> Subject: Re: [PATCH v5 0/4]
On Wed, 01/10 16:52, Stefan Hajnoczi wrote:
> On Wed, Jan 10, 2018 at 05:18:39PM +0800, Fam Zheng wrote:
> > +/* Map [host, host + size) area into a contiguous IOVA address space, and
> > store
> > + * the result in @iova if not NULL. The caller need to make sure the area
> > is
> > + * aligned t
Signed-off-by: Samuel Thibault
---
Difference between v1 and v2: handle failure of put_user_u32 with goto efault;
Difference between v2 and v3: handle failure of sys_getcpu system call
---
linux-user/syscall.c | 19 +++
1 file changed, 19 insertions(+)
diff --git a/linux-user/sy
On Wed, Jan 10, 2018 at 4:52 AM, Stefan Hajnoczi wrote:
> On Tue, Jan 9, 2018 at 9:45 PM, Alistair Francis wrote:
>> Can anyone who has done this before chime in.
>>
>> What do you think about getting someone to cleanup and improve the GDB
>> support in QEMU? Would that be the right difficulty of
On 12/19/2017 02:45 AM, Peter Xu wrote:
> There was no QMP capabilities defined. Define the first "oob" as
s/was/were/
> capability to allow out-of-band messages.
>
> Also, touch up qmp-test.c to test the new bits.
>
> Signed-off-by: Peter Xu
> ---
> monitor.c| 10 --
> qapi-
On 01/11/2018 03:32 PM, Marc-André Lureau wrote:
> Suggested-by: Markus Armbruster
> Signed-off-by: Marc-André Lureau
> ---
> include/qapi/qmp/qlit.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Eric Blake
> diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/ql
Signed-off-by: Marc-André Lureau
Acked-by: Cornelia Huck
---
qapi/target.json | 6 ++
1 file changed, 6 insertions(+)
diff --git a/qapi/target.json b/qapi/target.json
index 776f2da5e1..ca463a0854 100644
--- a/qapi/target.json
+++ b/qapi/target.json
@@ -79,6 +79,9 @@
# an unknown c
The following patches are going to introduce per-target #ifdef in the
schemas.
The introspection data is statically generated once, and must thus be
built per-target to reflect target-specific configuration.
Drop "do_test_visitor_in_qmp_introspect(&qmp_schema_qlit)" since the
schema is no longer
Add a pragma that allows to tag the following expressions in the
schema with a unit name. By default, an expression has no unit name.
See the docs/devel/qapi-code-gen.txt for more details.
Signed-off-by: Marc-André Lureau
---
scripts/qapi.py| 22 +++--
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
Add #if defined(CONFIG_SPICE) in generated code, and adjust the
qmp/hmp code accordingly.
query-qmp-schema no longer reports the command/events etc as
available when disabled at compile time.
Commands made conditional:
* query-spice
Before the patch, the command for !CONFIG_SPICE is unregiste
Signed-off-by: Marc-André Lureau
---
scripts/qapi2texi.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/qapi2texi.py b/scripts/qapi
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
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.py | 17
This command is no longer needed after the schema is made conditional.
Signed-off-by: Marc-André Lureau
---
include/qapi/qmp/dispatch.h | 1 -
qapi/qmp-registry.c | 8
2 files changed, 9 deletions(-)
diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h
index 2
This will let the caller add several list of commands coming from
different schemas (the following patches split the schemas for common
and arch-specific parts).
Signed-off-by: Marc-André Lureau
---
scripts/qapi-commands.py | 2 --
monitor.c | 1 +
qga/main.c| 1
Making a discriminator conditonal doesn't make much sense. Instead,
the union could be made conditional.
Signed-off-by: Marc-André Lureau
---
scripts/qapi.py | 11 +--
tests/Makefile.include | 1 +
.../qapi-schema/
This schema is going to contain target-specific commands/events &
types, that can be conditionnally guarded with poisoned defines.
And new rules to compile the schema generated files per-target, using
the 'target' unit name filter.
This new schema is now the top-level schema to generate the
docum
Signed-off-by: Marc-André Lureau
---
qapi-schema.json | 43 ---
qapi/target.json | 45 +
monitor.c| 11 ---
target/arm/monitor.c | 2 +-
4 files changed, 46 insertions(+), 55 deletions
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.
Suggested-by: Markus Armbruster
Signed-off-by: Marc-André Lureau
---
scripts/qapi.py
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.py| 36 ++--
Add #if defined(CONFIG_VNC) in generated code, and adjust the
qmp/hmp code accordingly.
query-qmp-schema no longer reports the command/events etc as
available when disabled at compile.
Commands made conditional:
* query-vnc, query-vnc-servers, change-vnc-password
Before the patch, the command
Types & visitors are coupled and must be handled together to avoid
temporary build regression.
Wrap generated types/visitor code with #if/#endif using the
ifcond_decorator & helpers.
Signed-off-by: Marc-André Lureau
---
scripts/qapi-types.py | 18 ++
scripts/qapi-visit.py | 5 +
It depends on TARGET_PPC || TARGET_ARM || TARGET_I386 || TARGET_S390X.
Signed-off-by: Marc-André Lureau
Reviewed-by: Eduardo Habkost
Acked-by: Cornelia Huck
---
qapi-schema.json| 10 --
qapi/target.json| 12
include/sysemu/arch_init.h | 1 -
monit
The documentation is generated only once, and doesn't know C
pre-conditions. Add 'If:' sections for top-level entities.
Signed-off-by: Marc-André Lureau
---
scripts/qapi2texi.py| 23 +--
tests/qapi-schema/doc-good.json | 2 +-
tests/qapi-schema/doc-good.out | 1
Signed-off-by: Marc-André Lureau
Reviewed-by: Eduardo Habkost
Acked-by: Cornelia Huck
---
qapi-schema.json | 38 -
qapi/target.json | 39 ++
include/sysemu/arch_init.h | 3 --
Generate variants objects outside gen_object(). This will allow to
easily wrap gen_object() with ifcond_decorator in the following patch.
gen_variants_objects() calls gen_object() for each variants, so it
remains guarded for each generated variant object.
self._gen_type_cleanup(name) is factored
Signed-off-by: Marc-André Lureau
---
scripts/qapi2texi.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/qapi2texi.py b/scrip
Wrap generated code with #if/#endif using the ifcond_decorator.
Signed-off-by: Marc-André Lureau
---
scripts/qapi-event.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index dda496e824..bef301dfe9 100644
--- a/scripts/qapi-event.py
+++ b/scr
Signed-off-by: Marc-André Lureau
Acked-by: Cornelia Huck
---
qapi-schema.json| 101 ---
qapi/target.json| 104
include/sysemu/arch_init.h | 7 ---
hw/s390x/s390-skeys.c
Signed-off-by: Marc-André Lureau
---
scripts/qapi2texi.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/qapi2texi.py b/scripts/q
Skip preprocessor lines when adding indentation, since that would
likely result in invalid code.
Signed-off-by: Marc-André Lureau
---
scripts/qapi.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index ffb4fb58e0..3d33ed7d76 100644
---
The following patch is going to break list entries with #if/#endif, so
they should have the trailing ',' as suffix.
Signed-off-by: Marc-André Lureau
Reviewed-by: Markus Armbruster
---
scripts/qapi-introspect.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi-
Move rtc-reset-reinjection in target.json and make it conditional on
TARGET_I386.
Signed-off-by: Marc-André Lureau
---
qapi-schema.json | 18 --
qapi/target.json | 19 +++
hw/timer/mc146818rtc.c | 2 +-
monitor.c | 10 --
4 files
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.py
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.py | 14 +++---
tests/qapi-schema/qapi-schema-test.json | 12 +---
tests/qapi-schema/qapi-schema-tes
Modify the test visitor to check correct passing of values.
Signed-off-by: Marc-André Lureau
Reviewed-by: Markus Armbruster
---
scripts/qapi.py| 31 +--
scripts/qapi-commands.py | 2 +-
scripts/qapi-event.py |
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.py | 12 ++--
1 file changed, 6 inser
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-
Add a new option to add user-specified #include lines in the generated
headers. This will help to split a schema, where one generated header
will depend on another.
Fix some pycodestyle on the way.
Signed-off-by: Marc-André Lureau
---
scripts/qapi.py| 15 ++-
scripts/qap
Built-in objects remain unconditional. Explicitly defined objects
use the condition specified in the schema. Implicitly defined
objects inherit their condition from their users. For most of them,
there is exactly one user, so the condition to use is obvious. The
exception is the wrapped type's
The following patches are going to need similar checks from various
code path. This refactoring will report all conflicting keys (instead
of the first one encountered).
Modify unknown-expr-key to check plural form.
Signed-off-by: Marc-André Lureau
---
scripts/qapi.py | 2
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
Signed-off-by: Marc-André Lureau
Reviewed-by: Markus Armbruster
---
scripts/qapi2texi.py | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 92e2af2cd6..0a08fbaf7b 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.p
Signed-off-by: Marc-André Lureau
---
docs/devel/qapi-code-gen.txt | 38 ++
1 file changed, 38 insertions(+)
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index f58d62686a..479b755609 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/do
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.
Signed-off-by: Marc-André Lureau
---
scri
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.py| 49 ++
tests/Makefile.include |
Suggested-by: Markus Armbruster
Signed-off-by: Marc-André Lureau
---
include/qapi/qmp/qlit.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h
index b18406bce9..0c6809ef3c 100644
--- a/include/qapi/qmp/qlit.h
+++ b/include/qapi/
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
Wrap generated code with #if/#endif using the ifcond_decorator.
Signed-off-by: Marc-André Lureau
---
scripts/qapi-commands.py | 2 ++
tests/test-qmp-commands.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 669a
We commonly initialize attributes to None in .init(), then set their
real value in .check(). Accessing the attribute before .check()
yields None. If we're lucky, the code that accesses the attribute
prematurely chokes on None.
It won't for .ifcond, because None is a legitimate value.
Leave the
The generator will take (obj, condition) tuples to wrap generated QLit
objects for 'obj' with #if/#endif conditions.
This commit adds 'ifcond' condition to top-level QLit objects.
See generated tests/test-qmp-introspect.c. Example diff after this patch:
--- before 2018-01-08 11:55:24.757083
Hi
On Mon, Dec 11, 2017 at 11:36 AM, Markus Armbruster wrote:
> Marc-André Lureau writes:
>
>> Signed-off-by: Marc-André Lureau
>> ---
>> scripts/qapi.py | 15 ++-
>> tests/qapi-schema/qapi-schema-test.json | 7 ++-
>> tests/qapi-schema/qapi-schema-test
Use a common self._print_members() to print enum members details.
Signed-off-by: Marc-André Lureau
---
tests/qapi-schema/comments.out | 14 +++--
tests/qapi-schema/doc-bad-section.out| 13 +++--
tests/qapi-schema/doc-good.out | 17 +--
tests/qapi-schema/em
Replace the generated json string with a literal qobject. The later is
easier to deal with, at run time as well as compile time: adding #if
conditionals will be easier than in a json string.
Signed-off-by: Marc-André Lureau
Reviewed-by: Markus Armbruster
---
scripts/qapi-introspect.py |
Add helpers to wrap generated code with #if/#endif lines.
Add a function decorator that will be used to wrap visitor methods.
The decorator will check if code was generated before adding #if/#endif
lines. Used in the following patches.
Signed-off-by: Marc-André Lureau
---
scripts/qapi.py | 47 +
Hi
On Sat, Dec 9, 2017 at 10:07 AM, Markus Armbruster wrote:
> Marc-André Lureau writes:
>
>> Signed-off-by: Marc-André Lureau
>> ---
>> tests/Makefile.include| 2 ++
>> tests/qapi-schema/struct-if-invalid.err | 1 +
>> tests/qapi-schema/struct-if-invalid.exit | 1 +
>
Accept 'if' key in top-level elements, accepted as string or list of
string type. The following patches will modify the test visitor to
check the value is correctly saved, and generate #if/#endif code (as a
single #if/endif line or a series for a list).
Example of 'if' key:
{ 'struct': 'TestIfStru
1 - 100 of 377 matches
Mail list logo