Re: [Qemu-devel] [PATCH v2 27/29] qapi: Move qapi-schema.json to qapi/, rename generated files

2018-02-23 Thread Markus Armbruster
Eric Blake  writes:

> On 02/11/2018 03:36 AM, Markus Armbruster wrote:
>> Move qapi-schema.json to qapi/, so it's next to its modules, and all
>> files get generated to qapi/, not just the ones generated for modules.
>>
>> Consistently name the generated files qapi-MODULE.EXT:
>> qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become
>> qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch].
>> This gets rid of the temporary hacks in scripts/qapi/commands.py and
>> scripts/qapi/events.py.
>
> Ah, so my parallel series that proposed naming the file
> qapi/qmp-schema.qapi gets interesting, with your patch favoring the
> qapi- naming everywhere.  I'll have to think about how much (or
> little) of my series to rebase on top of this (I like my notion of
> renaming to the .qapi suffix, though, as we really are using files
> that aren't JSON, but only resemble it).
>
>>
>> Signed-off-by: Markus Armbruster 
>> ---
>
>> +++ b/.gitignore
>> @@ -29,8 +29,8 @@
>>   /qga/qapi-generated
>>   /qapi-generated
>>   /qapi-gen-timestamp
>> -/qapi-builtin-types.[ch]
>> -/qapi-builtin-visit.[ch]
>> +/qapi/qapi-builtin-types.[ch]
>> +/qapi/qapi-builtin-visit.[ch]
>
> Might be some interesting churn if you like my idea of using globs for
> easier maintenance of this file.
>
>> +++ b/tpm.c
>> @@ -182,7 +182,6 @@ int tpm_config_parse(QemuOptsList *opts_list, const char 
>> *optarg)
>> /*
>>* Walk the list of active TPM backends and collect information about them
>> - * following the schema description in qapi-schema.json.
>>*/
>
> Should the overall comment keep the trailing '.'?

I'm fine either way.

> Reviewed-by: Eric Blake 

Thanks!



Re: [Qemu-devel] [PATCH v2 27/29] qapi: Move qapi-schema.json to qapi/, rename generated files

2018-02-19 Thread Michael Roth
Quoting Markus Armbruster (2018-02-11 03:36:05)
> Move qapi-schema.json to qapi/, so it's next to its modules, and all
> files get generated to qapi/, not just the ones generated for modules.
> 
> Consistently name the generated files qapi-MODULE.EXT:
> qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become
> qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch].
> This gets rid of the temporary hacks in scripts/qapi/commands.py and
> scripts/qapi/events.py.
> 
> Signed-off-by: Markus Armbruster 

Reviewed-by: Michael Roth 

