Re: [Qemu-devel] [RFC 48/48] plugin: add a couple of very simple examples

2018-12-08 Thread Emilio G. Cota
On Thu, Nov 29, 2018 at 23:45:18 +0300, Roman Bolshakov wrote: > On Thu, Oct 25, 2018 at 01:20:57PM -0400, Emilio G. Cota wrote: > > + > > +lib%.so: %.o > > + $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS) > > The rule should be a bit different for macOS: > %.bundle: %.o >$(CC) -bundle

Re: [Qemu-devel] [PATCH] cpus.c: Fix race condition in cpu_stop_current()

2018-12-08 Thread Jaap Crezee
Hi all, On 12/7/18 4:59 PM, Peter Maydell wrote: > Jaap: could you test whether this patch fixes the issue you > were seeing, please? I have applied the patch and started my test tool against it. It will need some time as I have also seen cases where it only failed after 600 reboots. My

[Qemu-devel] [BUG]Unassigned mem write during pci device hot-plug

2018-12-08 Thread xuyandong
Hi all, In our test, we configured VM with several pci-bridges and a virtio-net nic been attached with bus 4, After VM is startup, We ping this nic from host to judge if it is working normally. Then, we hot add pci devices to this VM with bus 0. We found the virtio-net NIC in bus 4 is not

[Qemu-devel] [PATCH for-4.0 v7 18/27] tests/qapi: add command with condition on union argument

2018-12-08 Thread Marc-André Lureau
For completeness. Signed-off-by: Marc-André Lureau --- tests/qapi-schema/qapi-schema-test.json | 3 +++ tests/qapi-schema/qapi-schema-test.out | 6 ++ 2 files changed, 9 insertions(+) diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json index

[Qemu-devel] [PATCH for-4.0 v7 15/27] qapi: add an error in case a discriminator is conditional

2018-12-08 Thread Marc-André Lureau
Making a discriminator conditional doesn't make much sense. Instead, the union could be made conditional. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 8 tests/Makefile.include | 1 +

Re: [Qemu-devel] [PATCH v2 14/18] xen: add implementations of xen-block connect and disconnect functions...

2018-12-08 Thread Paul Durrant
> -Original Message- > From: Anthony PERARD [mailto:anthony.per...@citrix.com] > Sent: 07 December 2018 18:21 > To: Paul Durrant > Cc: qemu-devel@nongnu.org; qemu-bl...@nongnu.org; xen- > de...@lists.xenproject.org; Stefano Stabellini ; > Kevin Wolf ; Max Reitz > Subject: Re: [PATCH v2

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

2018-12-08 Thread Marc-André Lureau
Hi On Thu, Dec 6, 2018 at 7:56 PM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > 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

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

2018-12-08 Thread Marc-André Lureau
Hi On Wed, Dec 5, 2018 at 10:02 PM Markus Armbruster wrote: > > In subject, s/dictionnary/dictionary/ > > Marc-André Lureau writes: > > > 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:

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

2018-12-08 Thread Marc-André Lureau
Hi On Thu, Dec 6, 2018 at 9:42 PM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > Wrap generated enum/struct members and code with #if/#endif, using the > > enum and struct members ok > > > .ifcond members added in the previous patches. > > > > Some types generate both enum and

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

2018-12-08 Thread Marc-André Lureau
On Wed, Dec 5, 2018 at 10:41 PM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > This makes it a bit clearer what is the intent of the dictionnary for > > dictionary sigh, this must be a very common misspell (dictionnaire in french) > > > the check_type() function, since there was

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

2018-12-08 Thread Marc-André Lureau
Hi On Wed, Dec 5, 2018 at 5:19 PM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > 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

[Qemu-devel] [PATCH for-4.0 v7 25/27] qapi: break long lines at 'data' member

2018-12-08 Thread Marc-André Lureau
Let's break the line before 'data'. While at it, improve a bit indentation/spacing. (I removed some alignment which are not helping much readability and become quickly inconsistent) Suggested-by: Markus Armbruster Signed-off-by: Marc-André Lureau --- qapi/block-core.json | 13 ++--

Re: [Qemu-devel] [PATCH for-4.0 v7 00/27] Hi,

2018-12-08 Thread Marc-André Lureau
Hi, The cover letter title should be "qapi: add #if pre-processor conditions to generated code (part 2)" On Sat, Dec 8, 2018 at 3:16 PM Marc-André Lureau wrote: > > This is the second part of the "add #if pre-processor conditions to > generated code" series, adding schema member conditions

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

2018-12-08 Thread Marc-André Lureau
Hi On Thu, Dec 6, 2018 at 8:37 PM Markus Armbruster wrote: > > In the subject, s/ on / to /. > > Marc-André Lureau writes: > > > Add 'if' key to union members: > > > > { 'union': 'TestIfUnion', 'data': > > 'mem': { 'type': 'str', 'if': 'COND'} } > > > > Generated code is not changed by this

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

2018-12-08 Thread Marc-André Lureau
Hi On Thu, Dec 6, 2018 at 8:41 PM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > Add 'if' key to alternate members: > > > > { 'alternate': 'TestIfAlternate', 'data': > > { 'alt': { 'type': 'TestStruct', 'if': 'COND' } } } > > > > Generated code is not changed by this patch but

[Qemu-devel] [PATCH for-4.0 v7 23/27] qapi: add 'If:' condition to struct members documentation

2018-12-08 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 | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/doc.py

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

2018-12-08 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

[Qemu-devel] [PATCH for-4.0 v7 24/27] qapi: add condition to variants documentation

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

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

2018-12-08 Thread Marc-André Lureau
On Thu, Dec 6, 2018 at 10:14 PM Markus Armbruster wrote: > > Marc-André Lureau writes: > > > 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

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

2018-12-08 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).

