[Qemu-devel] [PATCH 03/10] QString: Introduce qstring_append_int()

2009-11-17 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qstring.c |8 qstring.h |2 ++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/qstring.c b/qstring.c index e422bd9..ad17769 100644 --- a/qstring.c +++ b/qstring.c @@ -75,6 +75,14 @@ void qstring_append

[Qemu-devel] [PATCH 04/10] QString: Introduce qstring_from_substr()

2009-11-17 Thread Luiz Capitulino
Note that we can now write qstring_from_str() as a wrapper. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qstring.c | 20 +++- qstring.h |1 + 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/qstring.c b/qstring.c index ad17769..740a106 100644

[Qemu-devel] [PATCH 05/10] utests: Add qstring_append_chr() unit-test

2009-11-17 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- check-qstring.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/check-qstring.c b/check-qstring.c index ea4dfd0..412038a 100644 --- a/check-qstring.c +++ b/check-qstring.c @@ -55,6 +55,22

[Qemu-devel] [PATCH 06/10] utests: Add qstring_from_substr() unit-test

2009-11-17 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- check-qstring.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/check-qstring.c b/check-qstring.c index 412038a..c308a63 100644 --- a/check-qstring.c +++ b/check-qstring.c @@ -71,6 +71,19

[Qemu-devel] [PATCH 07/10] Introduce QError

2009-11-17 Thread Luiz Capitulino
-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |2 +- qerror.c | 265 + qerror.h | 46 +++ qjson.c |2 + qobject.h |1 + 5 files changed, 315 insertions(+), 1 deletions(-) create mode 100644

[Qemu-devel] [PATCH 10/10] monitor: do_info_balloon(): use QError

