Re: [Qemu-devel] Re: [PATCH 6/9] QError: Add qdev not found error

2009-10-17 Thread Jamie Lokier
Jamie Lokier wrote: > Paolo Bonzini wrote: > > On 10/15/2009 09:08 PM, Luiz Capitulino wrote: > > >{ "error": { "code": 12 > > > "desc": "device already open", > > > "data": { "bus": 0, "address": 12 } } } > > > > > > Note that this also can be reused by any bus, as the "

Re: [Qemu-devel] Re: [PATCH 6/9] QError: Add qdev not found error

2009-10-17 Thread Jamie Lokier
Paolo Bonzini wrote: > On 10/15/2009 09:08 PM, Luiz Capitulino wrote: > >{ "error": { "code": 12 > > "desc": "device already open", > > "data": { "bus": 0, "address": 12 } } } > > > > Note that this also can be reused by any bus, as the "data" information > >is built at e

Re: [Qemu-devel] [PATCH 6/9] QError: Add qdev not found error

2009-10-17 Thread Jamie Lokier
Anthony Liguori wrote: > holl...@linux.vnet.ibm.com wrote: > >It's hard enough to keep localized strings updated for every release > >within a single code tree. Beyond that, you expect that every *client* > >will update its localized strings for every *server* release? > > What I meant by highly s

Re: [Qemu-devel] [PATCH] User mode: Handle x86_64 vsyscall

2009-10-17 Thread Jamie Lokier
Edgar E. Iglesias wrote: > Did you consider having the linux-user loader pass a qemu version of the > x86_64 vdso to the guest through the auxvector? That version could probably > implement the vsyscalls by translating them into syscalls with x86_64 code. That seems like a good idea. Note that on

Re: [Qemu-devel] [PATCH] User mode: Handle x86_64 vsyscall

2009-10-17 Thread Jamie Lokier
Laurent Desnogues wrote: > A recent compiler (gcc 4.4.0) produces this code for a statically > compiled program: > > 005779e0 : > 5779e0: 48 83 ec 08 sub$0x8,%rsp > 5779e4: 48 c7 c0 00 04 60 ffmov$0xff600400,%rax > 5779eb: ff d0

Re: [Qemu-devel] [PATCH] User mode: Handle x86_64 vsyscall

2009-10-17 Thread Laurent Desnogues
Hi Edgar, On Sat, Oct 17, 2009 at 9:57 PM, Edgar E. Iglesias wrote: > > It feels a bit strange to have the CPU model know about linux vsyscalls. > Did you consider having the linux-user loader pass a qemu version of the > x86_64 vdso to the guest through the auxvector? That version could probably

Re: [Qemu-devel] [PATCH] User mode: Handle x86_64 vsyscall

2009-10-17 Thread Edgar E. Iglesias
On Sat, Jul 11, 2009 at 05:14:47PM +0200, Laurent Desnogues wrote: > Hello, > > the attached patch implements two of the three x86_64 vsyscall's. > Also attached is a test that demonstrates the issue and hopefully > the fix. > > Note there is a trick in there: since vsyscall functions are in hig

Re: [Qemu-devel] [Patch] Resend: linux-user/syscall.c - don't add GUEST_BASE to NULL pointer

2009-10-17 Thread Jan-Simon Möller
This patch fixes the mount call. GUEST_BASE shouldn't be added to a NULL pointer on arg5 . failing call: mount("rootfs", "/", 0x47a78, MS_MGC_VAL|MS_REMOUNT, 0x1) = -1 EFAULT (Bad address) correct call: mount("rootfs", "/", 0x37ab0, MS_MGC_VAL|MS_REMOUNT, NULL) = 0 Signed-off-by:  Jan-Sim

Re: [Qemu-devel] Re: [PATCH 01/10] Introduce qmisc module