[Qemu-devel] [PATCH for-4.0 v7 22/27] qapi: add 'If:' condition to enum values documentation

2018-12-08 Thread Marc-André Lureau
Use a common function to generate the "If:..." line. While at it, get rid of the existing \n\n (no idea why it was there). Use a line-break in member description, this seems to look slightly better in the plaintext version. Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py |

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

2018-12-08 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 for-4.0 v7 19/27] qapi: add 'if' to alternate members

2018-12-08 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 for-4.0 v7 20/27] tests/qapi: add command with condition on alternate argument

2018-12-08 Thread Marc-André Lureau
For completeness. Signed-off-by: Marc-André Lureau --- tests/qapi-schema/qapi-schema-test.json | 3 +++ tests/qapi-schema/qapi-schema-test.out | 6 ++ 2 files changed, 9 insertions(+) diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json index

[Qemu-devel] [PATCH for-4.0 v7 17/27] qapi: simplify make_enum_members()

2018-12-08 Thread Marc-André Lureau
The function only receives the dictionary form of enum expressions now, so we can make it shorter. Suggested-by: Markus Armbruster Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/qapi/common.py

[Qemu-devel] [PATCH for-4.0 v7 16/27] qapi: add 'if' to union members

2018-12-08 Thread Marc-André Lureau
Add 'if' key to union members: { 'union': 'TestIfUnion', 'data': 'mem': { 'type': 'str', 'if': 'COND'} } The generated code remains unconditional for now. Later patches generate the conditionals. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 17

[Qemu-devel] [PATCH for-4.0 v7 07/27] qapi: improve reporting of unknown or missing keys

2018-12-08 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 +

[Qemu-devel] [PATCH for-4.0 v7 13/27] qapi: add a dictionary form for TYPE

2018-12-08 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:

[Qemu-devel] [PATCH for-4.0 v7 12/27] qapi: rename allow_dict to allow_implicit

2018-12-08 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 for-4.0 v7 14/27] qapi: add 'if' to implicit struct members

2018-12-08 Thread Marc-André Lureau
The generated code is for now *unconditional*. Later patches generate the conditionals. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- scripts/qapi/common.py | 14 +++--- docs/devel/qapi-code-gen.txt| 10 ++

[Qemu-devel] [PATCH for-4.0 v7 09/27] qapi: add 'if' to enum members

2018-12-08 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). The generated code

[Qemu-devel] [PATCH for-4.0 v7 05/27] tests: print enum type members more like object type members

2018-12-08 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

[Qemu-devel] [PATCH for-4.0 v7 11/27] qapi: pass long form enum to make_enum_members

2018-12-08 Thread Marc-André Lureau
This will allow to get rid of short form handling in a following patch. Signed-off-by: Marc-André Lureau Suggested-by: Markus Armbruster --- scripts/qapi/common.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index

[Qemu-devel] [PATCH for-4.0 v7 10/27] qapi-events: add 'if' condition to implicit event enum

2018-12-08 Thread Marc-André Lureau
Add condition to QAPIEvent enum members based on the event 'if'. The generated code remains unconditional for now. Later patches generate the conditionals (also there is no additional coverage of this change in qapi-schema-test.out since the event_names enum is an implicit type created by

[Qemu-devel] [PATCH for-4.0 v7 03/27] qapi: rename QAPISchemaEnumType.values to .members

2018-12-08 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 Reviewed-by: Markus Armbruster --- scripts/qapi/common.py | 24

[Qemu-devel] [PATCH for-4.0 v7 08/27] qapi: add a dictionary form with 'name' key for enum members

2018-12-08 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| 49 --- tests/Makefile.include| 3 +-

[Qemu-devel] [PATCH for-4.0 v7 04/27] qapi: change enum visitor and gen_enum* to take QAPISchemaMember

2018-12-08 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. Modify gen_enum() and gen_enum_lookup() for the same reason. Suggested-by: Markus

[Qemu-devel] [PATCH for-4.0 v7 06/27] qapi: factor out checking for keys

2018-12-08 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

[Qemu-devel] [PATCH for-4.0 v7 02/27] qapi: do not define enumeration value explicitly

2018-12-08 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

[Qemu-devel] [PATCH for-4.0 v7 00/27] Hi,

2018-12-08 Thread Marc-André Lureau
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 for-4.0 v7 01/27] qapi: make sure osdep.h is included in type headers

2018-12-08 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, by checking osdep.h inclusion. The build-sys tracks the dependency and rebuilds the types if the configuration changed. Signed-off-by: Marc-André Lureau ---

Re: [Qemu-devel] [PATCH V12 0/5] add pvpanic mmio support

2018-12-08 Thread peng.hao2
>v10 --> v11 >change configure interface in virt machine configure parameters. > >v11 --> v12 >realize pvpanic as a pci device and use the mmio of pci device. > >Philippe Mathieu-Daudé (2): >hw/misc/pvpanic: Build the pvpanic device in $(common-obj) >hw/misc/pvpanic: Cosmetic renaming > >Peng Hao