> ---
>  .gitignore| 16 ++--
>  Makefile  | 42 
> +++
>  Makefile.objs | 21 
>  backends/hostmem.c|  2 +-
>  docs/devel/qapi-code-gen.txt  | 30 +++---
>  docs/devel/writing-qmp-commands.txt   |  2 +-
>  docs/interop/qmp-intro.txt|  2 +-
>  hmp.c |  2 +-
>  include/qapi/qmp/qobject.h|  2 +-
>  include/qapi/visitor.h|  2 +-
>  include/qom/object.h  |  2 +-
>  monitor.c |  6 ++---
>  net/filter-buffer.c   |  2 +-
>  qapi/misc.json|  4 +--
>  qapi-schema.json => qapi/qapi-schema.json | 32 +++
>  qga/Makefile.objs |  2 +-
>  qga/commands-posix.c  |  2 +-
>  qga/commands-win32.c  |  2 +-
>  qga/commands.c|  2 +-
>  qga/main.c|  2 +-
>  qom/object.c  |  2 +-
>  scripts/qapi/commands.py  |  7 --
>  scripts/qapi/events.py|  9 +--
>  scripts/qapi/introspect.py|  4 +--
>  scripts/qapi/types.py |  6 ++---
>  scripts/qapi/visit.py |  6 ++---
>  tests/.gitignore  |  6 ++---
>  tests/Makefile.include| 14 +--
>  tests/test-qmp-cmds.c |  2 +-
>  tests/test-qmp-event.c|  2 +-
>  tests/test-qobject-input-visitor.c|  6 ++---
>  tpm.c |  1 -
>  ui/cocoa.m|  2 +-
>  ui/vnc.c  |  2 +-
>  34 files changed, 116 insertions(+), 130 deletions(-)
>  rename qapi-schema.json => qapi/qapi-schema.json (85%)
> 
> diff --git a/.gitignore b/.gitignore
> index 7f162e862f..dabfe6bea8 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -29,8 +29,8 @@
>  /qga/qapi-generated
>  /qapi-generated
>  /qapi-gen-timestamp
> -/qapi-builtin-types.[ch]
> -/qapi-builtin-visit.[ch]
> +/qapi/qapi-builtin-types.[ch]
> +/qapi/qapi-builtin-visit.[ch]
>  /qapi/qapi-commands-block-core.[ch]
>  /qapi/qapi-commands-block.[ch]
>  /qapi/qapi-commands-char.[ch]
> @@ -47,6 +47,7 @@
>  /qapi/qapi-commands-trace.[ch]
>  /qapi/qapi-commands-transaction.[ch]
>  /qapi/qapi-commands-ui.[ch]
> +/qapi/qapi-commands.[ch]
>  /qapi/qapi-events-block-core.[ch]
>  /qapi/qapi-events-block.[ch]
>  /qapi/qapi-events-char.[ch]
> @@ -63,6 +64,8 @@
>  /qapi/qapi-events-trace.[ch]
>  /qapi/qapi-events-transaction.[ch]
>  /qapi/qapi-events-ui.[ch]
> +/qapi/qapi-events.[ch]
> +/qapi/qapi-introspect.[ch]
>  /qapi/qapi-types-block-core.[ch]
>  /qapi/qapi-types-block.[ch]
>  /qapi/qapi-types-char.[ch]
> @@ -79,7 +82,7 @@
>  /qapi/qapi-types-trace.[ch]
>  /qapi/qapi-types-transaction.[ch]
>  /qapi/qapi-types-ui.[ch]
> -/qapi-types.[ch]
> +/qapi/qapi-types.[ch]
>  /qapi/qapi-visit-block-core.[ch]
>  /qapi/qapi-visit-block.[ch]
>  /qapi/qapi-visit-char.[ch]
> @@ -96,11 +99,8 @@
>  /qapi/qapi-visit-trace.[ch]
>  /qapi/qapi-visit-transaction.[ch]
>  /qapi/qapi-visit-ui.[ch]
> -/qapi-visit.[ch]
> -/qapi-event.[ch]
> -/qapi-doc.texi
> -/qmp-commands.[ch]
> -/qmp-introspect.[ch]
> +/qapi/qapi-visit.[ch]
> +/qapi/qapi-doc.texi
>  /qemu-doc.html
>  /qemu-doc.info
>  /qemu-doc.txt
> diff --git a/Makefile b/Makefile
> index 50eb194877..84411ee6ab 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -90,8 +90,8 @@ endif
>  include $(SRC_PATH)/rules.mak
> 
>  GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
> -GENERATED_FILES += qapi-builtin-types.h qapi-builtin-types.c
> -GENERATED_FILES += qapi-types.h qapi-types.c
> +GENERATED_FILES += qapi/qapi-builtin-types.h qapi/qapi-builtin-types.c
> +GENERATED_FILES += qapi/qapi-types.h qapi/qapi-types.c
>  GENERATED_FILES += qapi/qapi-types-block-core.h qapi/qapi-types-block-core.c
>  GENERATED_FILES += qapi/qapi-types-block.h qapi/qapi-types-block.c
>  GENERATED_FILES += qapi/qapi-types-char.h qapi/qapi-types-char.c
> @@ -108,8 +108,8 @@ GENERATED_FILES += qapi/qapi-types-tpm.h 
> qapi/qapi-types-tpm.c
>  

Re: [Qemu-devel] [PATCH v2 27/29] qapi: Move qapi-schema.json to qapi/, rename generated files

2018-02-13 Thread Marc-Andre Lureau
On Sun, Feb 11, 2018 at 10:36 AM, Markus Armbruster  wrote:
> Move qapi-schema.json to qapi/, so it's next to its modules, and all
> files get generated to qapi/, not just the ones generated for modules.
>
> Consistently name the generated files qapi-MODULE.EXT:
> qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become
> qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch].
> This gets rid of the temporary hacks in scripts/qapi/commands.py and
> scripts/qapi/events.py.
>
> Signed-off-by: Markus Armbruster 


Reviewed-by: Marc-André Lureau 


