Skip to contentSkip to conversation

qapi: [trivial] Break long command lines

PATCH Eric Blake 3 participants 9 messages May 1, 2014 – May 2, 2014 4 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Eric Blake

author
#2 lore raw
Quoted 9 lines · Lluís Vilanova
---
 Makefile       |   24 ++++++++++++++++++------
 tests/Makefile |   20 ++++++++++++++++----
 2 files changed, 34 insertions(+), 10 deletions(-)

Review check-tests/test-qapi.py: tests/test-qapi.py · line 375

Quoted 9 lines
(quoted diff) +5 -1
@@ -362,7 +368,13 @@ check-tests/test-qapi.py: tests/test-qapi.py
 
 .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
 $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
-	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.test.out 2>$*.test.err; echo $$? >$*.test.exit, "  TEST  $*.out")
+	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
+		$(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \
+		<$^ \
+		>$*.test.out \
+		2>$*.test.err; \

I've already made the comment several times that I would have put these three lines as one instead of excessively wrapping into three; I'm a bit surprised you haven't picked up on the hint when rebasing for other reasons. But the patch as-is is still valid, so my Reviewed-by is still okay whether or not you have a reason to spin a v11.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw
Quoted 11 lines · Eric Blake
Quoted 10 lines · Lluís Vilanova

---

Makefile       |   24 ++++++++++++++++++------
tests/Makefile |   20 ++++++++++++++++----
2 files changed, 34 insertions(+), 10 deletions(-)
(quoted diff) +0 -0
@@ -362,7 +368,13 @@ check-tests/test-qapi.py: tests/test-qapi.py
 
Quoted 14 lines

Review

Quoted 8 lines
(quoted diff) +0 -0
 .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))

$(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json

(quoted diff) +5 -1
-	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.test.out 2>$*.test.err; echo $$? >$*.test.exit, "  TEST  $*.out")
+	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
+		$(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \
+		<$^ \
+		>$*.test.out \
+		2>$*.test.err; \

I've already made the comment several times that I would have put these three lines as one instead of excessively wrapping into three; I'm a bit surprised you haven't picked up on the hint when rebasing for other reasons. But the patch as-is is still valid, so my Reviewed-by is still okay whether or not you have a reason to spin a v11.

Sorry, forgot about that one.

Lluis

Signature · 4 lines
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#5 lore raw

Re: [Qemu-devel] [PATCH v10 3/4] qapi: Use an explicit input file

Quoted 7 lines · Lluís Vilanova

Use an explicit input file on the command-line instead of reading from standard input.

It also outputs the proper file name when there's an error.

Technically, you made a non-trivial change (use of perl to sanitize SRC_PATH) in response to a comment that did not come from my review. You properly called it out in the cover letter, so I looked at this patch again; but in general, when making non-trivial changes, it's best to remove the Reviewed-by to make sure that earlier reviewers notice that they need to look again, and that they are still happy with the changes.

Fortunately, in this case, your changes still look okay, so I'm okay with leaving my Reviewed-by on this version of the patch.

Quoted 7 lines
(quoted diff) +2 -1
 		"  TEST  $*.out")
 	@diff -q $(SRC_PATH)/$*.out $*.test.out
-	@diff -q $(SRC_PATH)/$*.err $*.test.err
+	@# Sanitize error messages (make them independent of build directory)
+	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
 	@diff -q $(SRC_PATH)/$*.exit $*.test.exit
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#6 lore raw

Re: [Qemu-devel] [PATCH v10 3/4] qapi: Use an explicit input file

Quoted 19 lines · Eric Blake
Quoted 7 lines · Lluís Vilanova

Use an explicit input file on the command-line instead of reading from standard input.

It also outputs the proper file name when there's an error.

Technically, you made a non-trivial change (use of perl to sanitize SRC_PATH) in response to a comment that did not come from my review. You properly called it out in the cover letter, so I looked at this patch again; but in general, when making non-trivial changes, it's best to remove the Reviewed-by to make sure that earlier reviewers notice that they need to look again, and that they are still happy with the changes.

Fortunately, in this case, your changes still look okay, so I'm okay with leaving my Reviewed-by on this version of the patch.

Quoted 7 lines
Quoted 7 lines

" TEST $*.out")
@diff -q $(SRC_PATH)/$*.out $*.test.out

(quoted diff) +2 -1
-	@diff -q $(SRC_PATH)/$*.err $*.test.err
+	@# Sanitize error messages (make them independent of build directory)
+	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -

@diff -q $(SRC_PATH)/$*.exit $*.test.exit

Ok. Also note that I did not do the exact change proposed by Markus. I've removed the '^' from the regular expression, since "tracebacks" in error messages also contain the file path.

Lluis

Signature · 4 lines
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

A message that is not in the archive (sent off-list or not yet received): [email protected]

author Reviewed-by
#8 lore raw

Re: [Qemu-devel] [PATCH v10 4/4] qapi: Add a primitive to include other files from a QAPI schema file