2009-10-17 Thread Vincent Hanquez
Anthony Liguori wrote: Paolo Bonzini wrote: On 10/16/2009 11:37 PM, Anthony Liguori wrote: I already am :-) Stay tuned, I should have a patch later this afternoon. Was it a race? (Seriously, sorry I didn't notice a couple of hours ago). This one is ~5% slower than the "Evil" one, but h

Re: [Qemu-devel] [PATCH 03/11] Add a test case for qfloat

2009-10-17 Thread Anthony Liguori
Edgar E. Iglesias wrote: On Sat, Oct 17, 2009 at 08:36:03AM -0500, Anthony Liguori wrote: Signed-off-by: Anthony Liguori --- Makefile |2 + check-qfloat.c | 81 Hello Anthony, Shouldn't we put these tests under tes

Re: [Qemu-devel] [PATCH 5/7] add json encoder for qobjects

2009-10-17 Thread Anthony Liguori
Paolo Bonzini wrote: On 10/17/2009 03:03 PM, Anthony Liguori wrote: I think it makes more sense as an external entity. Maybe... I just thought of it as a toString method that happens to emit JSON. json is one representation of the monitor protocol. I think we should attempt to design thi

[Qemu-devel] Re: [PATCH] User mode: Handle x86_64 vsyscall

2009-10-17 Thread Laurent Desnogues
On Sat, Jul 11, 2009 at 5:14 PM, Laurent Desnogues wrote: > Hello, > > the attached patch implements two of the three x86_64 vsyscall's. > Also attached is a test that demonstrates the issue and hopefully > the fix. > > Note there is a trick in there:  since vsyscall functions are in high > memory

Re: [Qemu-devel] [PATCH 03/11] Add a test case for qfloat

2009-10-17 Thread Edgar E. Iglesias
On Sat, Oct 17, 2009 at 08:36:03AM -0500, Anthony Liguori wrote: > Signed-off-by: Anthony Liguori > --- > Makefile |2 + > check-qfloat.c | 81 > Hello Anthony, Shouldn't we put these tests under tests/something/ ? Cheers

Re: [Qemu-devel] [PATCH 5/7] add json encoder for qobjects

2009-10-17 Thread Paolo Bonzini
On 10/17/2009 03:03 PM, Anthony Liguori wrote: I think it makes more sense as an external entity. Maybe... I just thought of it as a toString method that happens to emit JSON. Paolo

[Qemu-devel] [PATCH 11/11] qjson: add unit test to check %p format

2009-10-17 Thread Anthony Liguori
Signed-off-by: Anthony Liguori --- check-qjson.c | 33 - 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/check-qjson.c b/check-qjson.c index 8760941..9be1448 100644 --- a/check-qjson.c +++ b/check-qjson.c @@ -551,11 +551,38 @@ START_TEST(simple_wh

[Qemu-devel] [PATCH 10/11] qjson: add vararg format for embedded qobjects

2009-10-17 Thread Anthony Liguori
%p lets you specify an already constructed qobject. It takes a weak reference. Signed-off-by: Anthony Liguori --- qjson.c | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/qjson.c b/qjson.c index 9279bfb..7bedaf3 100644 --- a/qjson.c +++ b/qjson.c

[Qemu-devel] [PATCH 09/11] qjson: add unit test for varargs bool parsing

2009-10-17 Thread Anthony Liguori
Signed-off-by: Anthony Liguori --- check-qjson.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/check-qjson.c b/check-qjson.c index 32aa33c..8760941 100644 --- a/check-qjson.c +++ b/check-qjson.c @@ -9,6 +9,7 @@ * */ #include +#include #inc

[Qemu-devel] [PATCH 05/11] Add unit test for json parser

2009-10-17 Thread Anthony Liguori
I've attempted to make this a very thorough unit test for the json parser. It covers every rule and tries to test the corner cases of each rule. There's some interesting things in this test case like a literal qobject type. It may be worth extract that into common code. Signed-off-by: Anthony L

[Qemu-devel] [PATCH 08/11] qjson: add %i for parsing bools

2009-10-17 Thread Anthony Liguori
Not a wonderful choice in conversion characters but nothing else seems better. Signed-off-by: Anthony Liguori --- qjson.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/qjson.c b/qjson.c index ce2c942..9279bfb 100644 --- a/qjson.c +++ b/qjson.c @@ -339,6 +339,12 @@

[Qemu-devel] [PATCH 06/11] qobject: add QBool type

2009-10-17 Thread Anthony Liguori
We currently model as json bool as an int. This works fine on the server side but it means we cannot send back proper bools to the client. Introducing a proper QBool type fixes that. Signed-off-by: Anthony Liguori --- Makefile |2 +- qbool.c | 76 ++

[Qemu-devel] [PATCH 07/11] qjson: Use QBool for true/false keywords

2009-10-17 Thread Anthony Liguori
Instead of parsing true/false as QInt, parse them as QBool and update the test suite accordingly. Signed-off-by: Anthony Liguori --- Makefile |2 +- check-qjson.c | 19 ++- qjson.c |5 +++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Mak

[Qemu-devel] [PATCH 04/11] Add json->qobject parser

2009-10-17 Thread Anthony Liguori
This implements a json parser that generates qobjects. The intention is that this all can be eventually moved to a shared library to form the basis of the QMP client API. Unfortunately, qobject is currently GPL licensed so hopefully Luiz will switch it to LGPL. The parser is a pretty straight fo

[Qemu-devel] [PATCH 03/11] Add a test case for qfloat

2009-10-17 Thread Anthony Liguori
Signed-off-by: Anthony Liguori --- Makefile |2 + check-qfloat.c | 81 configure |2 +- 3 files changed, 84 insertions(+), 1 deletions(-) create mode 100644 check-qfloat.c diff --git a/Makefile b/Makefile index 929463

[Qemu-devel] [PATCH 02/11] Add support for qfloat

2009-10-17 Thread Anthony Liguori
qfloat is a qobject wrapper for double precision floating points Signed-off-by: Anthony Liguori --- Makefile |3 +- qfloat.c | 76 + qfloat.h | 29 +++ qobject.h |1 + 4 files changed, 108 insertions(+

[Qemu-devel] [PATCH 0/11] json parser (v2)

2009-10-17 Thread Anthony Liguori
I fat-fingered the git send-email command the first time so here's the second iteration. This series introduces a json parsing framework. The parser is a recursive decent parser and implements the full json spec except for the null keyword. We need to decide how we want to model null in order to

[Qemu-devel] [PATCH 01/11] Add append method to qstring and empty constructor

2009-10-17 Thread Anthony Liguori
This allows qstring to be used for dynamic string construction. Signed-off-by: Anthony Liguori --- qstring.c | 37 - qstring.h |4 2 files changed, 40 insertions(+), 1 deletions(-) diff --git a/qstring.c b/qstring.c index 6d411da..441a9e6 100644 --

Re: [Qemu-devel] [PATCH 5/7] add json encoder for qobjects

2009-10-17 Thread Anthony Liguori
Paolo Bonzini wrote: The JSON encoder is just a virtual method on QObject. I think it makes more sense as an external entity. Regards, Anthony Liguori

Re: [Qemu-devel] [PATCH 4/7] add mutable qstring functions

2009-10-17 Thread Anthony Liguori
Paolo Bonzini wrote: qemu does not have a string buffer object, so I added this capability to QString. Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- check-qstring.c | 79 - qstring.c | 105

Re: [Qemu-devel] [PATCH 3/7] forward declare all QObject subclasses in qobject.h

2009-10-17 Thread Anthony Liguori
Paolo Bonzini wrote: This gives more freedom to define prototypes without dragging in the whole header files. Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- qobject.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/qobject.h b/qobject.h index 200644d..f5c78b2

Re: [Qemu-devel] [PATCH] Add chardev option to disable signal.

2009-10-17 Thread Kusanagi Kouichi
On 2009-10-16 09:04:51 -0500, Anthony Liguori wrote: > Kusanagi Kouichi wrote: > >If I am using vga and serial which is stdio and hit C-c on > >serial console, qemu terminates. That is annoying for me. > >So make it configurable whether signal is generated when C-c is hit. > > > >Signed-off-by: Kus

Re: [Qemu-devel] [PATCH 3/9] S/390 host/target build system support

2009-10-17 Thread Aurelien Jarno
On Fri, Oct 16, 2009 at 02:38:49PM +0200, Ulrich Hecht wrote: > changes to configure and makefiles for S/390 host and target support, > fixed as suggested by Juan Quintela > > adapted to most recent changes in build system Basically looks ok, but it would be worth to split it into host and target

[Qemu-devel] Re: [PATCH 2/4] rom loader: make vga+rom loading target specific

2009-10-17 Thread Juan Quintela
Gerd Hoffmann wrote: > This patch adds a loader-target.c file for target-specific > rom loading functions. The rom_add_vga() and rom_add_option() > macros are transformed into functions and sticked in there. They > load the bios on TARGET_I386 and no nothing on other targets. > > With this in pl

Re: [Qemu-devel] [PATCH 0/5] linux-user updates.

2009-10-17 Thread Edgar E. Iglesias
On Fri, Oct 16, 2009 at 05:02:26PM +0300, riku.voi...@iki.fi wrote: > From: Riku Voipio > > Long time no update... A set of relatively small patches for comment > on the list before sending a pull request. > > Max Filippov (1): > linux-user: fix ppc target_stat64 st_blocks layout > > Paul Bol

Re: [Qemu-devel] [PATCH 1/9] TCG "sync" op

2009-10-17 Thread Edgar E. Iglesias
On Fri, Oct 16, 2009 at 05:52:21PM +0200, Aurelien Jarno wrote: > On Fri, Oct 16, 2009 at 02:38:47PM +0200, Ulrich Hecht wrote: > > sync allows concurrent accesses to locations in memory through different TCG > > variables. This comes in handy when you are emulating CPU registers that can > > be us

Re: [Qemu-devel] [Patch] Resend: linux-user/syscall.c - don't add GUEST_BASE to NULL pointer

2009-10-17 Thread Riku Voipio
On Fri, Oct 16, 2009 at 11:55:45PM +0200, Jan-Simon Möller wrote: > This patch fixes the mount call. GUEST_BASE shouldn't be added to a NULL > pointer on arg5 . > failing call: > mount("rootfs", "/", 0x47a78, MS_MGC_VAL|MS_REMOUNT, 0x1) = -1 EFAULT > (Bad > address) > correct call: > mount

[Qemu-devel] Re: [PATCH 01/10] Introduce qmisc module

2009-10-17 Thread Paolo Bonzini
On 10/17/2009 03:50 AM, Anthony Liguori wrote: Paolo Bonzini wrote: On 10/16/2009 11:37 PM, Anthony Liguori wrote: I already am :-) Stay tuned, I should have a patch later this afternoon. Was it a race? (Seriously, sorry I didn't notice a couple of hours ago). This one is ~5% slower than th

[Qemu-devel] [PATCH 7/7] add formatted printing of QObjects

2009-10-17 Thread Paolo Bonzini
This patch adds a function to format a QDict according to a string that is printf like but specifies how to navigate the QDict. All parts are printed as JSON, but this is fine since this will auto-escape strings and integers print naturally. More sophisticated flags can be added later, e.g. %#{fo

[Qemu-devel] [PATCH 5/7] add json encoder for qobjects

2009-10-17 Thread Paolo Bonzini
The JSON encoder is just a virtual method on QObject. Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- Makefile |4 ++-- qdict.c | 32 qint.c| 16 qlist.c | 28 qobject.h | 10 ++ qst

[Qemu-devel] [PATCH 6/7] add testsuite for qobject json encoder

2009-10-17 Thread Paolo Bonzini
And finally, a small testsuite using check as the rest of the QObject framework. Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- Makefile |1 + check-json.c | 123 ++ configure|2 +- 3 files changed, 125 insertions(+)

[Qemu-devel] [PATCH 4/7] add mutable qstring functions

2009-10-17 Thread Paolo Bonzini
qemu does not have a string buffer object, so I added this capability to QString. Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- check-qstring.c | 79 - qstring.c | 105 +- qstring.h

[Qemu-devel] [PATCH 3/7] forward declare all QObject subclasses in qobject.h

2009-10-17 Thread Paolo Bonzini
This gives more freedom to define prototypes without dragging in the whole header files. Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- qobject.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/qobject.h b/qobject.h index 200644d..f5c78b2 100644 --- a/qobject.h

[Qemu-devel] [PATCH 2/7] allow passing NULL to qobject_type

2009-10-17 Thread Paolo Bonzini
Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- qobject.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qobject.h b/qobject.h index 4cc9287..200644d 100644 --- a/qobject.h +++ b/qobject.h @@ -102,6 +102,8 @@ static inline void qobject_decref(QObject *obj) */ s

[Qemu-devel] [PATCH 1/7] add qemu_memdup

2009-10-17 Thread Paolo Bonzini
A nice-to-have utility function, it helps avoiding useless strlen+strdup pairs. Cc: Luiz Capitulino Signed-off-by: Paolo Bonzini --- qemu-common.h |1 + qemu-malloc.c |8 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/qemu-common.h b/qemu-common.h index 820dd37.

[Qemu-devel] [PATCH 0/7] Add JSON enconding and formatted printing to QObject

2009-10-17 Thread Paolo Bonzini
This patch adds to the QObject system a method to encode JSON objects. It also adds printf-like capabilities where you can write %{a.b} in a format string and the method will walk a QDict to find the "a" first and "b" in a QDict inside that one (and then print what's found). Since QEMU does not h