2009-11-17 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 74abef9..e42434f 100644 --- a/monitor.c +++ b/monitor.c @@ -1722,10 +1722,11 @@ static void do_info_balloon(Monitor *mon

[Qemu-devel] [PATCH 08/10] monitor: QError support

2009-11-17 Thread Luiz Capitulino
() builds a new QError object and stores it in the Monitor struct 3. The handler returns 4. Top level Monitor code checks the Monitor struct and calls qerror_print() to print the error Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 42

[Qemu-devel] [PATCH 09/10] qdev: Use QError for 'device not found' error

2009-11-17 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- hw/qdev.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index d19d531..875ca50 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -29,6 +29,7 @@ #include qdev.h #include sysemu.h #include

[Qemu-devel] [PATCH v0 00/17]: info handlers conversions to QObject

2009-11-17 Thread Luiz Capitulino
Hi, Now that qjson has been merged, it's time to flush my queues.. This series covers almost half of the info handlers conversions to the QObject style, the other half is a bit more complicated as some handlers can be defined by different machine types. Detailed conversion status can be

[Qemu-devel] [PATCH 01/17] Introduce qemu-objects.h header file

2009-11-17 Thread Luiz Capitulino
An easy way to include all QEMU objects. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qemu-objects.h | 24 1 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 qemu-objects.h diff --git a/qemu-objects.h b/qemu-objects.h new file mode

[Qemu-devel] [PATCH 02/17] Makefile: move QObject objs to their own entry

2009-11-17 Thread Luiz Capitulino
Other subsystems will need to link against them. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d770e2a..dd48a35 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,11

[Qemu-devel] [PATCH 03/17] QDict: Introduce qdict_get_qbool()

2009-11-17 Thread Luiz Capitulino
This is a helper function that does type checking before retrieving a QBool from the dictionary. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |2 +- qdict.c | 15 +++ qdict.h |1 + 3 files changed, 17 insertions(+), 1 deletions(-) diff --git

[Qemu-devel] [PATCH 04/17] QDict: Introduce qdict_get_qlist()

2009-11-17 Thread Luiz Capitulino
A helper function to get a QList from a QDict. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |2 +- qdict.c | 13 + qdict.h |2 ++ 3 files changed, 16 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index fa41ac9..6be75a1 100644

[Qemu-devel] [PATCH 05/17] monitor: Convert do_info_status() to QObject

2009-11-17 Thread Luiz Capitulino
Return a QString with status information. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 33 +++-- 1 files changed, 27 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index 3286ba2..72de320 100644 --- a/monitor.c +++ b

[Qemu-devel] [PATCH 06/17] monitor: Convert do_info_kvm() to QObject

2009-11-17 Thread Luiz Capitulino
The returned QObject is a QString with kvm status information. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 31 +-- 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index 72de320..1a37be3 100644

[Qemu-devel] [PATCH 07/17] monitor: Convert do_info_name() to QObject

2009-11-17 Thread Luiz Capitulino
The returned QObject is a QString. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 1a37be3..5140198 100644 --- a/monitor.c +++ b/monitor.c @@ -349,10 +349,15

[Qemu-devel] [PATCH 08/17] monitor: Convert do_info_hpet() to QObject

2009-11-17 Thread Luiz Capitulino
The returned QObject is a QString. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 24 +--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 5140198..9ecf5ff 100644 --- a/monitor.c +++ b/monitor.c @@ -361,10

[Qemu-devel] [PATCH 09/17] monitor: Convert do_info_uuid() to QObject

2009-11-17 Thread Luiz Capitulino
The returned QObject is a QString, snprintf() is used because the UUID_FMT is too complex for qobject_from_jsonf(). Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 15 --- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c

[Qemu-devel] [PATCH 11/17] block: Convert bdrv_info() to QObject

2009-11-17 Thread Luiz Capitulino
Each block device information is stored in a QDict and the returned QObject is a QList of all devices. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |2 +- block.c | 123

[Qemu-devel] [PATCH 10/17] migration: Convert do_info_migrate() to QObject

2009-11-17 Thread Luiz Capitulino
user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- migration.c | 61 ++ migration.h |4 ++- monitor.c |3 +- 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/migration.c b/migration.c index

[Qemu-devel] [PATCH 12/17] char: Convert qemu_chr_info() to QObject

2009-11-17 Thread Luiz Capitulino
Each device is represented by a QDict. The returned QObject is a QList of all devices. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |3 ++- qemu-char.c | 43 +-- qemu-char.h |4

[Qemu-devel] [PATCH 14/17] block: Convert bdrv_info_stats() to QObject

2009-11-17 Thread Luiz Capitulino
Each device statistic information is stored in a QDict and the returned QObject is a QList of all devices. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- block.c | 82 block.h

[Qemu-devel] [PATCH 13/17] PCI: Convert pci_device_hot_add() to QObject

2009-11-17 Thread Luiz Capitulino
Return a QDict with information about the just added device. This commit should not change user output. Please, note that this patch does not do error handling conversion. In error conditions the handler still calls monitor_printf(). Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- hw

[Qemu-devel] [PATCH 15/17] VNC: Convert do_info_vnc() to QObject

2009-11-17 Thread Luiz Capitulino
to split it. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- console.h |3 +- monitor.c |3 +- vnc.c | 190 +++-- 3 files changed, 163 insertions(+), 33 deletions(-) diff --git a/console.h b/console.h index 9615f56

[Qemu-devel] [PATCH 16/17] net: Convert do_info_network() to QObject

2009-11-17 Thread Luiz Capitulino
Each VLAN is represented by a QDict, the returned QObject is a QList of all VLANs. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |3 +- net.c | 72 +--- net.h

[Qemu-devel] [PATCH 17/17] monitor: Convert do_info_mice() to QObject

2009-11-17 Thread Luiz Capitulino
Each mouse is represented by a QDict, the returned QObject is a QList of all mice. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- console.h |3 +- monitor.c |3 +- vl.c | 62

Re: [Qemu-devel] [PATCH 07/10] Introduce QError

2009-11-18 Thread Luiz Capitulino
On Wed, 18 Nov 2009 16:16:11 +0100 Markus Armbruster arm...@redhat.com wrote: Luiz Capitulino lcapitul...@redhat.com writes: [...] +static const char *append_field(QString *outstr, const QError *qerror, +const char *start) +{ +QObject *obj

Re: [Qemu-devel] [PATCH 08/10] monitor: QError support

2009-11-18 Thread Luiz Capitulino
On Wed, 18 Nov 2009 16:16:40 +0100 Markus Armbruster arm...@redhat.com wrote: Luiz Capitulino lcapitul...@redhat.com writes: This commit adds QError support in the Monitor. A QError member is added to the Monitor struct. This new member stores error information and is also used

Re: [Qemu-devel] [PATCH 09/10] qdev: Use QError for 'device not found' error

2009-11-18 Thread Luiz Capitulino
On Wed, 18 Nov 2009 16:17:02 +0100 Markus Armbruster arm...@redhat.com wrote: Luiz Capitulino lcapitul...@redhat.com writes: Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- hw/qdev.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/qdev.c b

Re: [Qemu-devel] [PATCH 10/10] monitor: do_info_balloon(): use QError

2009-11-18 Thread Luiz Capitulino
On Wed, 18 Nov 2009 09:58:30 -0600 Anthony Liguori aligu...@linux.vnet.ibm.com wrote: Markus Armbruster wrote: Luiz Capitulino lcapitul...@redhat.com writes: Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |7 --- 1 files changed, 4 insertions(+), 3

Re: [Qemu-devel] [PATCH 07/10] Introduce QError

2009-11-18 Thread Luiz Capitulino
On Wed, 18 Nov 2009 13:58:17 -0600 Anthony Liguori aligu...@linux.vnet.ibm.com wrote: Daniel P. Berrange wrote: On Tue, Nov 17, 2009 at 05:43:54PM -0200, Luiz Capitulino wrote: QError is a high-level data type which represents an exception in QEMU, it stores the following error

[Qemu-devel] [PATCH 00/13]: QError v5

2009-11-18 Thread Luiz Capitulino
Hi, This new QError version addresses the comments from the last submission. Anthony, please note that my conversion series submitted yesterday: http://lists.gnu.org/archive/html/qemu-devel/2009-11/msg01007.html Doesn't depend on QError and can be merged independently of it. changelog

[Qemu-devel] [PATCH 01/13] QJSON: Introduce qobject_from_jsonv()

2009-11-18 Thread Luiz Capitulino
It accepts a va_list and will be used by QError. Also simplifies the code a little, as the other qobject_from_() functions can use it. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qjson.c | 21 +++-- qjson.h |2 ++ 2 files changed, 13 insertions(+), 10

[Qemu-devel] [PATCH 02/13] QString: Introduce qstring_append_chr()

2009-11-18 Thread Luiz Capitulino
It appends a C char to a QString. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qstring.c | 24 +++- qstring.h |1 + 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/qstring.c b/qstring.c index 441a9e6..e422bd9 100644 --- a/qstring.c +++ b

[Qemu-devel] [PATCH 03/13] QString: Introduce qstring_append_int()

2009-11-18 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qstring.c |8 qstring.h |2 ++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/qstring.c b/qstring.c index e422bd9..ad17769 100644 --- a/qstring.c +++ b/qstring.c @@ -75,6 +75,14 @@ void qstring_append

[Qemu-devel] [PATCH 04/13] QString: Introduce qstring_from_substr()

2009-11-18 Thread Luiz Capitulino
Note that we can now write qstring_from_str() as a wrapper. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qstring.c | 20 +++- qstring.h |1 + 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/qstring.c b/qstring.c index ad17769..740a106 100644

[Qemu-devel] [PATCH 05/13] utests: Add qstring_append_chr() unit-test

2009-11-18 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- check-qstring.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/check-qstring.c b/check-qstring.c index ea4dfd0..412038a 100644 --- a/check-qstring.c +++ b/check-qstring.c @@ -55,6 +55,22

[Qemu-devel] [PATCH 06/13] utests: Add qstring_from_substr() unit-test

2009-11-18 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- check-qstring.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/check-qstring.c b/check-qstring.c index 412038a..c308a63 100644 --- a/check-qstring.c +++ b/check-qstring.c @@ -71,6 +71,19

[Qemu-devel] [PATCH 07/13] Introduce QError

2009-11-18 Thread Luiz Capitulino
- filename The file name of where the error occurred - line numberThe exact line number of the error - function The function name of where the error occurred - run-time data Any run-time error data Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |2 +- qerror.c

[Qemu-devel] [PATCH 08/13] monitor: QError support

2009-11-18 Thread Luiz Capitulino
() builds a new QError object and stores it in the Monitor struct 3. The handler returns 4. Top level Monitor code checks the Monitor struct and calls qerror_print() to print the error Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 43

[Qemu-devel] [PATCH 09/13] QError: Add QERR_DEVICE_NOT_FOUND

2009-11-18 Thread Luiz Capitulino
New class for device not found errors. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qerror.c |4 qerror.h |2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index 10b0939..a12e7f7 100644 --- a/qerror.c +++ b/qerror.c @@ -40,6

[Qemu-devel] [PATCH 10/13] qdev: Use QError for 'device not found' error

2009-11-18 Thread Luiz Capitulino
Please, note that we will lose the Try -device '?' for a list hint as it's qdev specific. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- hw/qdev.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index d19d531..875ca50 100644 --- a/hw

[Qemu-devel] [PATCH 11/13] QError: Add QERR_DEVICE_NOT_ACTIVE

2009-11-18 Thread Luiz Capitulino
New class for device not active errors. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qerror.c |4 qerror.h |3 +++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index a12e7f7..0c0a510 100644 --- a/qerror.c +++ b/qerror.c @@ -44,6

[Qemu-devel] [PATCH 12/13] QError: Add QERR_KVM_MISSING_CAP

2009-11-18 Thread Luiz Capitulino
New class for KVM unavailable features errors. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qerror.c |4 qerror.h |3 +++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index 0c0a510..d8b125e 100644 --- a/qerror.c +++ b/qerror.c

[Qemu-devel] [PATCH 13/13] monitor: do_info_balloon(): Use QError

2009-11-18 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index da05bf4..549e98b 100644 --- a/monitor.c +++ b/monitor.c @@ -1722,10 +1722,9 @@ static void do_info_balloon(Monitor *mon

[Qemu-devel] [RFC v0 00/15] QEMU Monitor Protocol

2009-11-19 Thread Luiz Capitulino
Hi, This is not stable yet, it has a few bugs and a number of things to be done, but I'm sending it now so that it can get an initial review while I'm working on it. At the end of the series there are two simple Python scripts which are able to talk to QEMU by using QMP. Main issues are: o

[Qemu-devel] [PATCH 01/15] monitor: Introduce MONITOR_USE_CONTROL flag

2009-11-19 Thread Luiz Capitulino
This flag will be set when Monitor enters control mode, in which the output will be defined by the QEMU Monitor Protocol. This also introduces a macro to check if the flag is set. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |6 ++ monitor.h |1 + 2 files

[Qemu-devel] [PATCH 02/15] monitor: Command-line flag to enable control mode

2009-11-19 Thread Luiz Capitulino
,server Will run QEMU in control mode, waiting for a client TCP connection on localhost port . TODO: Update manpage. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 18 ++ monitor.h |1 + vl.c | 11 +++ 3 files changed, 26 insertions

[Qemu-devel] [PATCH 03/15] monitor: Move handler calling code to its own function

2009-11-19 Thread Luiz Capitulino
It's going to be used by QMP code as well. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 20 +--- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/monitor.c b/monitor.c index a98dc42..07bd21c 100644 --- a/monitor.c +++ b/monitor.c

[Qemu-devel] [PATCH 04/15] QError: Add errors used by QMP

2009-11-19 Thread Luiz Capitulino
NOTE: These errors where added quickly to satisfy immediate needs, they need to be reviewed. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qerror.c | 20 qerror.h | 15 +++ 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/qerror.c b

[Qemu-devel] [PATCH 05/15] QMP: chardev handling

2009-11-19 Thread Luiz Capitulino
name implies, is used by the Monitor to emit JSON output. In this commit it's used by monitor_control_event() to print our greeting message. Finally, control mode support is also added to monitor_init(), allowing QMP to be really enabled. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com

[Qemu-devel] [PATCH 06/15] QMP: Output support

2009-11-19 Thread Luiz Capitulino
, data: json-value } id: json-value } Please, note that the id key is part of the input code, and thus is not added in this commit. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 56 +--- 1 files changed, 49

[Qemu-devel] [PATCH 07/15] QMP: Input support

2009-11-19 Thread Luiz Capitulino
to read from the user TODO: Errors need to be reviewed Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 251 +++-- 1 files changed, 244 insertions(+), 7 deletions(-) diff --git a/monitor.c b/monitor.c index e81f9e6..5c5ae97

[Qemu-devel] [PATCH 08/15] QMP: Asynchronous events infrastructure

2009-11-19 Thread Luiz Capitulino
-number }, data: json-value } This design is based on ideas by Amit Shah amit.s...@redhat.com. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 50 ++ monitor.h |6 ++ qemu-tool.c |4 3 files changed, 60