Review line 2

Quoted 11 lines · Lluís Vilanova

The primitive uses JSON syntax, and include paths are relative to the file using the directive:

{ 'include': 'path/to/file.json' }

---

+++ b/tests/qapi-schema/include-after-err.json

(quoted diff) +2 -0
@@ -0,0 +1,2 @@
+{ 'include': 'include-simple-sub.json' }
+{ 'command' 'missing-colon' }

In v9, Markus pointed out that 'include-after-err' is the wrong name for this test - you are testing that an error after include is detected correctly, and not the behavior of an error after an include.

It's not a showstopper (I could live with v10 going into the tree), so:

But if you want to spin a v11, then rename the related files and the Makefile rules to run the new name. As a rename is trivially testable by 'make check' still passing, then if that's the only change you make, I'm still okay if you keep my R-b in your v11 message.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#9 lore raw

Re: [Qemu-devel] [PATCH v10 4/4] qapi: Add a primitive to include other files from a QAPI schema file

Quoted 17 lines · Eric Blake

Review line 2

Quoted 11 lines · Lluís Vilanova

The primitive uses JSON syntax, and include paths are relative to the file using the directive:

{ 'include': 'path/to/file.json' }

---

+++ b/tests/qapi-schema/include-after-err.json

(quoted diff) +2 -0
@@ -0,0 +1,2 @@
+{ 'include': 'include-simple-sub.json' }
+{ 'command' 'missing-colon' }

In v9, Markus pointed out that 'include-after-err' is the wrong name for this test - you are testing that an error after include is detected correctly, and not the behavior of an error after an include.

Quoted 8 lines

It's not a showstopper (I could live with v10 going into the tree), so:

But if you want to spin a v11, then rename the related files and the Makefile rules to run the new name. As a rename is trivially testable by 'make check' still passing, then if that's the only change you make, I'm still okay if you keep my R-b in your v11 message.

Right, I forgot to comment on this change. I did not want to change the name because right now all tests start with "include-", which makes it simple to spot them on a directory list.

Lluis

Signature · 4 lines
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth
author
#10 lore raw

Re: [Qemu-devel] [PATCH v10 4/4] qapi: Add a primitive to include other files from a QAPI schema file

Quoted 13 lines · Lluís Vilanova
Quoted 12 lines

Review line 2

Quoted 4 lines

+++ b/tests/qapi-schema/include-after-err.json

(quoted diff) +2 -0
@@ -0,0 +1,2 @@
+{ 'include': 'include-simple-sub.json' }
+{ 'command' 'missing-colon' }

In v9, Markus pointed out that 'include-after-err' is the wrong name for this test - you are testing that an error after include is detected correctly, and not the behavior of an error after an include.

It's not a showstopper (I could live with v10 going into the tree), so:

Quoted 8 lines
Quoted 4 lines

But if you want to spin a v11, then rename the related files and the Makefile rules to run the new name. As a rename is trivially testable by 'make check' still passing, then if that's the only change you make, I'm still okay if you keep my R-b in your v11 message.

Right, I forgot to comment on this change. I did not want to change the name because right now all tests start with "include-", which makes it simple to spot them on a directory list.

Then name it include-before-err.json

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#11 lore raw

Re: [Qemu-devel] [PATCH v10 4/4] qapi: Add a primitive to include other files from a QAPI schema file

Quoted 19 lines · Eric Blake
Quoted 18 lines · Lluís Vilanova
Quoted 17 lines

Review line 2

Quoted 4 lines

+++ b/tests/qapi-schema/include-after-err.json

(quoted diff) +2 -0
@@ -0,0 +1,2 @@
+{ 'include': 'include-simple-sub.json' }
+{ 'command' 'missing-colon' }

In v9, Markus pointed out that 'include-after-err' is the wrong name for this test - you are testing that an error after include is detected correctly, and not the behavior of an error after an include.

It's not a showstopper (I could live with v10 going into the tree), so:

But if you want to spin a v11, then rename the related files and the Makefile rules to run the new name. As a rename is trivially testable by 'make check' still passing, then if that's the only change you make, I'm still okay if you keep my R-b in your v11 message.

Quoted 5 lines
Quoted 3 lines

Right, I forgot to comment on this change. I did not want to change the name because right now all tests start with "include-", which makes it simple to spot them on a directory list.

Then name it include-before-err.json

Ok, then I'll resend a trivial v11 with this rename and the line breaking changes.

Lluis

Signature · 4 lines
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth
Reviewed-by
#12 lore raw

Re: [Qemu-devel] [PATCH v10 0/4] qapi: Allow modularization of QAPI schema files

In reply to a message not in the archive
Quoted 4 lines · Lluís Vilanova

Adds an include primitive to the syntax of QAPI schema files, allowing these to be modularized into multiple per-topic files in the future.

A few more things could be polished (see Eric's comments), but they can also be polished on top. Additionally, review found some atrocious error reporting in these scripts, but fixing that is clearly beyond the scope of this series.