> ---
>  .gitignore| 16 ++--
>  Makefile  | 42 
> +++
>  Makefile.objs | 21 
>  backends/hostmem.c|  2 +-
>  docs/devel/qapi-code-gen.txt  | 30 +++---
>  docs/devel/writing-qmp-commands.txt   |  2 +-
>  docs/interop/qmp-intro.txt|  2 +-
>  hmp.c |  2 +-
>  include/qapi/qmp/qobject.h|  2 +-
>  include/qapi/visitor.h|  2 +-
>  include/qom/object.h  |  2 +-
>  monitor.c |  6 ++---
>  net/filter-buffer.c   |  2 +-
>  qapi/misc.json|  4 +--
>  qapi-schema.json => qapi/qapi-schema.json | 32 +++
>  qga/Makefile.objs |  2 +-
>  qga/commands-posix.c  |  2 +-
>  qga/commands-win32.c  |  2 +-
>  qga/commands.c|  2 +-
>  qga/main.c|  2 +-
>  qom/object.c  |  2 +-
>  scripts/qapi/commands.py  |  7 --
>  scripts/qapi/events.py|  9 +--
>  scripts/qapi/introspect.py|  4 +--
>  scripts/qapi/types.py |  6 ++---
>  scripts/qapi/visit.py |  6 ++---
>  tests/.gitignore  |  6 ++---
>  tests/Makefile.include| 14 +--
>  tests/test-qmp-cmds.c |  2 +-
>  tests/test-qmp-event.c|  2 +-
>  tests/test-qobject-input-visitor.c|  6 ++---
>  tpm.c |  1 -
>  ui/cocoa.m|  2 +-
>  ui/vnc.c  |  2 +-
>  34 files changed, 116 insertions(+), 130 deletions(-)
>  rename qapi-schema.json => qapi/qapi-schema.json (85%)
>
> diff --git a/.gitignore b/.gitignore
> index 7f162e862f..dabfe6bea8 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -29,8 +29,8 @@
>  /qga/qapi-generated
>  /qapi-generated
>  /qapi-gen-timestamp
> -/qapi-builtin-types.[ch]
> -/qapi-builtin-visit.[ch]
> +/qapi/qapi-builtin-types.[ch]
> +/qapi/qapi-builtin-visit.[ch]
>  /qapi/qapi-commands-block-core.[ch]
>  /qapi/qapi-commands-block.[ch]
>  /qapi/qapi-commands-char.[ch]
> @@ -47,6 +47,7 @@
>  /qapi/qapi-commands-trace.[ch]
>  /qapi/qapi-commands-transaction.[ch]
>  /qapi/qapi-commands-ui.[ch]
> +/qapi/qapi-commands.[ch]
>  /qapi/qapi-events-block-core.[ch]
>  /qapi/qapi-events-block.[ch]
>  /qapi/qapi-events-char.[ch]
> @@ -63,6 +64,8 @@
>  /qapi/qapi-events-trace.[ch]
>  /qapi/qapi-events-transaction.[ch]
>  /qapi/qapi-events-ui.[ch]
> +/qapi/qapi-events.[ch]
> +/qapi/qapi-introspect.[ch]
>  /qapi/qapi-types-block-core.[ch]
>  /qapi/qapi-types-block.[ch]
>  /qapi/qapi-types-char.[ch]
> @@ -79,7 +82,7 @@
>  /qapi/qapi-types-trace.[ch]
>  /qapi/qapi-types-transaction.[ch]
>  /qapi/qapi-types-ui.[ch]
> -/qapi-types.[ch]
> +/qapi/qapi-types.[ch]
>  /qapi/qapi-visit-block-core.[ch]
>  /qapi/qapi-visit-block.[ch]
>  /qapi/qapi-visit-char.[ch]
> @@ -96,11 +99,8 @@
>  /qapi/qapi-visit-trace.[ch]
>  /qapi/qapi-visit-transaction.[ch]
>  /qapi/qapi-visit-ui.[ch]
> -/qapi-visit.[ch]
> -/qapi-event.[ch]
> -/qapi-doc.texi
> -/qmp-commands.[ch]
> -/qmp-introspect.[ch]
> +/qapi/qapi-visit.[ch]
> +/qapi/qapi-doc.texi
>  /qemu-doc.html
>  /qemu-doc.info
>  /qemu-doc.txt
> diff --git a/Makefile b/Makefile
> index 50eb194877..84411ee6ab 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -90,8 +90,8 @@ endif
>  include $(SRC_PATH)/rules.mak
>
>  GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
> -GENERATED_FILES += qapi-builtin-types.h qapi-builtin-types.c
> -GENERATED_FILES += qapi-types.h qapi-types.c
> +GENERATED_FILES += qapi/qapi-builtin-types.h qapi/qapi-builtin-types.c
> +GENERATED_FILES += qapi/qapi-types.h qapi/qapi-types.c
>  GENERATED_FILES += qapi/qapi-types-block-core.h qapi/qapi-types-block-core.c
>  GENERATED_FILES += qapi/qapi-types-block.h qapi/qapi-types-block.c
>  GENERATED_FILES += qapi/qapi-types-char.h qapi/qapi-types-char.c
> @@ -108,8 +108,8 @@ GENERATED_FILES += qapi/qapi-types-tpm.h 
> 