[Qemu-devel] [PATCH 09/15] QMP: Introduce basic asynchronous events

2009-11-19 Thread Luiz Capitulino
Debug, shutdown, reset, powerdown and stop are all basic events, as they are very simple they can be added in the same commit. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 15 +++ monitor.h |5 + vl.c | 11 +-- 3 files changed, 29

[Qemu-devel] [PATCH 10/15] QMP: Disable monitor print functions

2009-11-19 Thread Luiz Capitulino
will emit a generic error. Although this is far from the perfect solution, it guarantees that only JSON is printed. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 14 +++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c

[Qemu-devel] [PATCH 11/15] QMP: Introduce README file

2009-11-19 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- QMP/README | 47 +++ 1 files changed, 47 insertions(+), 0 deletions(-) create mode 100644 QMP/README diff --git a/QMP/README b/QMP/README new file mode 100644 index 000..5ac1742 --- /dev

[Qemu-devel] [PATCH 12/15] QMP: Introduce specification

2009-11-19 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- QMP/qmp-spec.txt | 193 ++ 1 files changed, 193 insertions(+), 0 deletions(-) create mode 100644 QMP/qmp-spec.txt diff --git a/QMP/qmp-spec.txt b/QMP/qmp-spec.txt new file mode 100644

[Qemu-devel] [PATCH 13/15] QMP: Introduce qmp-events.txt

