: Monitor queue
Anthony,
The following patches have been sent to the list and look good to me. I've also tested them.
The changes (since d03703c81a202cea156811e5dbc8e88627c19986) are available in the following repository:
git://repo.or.cz/qemu/qmp-unstable.git for-anthony
Hidetoshi Seto (1):
Trivial fix for QMP/qmp-events.txt
Jan Kiszka (2):
Silence compiler warning in json test case
Fix test suite build with tracing enabled
Kusanagi Kouichi (1):
monitor: Ignore "." and ".." when completing file name.
Makefile | 12 ++++++------ QMP/qmp-events.txt | 2 +- check-qjson.c | 4 +++- monitor.c | 5 +++++ 4 files changed, 15 insertions(+), 8 deletions(-)
PATCH 1/4 Trivial fix for QMP/qmp-events.txt
From: Hidetoshi Seto <[email protected]>
Fix example of STOP event that was just copy-and-pasted.
--- QMP/qmp-events.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
QMP/qmp-events.txt +1 -1
@@ -89,7 +89,7 @@ Data: None. Example: -{ "event": "SHUTDOWN", +{ "event": "STOP", "timestamp": { "seconds": 1267041730, "microseconds": 281295 } } VNC_CONNECTED
Signature · 1 line
1.7.3.1.127.g1bb28
PATCH 2/4 Silence compiler warning in json test case
In reply to Luiz CapitulinoFrom: Jan Kiszka <[email protected]>
This avoids
error: zero-length gnu_printf format string
--- check-qjson.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
check-qjson.c +3 -1
@@ -639,7 +639,9 @@ END_TESTSTART_TEST (empty_input) { -QObject *obj =qobject_from_json ("" ); +const char *empty ="" ; + +QObject *obj =qobject_from_json (empty);fail_unless (obj ==NULL ); }END_TEST
Signature · 1 line
1.7.3.1.127.g1bb28
Re: [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case
Quoted 17 lines · Luiz Capitulino
From: Jan Kiszka <[email protected]>
This avoids
error: zero-length
gnu_printfformat stringSigned-off-by Jan Kiszka <[email protected]>Signed-off-by Luiz Capitulino <[email protected]>--- check-qjson.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)check-qjson.c +0
-0
check-qjson.c END_TEST · line 647
Quoted 10 lines
check-qjson.c +3
-1@@ -639,7 +639,9 @@ END_TESTSTART_TEST (empty_input) { -QObject *obj =qobject_from_json ("" ); +const char *empty ="" ; + +QObject *obj =qobject_from_json (empty);fail_unless (obj ==NULL ); }END_TEST
The warning is silly. Printing nothing is unlikely to happen unintentionally, and is perfectly well-defined and portable.
Why make the code ugly to avoid a useless warning, when we can disable the warning?
Re: [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case
Quoted 33 lines · On Fri, 22 Oct 2010 19:15:07 +0200 Markus Armbruster <[email protected]> wrote:
Quoted 17 lines · Luiz Capitulino
From: Jan Kiszka <[email protected]>
This avoids
error: zero-length
gnu_printfformat stringSigned-off-by Jan Kiszka <[email protected]>Signed-off-by Luiz Capitulino <[email protected]>--- check-qjson.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)check-qjson.c +0
-0check-qjson.c END_TEST · line 647
Quoted 10 lines
check-qjson.c +3
-1@@ -639,7 +639,9 @@ END_TESTSTART_TEST (empty_input) { -QObject *obj =qobject_from_json ("" ); +const char *empty ="" ; + +QObject *obj =qobject_from_json (empty);fail_unless (obj ==NULL ); }END_TEST The warning is silly. Printing nothing is unlikely to happen unintentionally, and is perfectly well-defined and portable.
Quoted 2 lines
Why make the code ugly to avoid a useless warning, when we can disable the warning?
You mean, disable it only for this specific case or QEMU wide?
If it's the former, please, submit a patch. Otherwise, this has been discussed already and the conclusion was that the warning is useful:
http://www.mail-archive.com/[email protected]/msg44072.html
Honestly speaking, no matter what the conclusion is, what can not happen is having code that doesn't compile in the tree. Either: we apply this patch or revert the patch that broke the build.
Re: [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case
Am 22.10.2010 19:33, schrieb Luiz Capitulino:
Quoted 47 lines
Quoted 34 lines · On Fri, 22 Oct 2010 19:15:07 +0200 Markus Armbruster<[email protected]> wrote:
Quoted 18 lines · Luiz Capitulino
From: Jan Kiszka<[email protected]>
This avoids
error: zero-length
gnu_printfformat stringSigned-off-by Jan Kiszka<[email protected]>Signed-off-by Luiz Capitulino<[email protected]>--- check-qjson.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)check-qjson.c +0
-0check-qjson.c END_TEST · line 647
Quoted 10 lines
check-qjson.c +3
-1@@ -639,7 +639,9 @@ END_TESTSTART_TEST (empty_input) { -QObject *obj =qobject_from_json ("" ); +const char *empty ="" ; + +QObject *obj =qobject_from_json (empty);fail_unless (obj ==NULL ); }END_TEST The warning is silly. Printing nothing is unlikely to happen unintentionally, and is perfectly well-defined and portable.
Quoted 3 lines
Why make the code ugly to avoid a useless warning, when we can disable the warning?
You mean, disable it only for this specific case or QEMU wide?
If it's the former, please, submit a patch. Otherwise, this has been discussed already and the conclusion was that the warning is useful:
Quoted 6 lines
http://www.mail-archive.com/[email protected]/msg44072.html
Honestly speaking, no matter what the conclusion is, what can not happen is having code that doesn't compile in the tree. Either: we apply this patch or revert the patch that broke the build.
If needed, commit 8b7968f7c4ac8c07cad6a1a0891d38cf239a2839 can be reverted partially (only for qjson.h).
Tell me if you would prefer that solution, then I can send a patch.
Re: [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case
Quoted 56 lines · On Fri, 22 Oct 2010 22:49:10 +0200 Stefan Weil <[email protected]> wrote:
Am 22.10.2010 19:33, schrieb Luiz Capitulino:
Quoted 47 lines
Quoted 34 lines · On Fri, 22 Oct 2010 19:15:07 +0200 Markus Armbruster<[email protected]> wrote:
Quoted 18 lines · Luiz Capitulino
From: Jan Kiszka<[email protected]>
This avoids
error: zero-length
gnu_printfformat stringSigned-off-by Jan Kiszka<[email protected]>Signed-off-by Luiz Capitulino<[email protected]>--- check-qjson.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)check-qjson.c +0
-0check-qjson.c END_TEST · line 647
Quoted 10 lines
check-qjson.c +3
-1@@ -639,7 +639,9 @@ END_TESTSTART_TEST (empty_input) { -QObject *obj =qobject_from_json ("" ); +const char *empty ="" ; + +QObject *obj =qobject_from_json (empty);fail_unless (obj ==NULL ); }END_TEST The warning is silly. Printing nothing is unlikely to happen unintentionally, and is perfectly well-defined and portable.
Quoted 3 lines
Why make the code ugly to avoid a useless warning, when we can disable the warning?
You mean, disable it only for this specific case or QEMU wide?
If it's the former, please, submit a patch. Otherwise, this has been discussed already and the conclusion was that the warning is useful:
Quoted 6 lines
http://www.mail-archive.com/[email protected]/msg44072.html
Honestly speaking, no matter what the conclusion is, what can not happen is having code that doesn't compile in the tree. Either: we apply this patch or revert the patch that broke the build.
Quoted 4 lines
If needed, commit
8b7968f7c4ac8c07cad6a1a0891d38cf239a2839can be reverted partially (only forqjson.h).Tell me if you would prefer that solution, then I can send a patch.
Well, the warning seems useful to me. It's the error checking test suite that's triggering it.
Jan's fix looks file to me.
PATCH 3/4 Fix test suite build with tracing enabled
In reply to Luiz CapitulinoFrom: Jan Kiszka <[email protected]>
qemu_malloc instrumentations require linking against the trace objects.
--- Makefile | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
Makefile +6 -6
@@ -140,12 +140,12 @@ qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx check-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o: $(GENERATED_HEADERS) -check-qint: check-qint.o qint.o qemu-malloc.o -check-qstring: check-qstring.o qstring.o qemu-malloc.o -check-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qemu-malloc.o qlist.o -check-qlist: check-qlist.o qlist.o qint.o qemu-malloc.o -check-qfloat: check-qfloat.o qfloat.o qemu-malloc.o -check-qjson: check-qjson.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o qjson.o json-streamer.o json-lexer.o json-parser.o qemu-malloc.o +check-qint: check-qint.o qint.o qemu-malloc.o $(trace-obj-y) +check-qstring: check-qstring.o qstring.o qemu-malloc.o $(trace-obj-y) +check-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qemu-malloc.o qlist.o $(trace-obj-y) +check-qlist: check-qlist.o qlist.o qint.o qemu-malloc.o $(trace-obj-y) +check-qfloat: check-qfloat.o qfloat.o qemu-malloc.o $(trace-obj-y) +check-qjson: check-qjson.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o qjson.o json-streamer.o json-lexer.o json-parser.o qemu-malloc.o $(trace-obj-y) clean: # avoid old build problems by removing potentially incorrect old files
Signature · 1 line
1.7.3.1.127.g1bb28
PATCH 4/4 monitor: Ignore "." and ".." when completing file name.
In reply to Luiz CapitulinoFrom: Kusanagi Kouichi <[email protected]>
--- monitor.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
monitor.c +5 -0
@@ -3976,6 +3976,11 @@ static void file_completion(const char *input) d =readdir (ffs);if (!d)break ; + +if (strcmp (d->d_name,"." ) ==0 ||strcmp (d->d_name,".." ) ==0 ) { +continue ; + } +if (strstart (d->d_name, file_prefix,NULL )) {memcpy (file, input, input_path_len);if (input_path_len <sizeof (file))
Signature · 1 line
1.7.3.1.127.g1bb28