Re: [Qemu-devel] [PATCH v2 27/29] qapi: Move qapi-schema.json to qapi/, rename generated files

2018-02-12 Thread Eric Blake

On 02/11/2018 03:36 AM, Markus Armbruster wrote:

Move qapi-schema.json to qapi/, so it's next to its modules, and all
files get generated to qapi/, not just the ones generated for modules.

Consistently name the generated files qapi-MODULE.EXT:
qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become
qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch].
This gets rid of the temporary hacks in scripts/qapi/commands.py and
scripts/qapi/events.py.


Ah, so my parallel series that proposed naming the file 
qapi/qmp-schema.qapi gets interesting, with your patch favoring the 
qapi- naming everywhere.  I'll have to think about how much (or little) 
of my series to rebase on top of this (I like my notion of renaming to 
the .qapi suffix, though, as we really are using files that aren't JSON, 
but only resemble it).




Signed-off-by: Markus Armbruster 
---



+++ b/.gitignore
@@ -29,8 +29,8 @@
  /qga/qapi-generated
  /qapi-generated
  /qapi-gen-timestamp
-/qapi-builtin-types.[ch]
-/qapi-builtin-visit.[ch]
+/qapi/qapi-builtin-types.[ch]
+/qapi/qapi-builtin-visit.[ch]


Might be some interesting churn if you like my idea of using globs for 
easier maintenance of this file.



+++ b/tpm.c
@@ -182,7 +182,6 @@ int tpm_config_parse(QemuOptsList *opts_list, const char 
*optarg)
  
  /*

   * Walk the list of active TPM backends and collect information about them
- * following the schema description in qapi-schema.json.
   */


Should the overall comment keep the trailing '.'?

Reviewed-by: Eric Blake 

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



[Qemu-devel] [PATCH v2 27/29] qapi: Move qapi-schema.json to qapi/, rename generated files

2018-02-11 Thread Markus Armbruster
Move qapi-schema.json to qapi/, so it's next to its modules, and all
files get generated to qapi/, not just the ones generated for modules.

Consistently name the generated files qapi-MODULE.EXT:
qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become
qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch].
This gets rid of the temporary hacks in scripts/qapi/commands.py and
scripts/qapi/events.py.

Signed-off-by: Markus Armbruster 
---
 .gitignore| 16 ++--
 Makefile  | 42 +++
 Makefile.objs | 21 
 backends/hostmem.c|  2 +-
 docs/devel/qapi-code-gen.txt  | 30 +++---
 docs/devel/writing-qmp-commands.txt   |  2 +-
 docs/interop/qmp-intro.txt|  2 +-
 hmp.c |  2 +-
 include/qapi/qmp/qobject.h|  2 +-
 include/qapi/visitor.h|  2 +-
 include/qom/object.h  |  2 +-
 monitor.c |  6 ++---
 net/filter-buffer.c   |  2 +-
 qapi/misc.json|  4 +--
 qapi-schema.json => qapi/qapi-schema.json | 32 +++
 qga/Makefile.objs |  2 +-
 qga/commands-posix.c  |  2 +-
 qga/commands-win32.c  |  2 +-
 qga/commands.c|  2 +-
 qga/main.c|  2 +-
 qom/object.c  |  2 +-
 scripts/qapi/commands.py  |  7 --
 scripts/qapi/events.py|  9 +--
 scripts/qapi/introspect.py|  4 +--
 scripts/qapi/types.py |  6 ++---
 scripts/qapi/visit.py |  6 ++---
 tests/.gitignore  |  6 ++---
 tests/Makefile.include| 14 +--
 tests/test-qmp-cmds.c |  2 +-
 tests/test-qmp-event.c|  2 +-
 tests/test-qobject-input-visitor.c|  6 ++---
 tpm.c |  1 -
 ui/cocoa.m|  2 +-
 ui/vnc.c  |  2 +-
 34 files changed, 116 insertions(+), 130 deletions(-)
 rename qapi-schema.json => qapi/qapi-schema.json (85%)