2009-11-19 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- QMP/qmp-events.txt | 26 ++ 1 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 QMP/qmp-events.txt diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt new file mode 100644 index 000

[Qemu-devel] [PATCH 14/15] QMP: Introduce qmp-shell

2009-11-19 Thread Luiz Capitulino
a low-level dictionary or list. It's worth to note that the shell is broken into two files. One is the shell itself, the other is the QMP class which handles the communication with QEMU. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- QMP/qmp-shell | 66

[Qemu-devel] [PATCH 15/15] QMP: Introduce vm-info

2009-11-19 Thread Luiz Capitulino
A Python script which uses qmp.py to print some simple VM info. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- QMP/vm-info | 32 1 files changed, 32 insertions(+), 0 deletions(-) create mode 100755 QMP/vm-info diff --git a/QMP/vm-info b/QMP/vm-info

[Qemu-devel] Re: [RFC v0 00/15] QEMU Monitor Protocol

2009-11-19 Thread Luiz Capitulino
On Thu, 19 Nov 2009 17:20:30 +0200 Avi Kivity a...@redhat.com wrote: On 11/19/2009 05:13 PM, Luiz Capitulino wrote: Hi, This is not stable yet, it has a few bugs and a number of things to be done, but I'm sending it now so that it can get an initial review while I'm working

Re: [Qemu-devel] [RFC v0 00/15] QEMU Monitor Protocol

2009-11-19 Thread Luiz Capitulino
On Thu, 19 Nov 2009 13:13:28 -0200 Luiz Capitulino lcapitul...@redhat.com wrote: o Not using the stream parser to read the input Just to clarify: this only means that a '\n' is required at the end of input. This series is already capable on reading json input.

Re: [Qemu-devel] [PATCH 00/10]: QError v4

2009-11-20 Thread Luiz Capitulino
On Fri, 20 Nov 2009 09:56:46 -0600 Anthony Liguori anth...@codemonkey.ws wrote: Jamie Lokier wrote: Anthony Liguori wrote: Markus Armbruster wrote: 3. It falls short of the requirement that clients can easily present a human-readable error description to their human users,

[Qemu-devel] Re: [RFC v0 00/15] QEMU Monitor Protocol

2009-11-22 Thread Luiz Capitulino
On Sun, 22 Nov 2009 11:41:02 +0200 Avi Kivity a...@redhat.com wrote: On 11/19/2009 06:47 PM, Luiz Capitulino wrote: Can you post a capture of a few monitor commands through the new protocol? Here goes, it's a telnet session: Looks really good, some comments below

Re: [Qemu-devel] [PATCH 00/10]: QError v4