diff --git a/.gitignore b/.gitignore
index 7f162e862f..dabfe6bea8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,8 +29,8 @@
 /qga/qapi-generated
 /qapi-generated
 /qapi-gen-timestamp
-/qapi-builtin-types.[ch]
-/qapi-builtin-visit.[ch]
+/qapi/qapi-builtin-types.[ch]
+/qapi/qapi-builtin-visit.[ch]
 /qapi/qapi-commands-block-core.[ch]
 /qapi/qapi-commands-block.[ch]
 /qapi/qapi-commands-char.[ch]
@@ -47,6 +47,7 @@
 /qapi/qapi-commands-trace.[ch]
 /qapi/qapi-commands-transaction.[ch]
 /qapi/qapi-commands-ui.[ch]
+/qapi/qapi-commands.[ch]
 /qapi/qapi-events-block-core.[ch]
 /qapi/qapi-events-block.[ch]
 /qapi/qapi-events-char.[ch]
@@ -63,6 +64,8 @@
 /qapi/qapi-events-trace.[ch]
 /qapi/qapi-events-transaction.[ch]
 /qapi/qapi-events-ui.[ch]
+/qapi/qapi-events.[ch]
+/qapi/qapi-introspect.[ch]
 /qapi/qapi-types-block-core.[ch]
 /qapi/qapi-types-block.[ch]
 /qapi/qapi-types-char.[ch]
@@ -79,7 +82,7 @@
 /qapi/qapi-types-trace.[ch]
 /qapi/qapi-types-transaction.[ch]
 /qapi/qapi-types-ui.[ch]
-/qapi-types.[ch]
+/qapi/qapi-types.[ch]
 /qapi/qapi-visit-block-core.[ch]
 /qapi/qapi-visit-block.[ch]
 /qapi/qapi-visit-char.[ch]
@@ -96,11 +99,8 @@
 /qapi/qapi-visit-trace.[ch]
 /qapi/qapi-visit-transaction.[ch]
 /qapi/qapi-visit-ui.[ch]
-/qapi-visit.[ch]
-/qapi-event.[ch]
-/qapi-doc.texi
-/qmp-commands.[ch]
-/qmp-introspect.[ch]
+/qapi/qapi-visit.[ch]
+/qapi/qapi-doc.texi
 /qemu-doc.html
 /qemu-doc.info
 /qemu-doc.txt
diff --git a/Makefile b/Makefile
index 50eb194877..84411ee6ab 100644
--- a/Makefile
+++ b/Makefile
@@ -90,8 +90,8 @@ endif
 include $(SRC_PATH)/rules.mak
 
 GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
-GENERATED_FILES += qapi-builtin-types.h qapi-builtin-types.c
-GENERATED_FILES += qapi-types.h qapi-types.c
+GENERATED_FILES += qapi/qapi-builtin-types.h qapi/qapi-builtin-types.c
+GENERATED_FILES += qapi/qapi-types.h qapi/qapi-types.c
 GENERATED_FILES += qapi/qapi-types-block-core.h qapi/qapi-types-block-core.c
 GENERATED_FILES += qapi/qapi-types-block.h qapi/qapi-types-block.c
 GENERATED_FILES += qapi/qapi-types-char.h qapi/qapi-types-char.c
@@ -108,8 +108,8 @@ GENERATED_FILES += qapi/qapi-types-tpm.h 
qapi/qapi-types-tpm.c
 GENERATED_FILES += qapi/qapi-types-trace.h qapi/qapi-types-trace.c
 GENERATED_FILES += qapi/qapi-types-transaction.h qapi/qapi-types-transaction.c
 GENERATED_FILES += qapi/qapi-types-ui.h qapi/qapi-types-ui.c
-GENERATED_FILES += qapi-builtin-visit.h qapi-builtin-visit.c
-GENERATED_FILES += qapi-visit.h qapi-visit.c
+GENERATED_FILES +=