2009-11-23 Thread Luiz Capitulino
On Sat, 21 Nov 2009 11:02:41 +0100 Markus Armbruster arm...@redhat.com wrote: Now, what should a client do when it discovers the monitor command it needs to use has grown a new error? Refuse to use the command for fear of having to present a sub-par error message to the user in case it

Re: [Qemu-devel] [PATCH 00/10]: QError v4

2009-11-23 Thread Luiz Capitulino
On Sun, 22 Nov 2009 10:08:16 -0600 Anthony Liguori anth...@codemonkey.ws wrote: I'm certainly willing to consider alternative ways to do qmp_error() but taking a free form string is not an option in my mind. It goes against the fundamentals of what we're trying to build with QMP. Agreed.

Re: [Qemu-devel] Re: [RFC v0 00/15] QEMU Monitor Protocol

2009-11-23 Thread Luiz Capitulino
On Sun, 22 Nov 2009 10:04:15 -0600 Anthony Liguori anth...@codemonkey.ws wrote: Luiz Capitulino wrote: { execute: info, arguments: { item: balloon } } {return: 512} { execute: info, arguments: { item: network } } {return: [{devices: [{name: user.0, info: net=10.0.2.0, restricted=n

Re: [Qemu-devel] [PATCH 11/17] block: Convert bdrv_info() to QObject

2009-11-23 Thread Luiz Capitulino
On Fri, 20 Nov 2009 15:06:26 +0100 Markus Armbruster arm...@redhat.com wrote: Luiz Capitulino lcapitul...@redhat.com writes: Each block device information is stored in a QDict and the returned QObject is a QList of all devices. This commit should not change user output. Signed-off

Re: [Qemu-devel] [PATCH 12/17] char: Convert qemu_chr_info() to QObject

2009-11-23 Thread Luiz Capitulino
On Fri, 20 Nov 2009 15:10:20 +0100 Markus Armbruster arm...@redhat.com wrote: Luiz Capitulino lcapitul...@redhat.com writes: Each device is represented by a QDict. The returned QObject is a QList of all devices. This commit should not change user output. Signed-off-by: Luiz

[Qemu-devel] Re: [PATCH 13/17] PCI: Convert pci_device_hot_add() to QObject

2009-11-23 Thread Luiz Capitulino
On Mon, 23 Nov 2009 11:44:57 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Nov 17, 2009 at 06:32:20PM -0200, Luiz Capitulino wrote: Return a QDict with information about the just added device. This commit should not change user output. Please, note that this patch does

Re: [Qemu-devel] [PATCH 00/10]: QError v4

2009-11-23 Thread Luiz Capitulino
On Mon, 23 Nov 2009 07:11:53 -0600 Anthony Liguori anth...@codemonkey.ws wrote: Luiz Capitulino wrote: On Sun, 22 Nov 2009 10:08:16 -0600 Anthony Liguori anth...@codemonkey.ws wrote: I'm certainly willing to consider alternative ways to do qmp_error() but taking a free form

[Qemu-devel] [PATCH 01/17] Introduce qemu-objects.h header file

2009-11-23 Thread Luiz Capitulino
An easy way to include all QEMU objects. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- qemu-objects.h | 24 1 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 qemu-objects.h diff --git a/qemu-objects.h b/qemu-objects.h new file mode

[Qemu-devel] [PATCH 02/17] Makefile: move QObject objs to their own entry

2009-11-23 Thread Luiz Capitulino
Other subsystems will need to link against them. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7843690..35238f5 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,11

[Qemu-devel] [PATCH v1 00/17]: info handlers conversions to QObject

2009-11-23 Thread Luiz Capitulino
Hi, This series covers almost half of the info handlers conversions to the QObject style, the other half is a bit more complicated as some handlers can be defined by different machine types. changelog - v0 - v1 - Minor fixes (indentation, casts, etc) - Improved some documentation and

[Qemu-devel] [PATCH 03/17] QDict: Introduce qdict_get_qbool()

2009-11-23 Thread Luiz Capitulino
This is a helper function that does type checking before retrieving a QBool from the dictionary. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |2 +- qdict.c | 15 +++ qdict.h |1 + 3 files changed, 17 insertions(+), 1 deletions(-) diff --git

[Qemu-devel] [PATCH 04/17] QDict: Introduce qdict_get_qlist()

2009-11-23 Thread Luiz Capitulino
A helper function to get a QList from a QDict. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |2 +- qdict.c | 13 + qdict.h |2 ++ 3 files changed, 16 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 8b4c4e6..89fbdc6 100644

[Qemu-devel] [PATCH 05/17] monitor: Fix do_info_balloon() output

2009-11-23 Thread Luiz Capitulino
New monitor commands should always return values in bytes. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 3286ba2..e3368c8 100644 --- a/monitor.c +++ b/monitor.c

[Qemu-devel] [PATCH 06/17] monitor: Convert do_info_status() to QObject

2009-11-23 Thread Luiz Capitulino
Return a QString with status information. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 33 +++-- 1 files changed, 27 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index e3368c8..c9104c3 100644 --- a/monitor.c +++ b

[Qemu-devel] [PATCH 07/17] monitor: Convert do_info_kvm() to QObject

2009-11-23 Thread Luiz Capitulino
Return a QString with kvm status information. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 31 +-- 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index c9104c3..c2e82c8 100644 --- a/monitor.c +++ b

[Qemu-devel] [PATCH 08/17] monitor: Convert do_info_name() to QObject

2009-11-23 Thread Luiz Capitulino
Return a QString with the current VM name. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index c2e82c8..1540254 100644 --- a/monitor.c +++ b/monitor.c @@ -349,10

[Qemu-devel] [PATCH 09/17] monitor: Convert do_info_hpet() to QObject

2009-11-23 Thread Luiz Capitulino
Return a QString with HPET information. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 24 +--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 1540254..ab21db4 100644 --- a/monitor.c +++ b/monitor.c

[Qemu-devel] [PATCH 10/17] monitor: Convert do_info_uuid() to QObject

2009-11-23 Thread Luiz Capitulino
The returned QObject is a QString, snprintf() is used because the UUID_FMT is too complex for qobject_from_jsonf(). Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 15 --- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c

[Qemu-devel] [PATCH 11/17] monitor: Convert do_info_mice() to QObject

2009-11-23 Thread Luiz Capitulino
Each mouse is represented by a QDict, the returned QObject is a QList of all mice. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- console.h |3 +- monitor.c |3 +- vl.c | 62

[Qemu-devel] [PATCH 12/17] migration: Convert do_info_migrate() to QObject

2009-11-23 Thread Luiz Capitulino
user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- migration.c | 68 +++--- migration.h |4 ++- monitor.c |3 +- 3 files changed, 64 insertions(+), 11 deletions(-) diff --git a/migration.c b/migration.c index

[Qemu-devel] [PATCH 13/17] block: Convert bdrv_info() to QObject

2009-11-23 Thread Luiz Capitulino
Each block device information is stored in a QDict and the returned QObject is a QList of all devices. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- Makefile |6 +- block.c | 123

[Qemu-devel] [PATCH 15/17] char: Convert qemu_chr_info() to QObject

2009-11-23 Thread Luiz Capitulino
Each device is represented by a QDict. The returned QObject is a QList of all devices. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |3 ++- qemu-char.c | 43 +-- qemu-char.h |4

[Qemu-devel] [PATCH 14/17] block: Convert bdrv_info_stats() to QObject

2009-11-23 Thread Luiz Capitulino
Each device statistic information is stored in a QDict and the returned QObject is a QList of all devices. This commit should not change user output. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- block.c | 82 block.h

[Qemu-devel] [PATCH 16/17] PCI: Convert pci_device_hot_add() to QObject

2009-11-23 Thread Luiz Capitulino
Return a QDict with information about the just added device. This commit should not change user output. Please, note that this patch does not do error handling conversion. In error conditions the handler still calls monitor_printf(). Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- hw

[Qemu-devel] [PATCH 17/17] VNC: Convert do_info_vnc() to QObject

2009-11-23 Thread Luiz Capitulino
to split it. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- console.h |3 +- monitor.c |3 +- vnc.c | 190 +++-- 3 files changed, 163 insertions(+), 33 deletions(-) diff --git a/console.h b/console.h index c7172f6

Re: [Qemu-devel] [PATCH 00/10]: QError v4

2009-11-24 Thread Luiz Capitulino
On Mon, 23 Nov 2009 14:50:05 +0100 Alexander Graf ag...@suse.de wrote: Am 23.11.2009 um 14:34 schrieb Luiz Capitulino lcapitul...@redhat.com: On Mon, 23 Nov 2009 07:11:53 -0600 Anthony Liguori anth...@codemonkey.ws wrote: Luiz Capitulino wrote: On Sun, 22 Nov 2009 10:08:16 -0600

[Qemu-devel] [PATCH v1 00/20] QEMU Monitor Protocol

2009-11-26 Thread Luiz Capitulino
Hi, This series has a number of improvements over v0 and is a serious candidate for inclusion. Something I'd like to make clear is that QMP is still unstable: some commands output are being fixed and most of the error handling has not been done yet. It might look scary to have an unstable

[Qemu-devel] [PATCH 01/20] monitor: Introduce MONITOR_USE_CONTROL flag

2009-11-26 Thread Luiz Capitulino
This flag will be set when Monitor enters control mode, in which the output will be defined by the QEMU Monitor Protocol. This also introduces a macro to check if the flag is set. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |6 ++ monitor.h |1 + 2 files

[Qemu-devel] [PATCH 02/20] monitor: Command-line flag to enable control mode

2009-11-26 Thread Luiz Capitulino
,server Will run QEMU in control mode, waiting for a client TCP connection on localhost port . NOTE: I've tried using QemuOpts for this, but turns out that it will try to parse the device part, which should be untouched. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c

[Qemu-devel] [PATCH 03/20] monitor: Introduce monitor_call_handler()

2009-11-26 Thread Luiz Capitulino
This commit moves the code which calls Monitor handlers to its own function, as it will be used by QMP code as well. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 20 +--- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/monitor.c b

[Qemu-devel] [PATCH 04/20] monitor: Introduce monitor_find_command()

2009-11-26 Thread Luiz Capitulino
This commit moves the loop which searches for the command entry corresponding to a command name to its own function. It will be used by QMP code as well. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 22 +++--- 1 files changed, 15 insertions(+), 7

[Qemu-devel] [PATCH 05/20] monitor: Rename monitor_handle_command()

2009-11-26 Thread Luiz Capitulino
As this series will add a new kind of Monitor command, it's better to rename monitor_handle_command() to what it really is: handle_user_command(). This will avoid confusion. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c |6 +++--- 1 files changed, 3 insertions(+), 3

[Qemu-devel] [PATCH 06/20] monitor: Introduce 'info commands'

2009-11-26 Thread Luiz Capitulino
List QMP available commands. Only valid in control mode, where has to be used as 'query-commands. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c | 37 + 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/monitor.c b

[Qemu-devel] [PATCH 07/20] QError: Add errors needed by QMP

2009-11-26 Thread Luiz Capitulino
Only QERR_QMP_BAD_INPUT_OBJECT is QMP specific, the others can be used in different contexts by other subsystems. Please, note that QERR_JSON_PARSING signals any parsing error from the json parser. We will need it until the parser gets updated to use QError. Signed-off-by: Luiz Capitulino

[Qemu-devel] [PATCH 08/20] QMP: Initial support

2009-11-26 Thread Luiz Capitulino
, is used by the Monitor to emit JSON output. In this commit it's used by monitor_control_event() to print our greeting message. Finally, control mode support is also added to monitor_init(), allowing QMP to be really enabled. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- monitor.c

<    9   10   11   12   13   14   15   16   17   18   >