Re: [Qemu-devel] [RFC 00/27]: add new error format

2012-08-06 Thread Luiz Capitulino
On Mon, 6 Aug 2012 02:35:03 -0400 (EDT) Amos Kong wrote: > - Original Message - > > On Thu, 02 Aug 2012 10:31:28 +0800 > > Amos Kong wrote: > > > > > On 01/08/12 21:29, Luiz Capitulino wrote: > > > > On Wed, 01 Aug 2012 19:33:27 +0800 > >

Re: [Qemu-devel] [PATCH 15/34] net: inet_connect(), inet_connect_opts(): return -errno

2012-08-06 Thread Luiz Capitulino
On Mon, 6 Aug 2012 02:52:24 -0400 (EDT) Amos Kong wrote: > > > - Original Message - > > [cc: Juan & Amos] > > > > Luiz Capitulino writes: > > > > > On Wed, 1 Aug 2012 22:02:35 -0300 > > > Luiz Capitulino wrote: > > >

[Qemu-devel] [PATCH 07/35] qerror: QError: drop file, linenr, func

2012-08-07 Thread Luiz Capitulino
They have never been fully used and conflict with future error improvements. Also makes qerror_report() a proper function, as there's no point in having it as a macro anymore. Signed-off-by: Luiz Capitulino --- qerror.c | 20 +++- qerror.h | 8 +--- 2 files chang

[Qemu-devel] [PATCH 35/35] docs: writing-qmp-commands.txt: update error section

2012-08-07 Thread Luiz Capitulino
Add information about the new error format and improve the text a bit. Signed-off-by: Luiz Capitulino --- docs/writing-qmp-commands.txt | 47 +-- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/docs/writing-qmp-commands.txt b/docs/writing

[Qemu-devel] [PATCH 18/35] hmp: hmp.h: include qdict.h

2012-08-07 Thread Luiz Capitulino
hmp.h is relying on qdict.h being provided by qapi-types.h. Fix this, as a future commit will change qapi-types.h not to provide qdict.h. Signed-off-by: Luiz Capitulino --- hmp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hmp.h b/hmp.h index 8d2b0d7..3275522 100644 --- a/hmp.h +++ b

[Qemu-devel] [PATCH 34/35] error, qerror: drop QDict member

2012-08-07 Thread Luiz Capitulino
Used to store error information, but it's unused now. Signed-off-by: Luiz Capitulino --- error.c | 4 qerror.c | 4 qerror.h | 1 - 3 files changed, 9 deletions(-) diff --git a/error.c b/error.c index 0e10373..1f05fc4 100644 --- a/error.c +++ b/error.c @@ -19,7 +19,6 @@ s

[Qemu-devel] [PATCH 23/35] qerror: qerror_table: don't use C99 struct initializers

2012-08-07 Thread Luiz Capitulino
This allows for changing QERR_ macros to initialize two struct members at the same time. See next commit for more details. Signed-off-by: Luiz Capitulino --- qerror.c | 276 +++ qerror.h | 2 +- 2 files changed, 139 insertions

[Qemu-devel] [PATCH 21/35] qapi: don't convert enum strings to lowercase

2012-08-07 Thread Luiz Capitulino
Next commit will introduce enum strings in camel case. Signed-off-by: Luiz Capitulino --- scripts/qapi-types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 9b7da96..cf601ae 100644 --- a/scripts/qapi-types.py +++ b

[Qemu-devel] [PATCH 02/35] qerror: QERR_AMBIGUOUS_PATH: drop %(object) from human msg

2012-08-07 Thread Luiz Capitulino
Actually, renames it to 'object'. This must be what the original author meant to write, as there's no 'object' in the error's data member. Signed-off-by: Luiz Capitulino --- qerror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qerror.c b/q

[Qemu-devel] [PATCH 25/35] qerror: add proper ErrorClass value for QERR_ macros

2012-08-07 Thread Luiz Capitulino
, which are maintained as they are today. Signed-off-by: Luiz Capitulino --- qerror.h | 140 +++ 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/qerror.h b/qerror.h index bcc93f8..4f92218 100644 --- a/qerror.h +++ b/qerror.h

[Qemu-devel] [PATCH 17/35] block: block_int: include qerror.h

2012-08-07 Thread Luiz Capitulino
Several block/ files are relying on qerror.h being provided by qapi-types.h. Fix this, as a future commit will change qapi-types.h not to provide qerror.h. Signed-off-by: Luiz Capitulino --- block_int.h | 1 + 1 file changed, 1 insertion(+) diff --git a/block_int.h b/block_int.h index d72317f

[Qemu-devel] [PATCH 20/35] qapi: generate correct enum names for camel case enums

2012-08-07 Thread Luiz Capitulino
An enum like GenericError in the schema, should generate GENERIC_ERROR and not GENERICERROR. Signed-off-by: Luiz Capitulino --- scripts/qapi-types.py | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 3ed9f04

[Qemu-devel] [PATCH 24/35] error, qerror: add ErrorClass argument to error functions

2012-08-07 Thread Luiz Capitulino
ls to qerror_report() and error_set() (and also to initialize qerror_table[]). Next commit will update the QERR_ macros with a proper ErrorClass value. Signed-off-by: Luiz Capitulino --- error.c | 8 +++- error.h | 5 ++- qerror.c | 10 +++-- qerror.h

[Qemu-devel] [PATCH 03/35] qerror: QERR_DEVICE_ENCRYPTED: change error message

2012-08-07 Thread Luiz Capitulino
Match what HMP commands print on DeviceEncrypted errors. Signed-off-by: Luiz Capitulino --- qerror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qerror.c b/qerror.c index 082de98..de0a79e 100644 --- a/qerror.c +++ b/qerror.c @@ -81,7 +81,7 @@ static const

[Qemu-devel] [PATCH 16/35] qerror: drop QERR_SOCKET_CONNECT_IN_PROGRESS

2012-08-07 Thread Luiz Capitulino
Unused since last commit. Signed-off-by: Luiz Capitulino --- qerror.c | 4 qerror.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/qerror.c b/qerror.c index 5d38428..452ec69 100644 --- a/qerror.c +++ b/qerror.c @@ -309,10 +309,6 @@ static const QErrorStringTable qerror_table

[Qemu-devel] [PATCH 06/35] qerror: avoid passing qerr pointer

2012-08-07 Thread Luiz Capitulino
Helps dropping/modifying qerror functions. Signed-off-by: Luiz Capitulino --- qerror.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/qerror.c b/qerror.c index 7cb7c12..e717496 100644 --- a/qerror.c +++ b/qerror.c @@ -346,10 +346,10 @@ static

[Qemu-devel] [PATCH 13/35] hmp_change(): don't access DeviceEncrypted's data

2012-08-07 Thread Luiz Capitulino
It's not needed. The device name is already known and monitor_read_block_device_key() knows how to do the rest. This overly simplifies hmp_change(). Signed-off-by: Luiz Capitulino --- hmp.c | 29 ++--- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/

[Qemu-devel] [PATCH 04/35] qerror: reduce public exposure

2012-08-07 Thread Luiz Capitulino
qerror will be dropped in a near future, let's reduce its public exposure by making functions only used in qerror.c static. Signed-off-by: Luiz Capitulino --- qerror.c | 10 +- qerror.h | 5 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/qerror.c b/qerror.c

[Qemu-devel] [PATCH v2 00/35]: add new error format

2012-08-07 Thread Luiz Capitulino
v2 o rebase on top of master o fix linux-user build breakage o maintain DeviceEncrypted error and let hmp_change() use it o drop patch that changed inet_connect() and inet_connect_opts() to return -errno o Simplified tcp_start_outgoing_migration() error handling o use g_strdup_vprintf() (

[Qemu-devel] [PATCH 14/35] net: inet_connect(), inet_connect_opts(): add in_progress argument

2012-08-07 Thread Luiz Capitulino
It's used to indicate the special case where a valid file-descriptor is returned (ie. success) but the connection can't be completed w/o blocking. Signed-off-by: Luiz Capitulino --- migration-tcp.c | 2 +- nbd.c | 2 +- qemu-char.c | 2 +- qemu-socke

[Qemu-devel] [PATCH 32/35] error, qerror: pass desc string to error calls

2012-08-07 Thread Luiz Capitulino
function receive a human message instead and the qobject is not built anymore. Signed-off-by: Luiz Capitulino --- error.c | 3 +- error.h | 10 ++--- qerror.c | 42 +-- qerror.h | 141 +++ 4 files changed, 77

[Qemu-devel] [PATCH 31/35] error: drop error_get_qobject()/error_set_qobject()

2012-08-07 Thread Luiz Capitulino
error_get_qobject() is unused since last commit, error_set_qobject() has never been used. Also drops error_int.h. Signed-off-by: Luiz Capitulino --- error.c | 20 error_int.h | 28 qapi/qmp-dispatch.c | 1 - qemu-ga.c

[Qemu-devel] [PATCH 26/35] error: add error_get_class()

2012-08-07 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- error.c | 5 + error.h | 5 + 2 files changed, 10 insertions(+) diff --git a/error.c b/error.c index 648706a..2d34cde 100644 --- a/error.c +++ b/error.c @@ -64,6 +64,11 @@ bool error_is_set(Error **errp) return (errp && *errp); } +Er

[Qemu-devel] [PATCH 12/35] hmp: hmp_cont(): don't rely on QERR_DEVICE_ENCRYPTED

2012-08-07 Thread Luiz Capitulino
This commit changes hmp_cont() to loop through all block devices and proactively set an encryption key for any encrypted device without a valid one. This change is needed because QERR_DEVICE_ENCRYPTED is going to be dropped by a future commit. Signed-off-by: Luiz Capitulino --- hmp.c | 43

[Qemu-devel] [PATCH 22/35] qapi-schema: add ErrorClass enum

2012-08-07 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- qapi-schema.json | 30 ++ 1 file changed, 30 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 5805f74..8f670f3 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3,6 +3,36 @@ # QAPI Schema

[Qemu-devel] [PATCH 05/35] qerror: drop qerror_abort()

2012-08-07 Thread Luiz Capitulino
qerror_abort() depends on the 'file', 'func' and 'linenr' members of QError. However, these members are going to be dropped by the next commit, so let's drop qerror_abort() in favor of printing an error message to stderr plus a call to abort(). Signed-off-by:

[Qemu-devel] [PATCH 19/35] qapi: qapi-types.h: don't include qapi/qapi-types-core.h

2012-08-07 Thread Luiz Capitulino
qapi-types.h needs only qemu-common.h. Including qapi-types-core.h causes problems when qerror.h or error.h includes qapi-types.h. Signed-off-by: Luiz Capitulino --- scripts/qapi-types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/qapi-types.py b/scripts/qapi

[Qemu-devel] [PATCH 01/35] monitor: drop unused monitor debug code

2012-08-07 Thread Luiz Capitulino
this last time. Let's just drop it. Signed-off-by: Luiz Capitulino --- configure | 10 -- monitor.c | 65 --- 2 files changed, 75 deletions(-) diff --git a/configure b/configure index 280726c..030d137 100755 --- a/

[Qemu-devel] [PATCH 28/35] error: drop unused functions

2012-08-07 Thread Luiz Capitulino
Besides of being unused, they operate on the current error format, which is going to be replaced soon. Signed-off-by: Luiz Capitulino --- error.c | 48 error.h | 16 error_int.h | 1 - 3 files changed, 65 deletions

[Qemu-devel] [PATCH 29/35] qmp: switch to the new error format on the wire

2012-08-07 Thread Luiz Capitulino
{ "error": { "class": "DeviceNotRemovable", "data": { "device": "virtio0" }, "desc": "Device 'virtio0' is not removable" } } Will now be emitted as: { "error": {

[Qemu-devel] [PATCH 15/35] migration: don't rely on any QERR_SOCKET_*

2012-08-07 Thread Luiz Capitulino
ted immediately (qemu) After this commit no spurious error is reported anymore. Signed-off-by: Luiz Capitulino --- migration-tcp.c | 22 -- qemu-sockets.c | 2 -- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/migration-tcp.c b/migration-tcp.c index 18944a4.

[Qemu-devel] [PATCH 30/35] qemu-ga: switch to the new error format on the wire

2012-08-07 Thread Luiz Capitulino
n|reboot" } } } qemu-ga now returns: { "error": { "class": "GenericError", "desc": "Parameter 'mode' expects halt|powerdown|reboot" } } Notice that this is also a bug fix, as qemu-ga wasn't returning the human mess

[Qemu-devel] [PATCH 33/35] qerror: drop qerror_table and qerror_format()

2012-08-07 Thread Luiz Capitulino
They are unused since last commit. Signed-off-by: Luiz Capitulino --- qerror.c | 400 --- qerror.h | 7 -- 2 files changed, 407 deletions(-) diff --git a/qerror.c b/qerror.c index dda1427..ccc52be 100644 --- a/qerror.c +++ b

[Qemu-devel] [PATCH 10/35] error: don't delay error message construction

2012-08-07 Thread Luiz Capitulino
Today, the error message is only constructed when it's used. This commit changes that to construct the error message when the error object is built (ie. when the error is reported). This simplifies the Error object. Signed-off-by: Luiz Capitulino --- error.c | 8 +--- qerror.c | 4 +-

[Qemu-devel] [PATCH 27/35] hmp: hmp_change(): use error_get_class()

2012-08-07 Thread Luiz Capitulino
The error_is_type() function is going to be dropped. Signed-off-by: Luiz Capitulino --- hmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index 3a9688d..5900251 100644 --- a/hmp.c +++ b/hmp.c @@ -799,7 +799,8 @@ void hmp_change(Monitor *mon, const QDict

[Qemu-devel] [PATCH 09/35] qerror: don't delay error message construction

2012-08-07 Thread Luiz Capitulino
ifies the code. Signed-off-by: Luiz Capitulino --- qerror.c | 29 - qerror.h | 2 +- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/qerror.c b/qerror.c index d073ed7..a254f88 100644 --- a/qerror.c +++ b/qerror.c @@ -385,22 +385,6 @@ static

[Qemu-devel] [PATCH 11/35] qmp: query-block: add 'valid_encryption_key' field

2012-08-07 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- block.c | 1 + qapi-schema.json | 8 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 24323c1..59f6dd8 100644 --- a/block.c +++ b/block.c @@ -2445,6 +2445,7 @@ BlockInfoList *qmp_query_block(Error **errp

[Qemu-devel] [PATCH 08/35] qerror: qerror_format(): return an allocated string

2012-08-07 Thread Luiz Capitulino
Simplifies current and future users. Signed-off-by: Luiz Capitulino --- error.c | 5 + qerror.c | 10 -- qerror.h | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/error.c b/error.c index 58f55a0..3a62592 100644 --- a/error.c +++ b/error.c @@ -65,10 +65,7

Re: [Qemu-devel] [PATCH 00/12] Migration next v12

2012-08-07 Thread Luiz Capitulino
On Mon, 6 Aug 2012 21:42:46 +0300 Orit Wasserman wrote: > Changes from v11: > Fix example for query-migrate-cache-size commands > Move patch 10 (Change total_time to total-time) to patch 9 and fix > comment. Looks good now: Reviewed-by: Luiz Capitulino

Re: [Qemu-devel] [PATCH 35/35] docs: writing-qmp-commands.txt: update error section

2012-08-08 Thread Luiz Capitulino
On Wed, 08 Aug 2012 14:35:23 +0200 Pavel Hrdina wrote: > On 08/07/2012 05:53 PM, Luiz Capitulino wrote: > > Add information about the new error format and improve the text a bit. > > > > Signed-off-by: Luiz Capitulino > > --- > > d

Re: [Qemu-devel] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-08 Thread Luiz Capitulino
On Wed, 08 Aug 2012 15:07:02 -0400 Corey Bryant wrote: > > > On 08/07/2012 06:16 PM, Eric Blake wrote: > > On 08/07/2012 11:07 AM, Corey Bryant wrote: > > > +# > +# Since: 1.2.0 > >>> > >>> We're not very consistent on '1.2' vs. '1.2.0' in since listings, but > >>> that's probably wor

Re: [Qemu-devel] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-08 Thread Luiz Capitulino
On Wed, 08 Aug 2012 16:52:41 -0400 Corey Bryant wrote: > > > On 08/08/2012 04:48 PM, Luiz Capitulino wrote: > > On Wed, 08 Aug 2012 15:07:02 -0400 > > Corey Bryant wrote: > > > >> > >> > >> On 08/07/2012 06:16 PM, Eric Blake w

Re: [Qemu-devel] [PATCH v7 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-08 Thread Luiz Capitulino
On Wed, 08 Aug 2012 17:18:33 -0400 Corey Bryant wrote: > > > On 08/08/2012 05:13 PM, Luiz Capitulino wrote: > > On Wed, 08 Aug 2012 16:52:41 -0400 > > Corey Bryant wrote: > > > >> > >> > >> On 08/08/2012 04:48 PM, Luiz Capitulino wrote

[Qemu-devel] [PATCH 0/4]: qmp: WAKEUP event related fixes

2012-08-09 Thread Luiz Capitulino
Fixes the RESET event being emitted on wakeup from S3. Changes when the WAKEUP event is emitted and a few doc fixes. QMP/qmp-events.txt | 277 - vl.c | 18 +++- 2 files changed, 164 insertions(+), 131 deletions(-)

[Qemu-devel] [PATCH 3/4] qmp: qmp-events.txt: put events in alphabetical order

2012-08-09 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- QMP/qmp-events.txt | 266 ++--- 1 file changed, 130 insertions(+), 136 deletions(-) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index b8afedb..e37a04e 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp

[Qemu-devel] [PATCH 2/4] qmp: emit the WAKEUP event when the guest is put to run

2012-08-09 Thread Luiz Capitulino
t also adds the missing documentation for the WAKEUP event. Signed-off-by: Luiz Capitulino --- QMP/qmp-events.txt | 13 + vl.c | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index 9ba7079..b8afedb 10064

[Qemu-devel] [PATCH 1/4] qmp: don't emit the RESET event on wakeup from S3

2012-08-09 Thread Luiz Capitulino
avoid emitting the RESET event. Signed-off-by: Luiz Capitulino --- vl.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index e71cb30..b642637 100644 --- a/vl.c +++ b/vl.c @@ -1293,6 +1293,7 @@ static pid_t shutdown_pid; static int

[Qemu-devel] [PATCH 4/4] qmp: qmp-events.txt: add missing doc for the SUSPEND event

2012-08-09 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- QMP/qmp-events.txt | 12 1 file changed, 12 insertions(+) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index e37a04e..2001a71 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp-events.txt @@ -240,6 +240,18 @@ Example: { "event&qu

[Qemu-devel] [PATCH 5/5] qmp: add SUSPEND_DISK event

2012-08-09 Thread Luiz Capitulino
ult of the guest entering S4. So it's a good idea to keep both events separated Signed-off-by: Luiz Capitulino --- This is on top of: [PATCH 0/4]: qmp: WAKEUP event related fixes QMP/qmp-events.txt | 14 ++ hw/acpi.c | 2 ++ monitor.c | 1 + monitor.h

Re: [Qemu-devel] [PATCH 5/5] qmp: add SUSPEND_DISK event

2012-08-09 Thread Luiz Capitulino
On Thu, 9 Aug 2012 14:30:32 -0300 Luiz Capitulino wrote: > Emitted when the guest makes a request to enter S4 state. Oops, sorry for the bad subject. It should be just '[PATCH]'.

Re: [Qemu-devel] [PATCH 3/4] qmp: qmp-events.txt: put events in alphabetical order

2012-08-09 Thread Luiz Capitulino
On Thu, 09 Aug 2012 13:29:32 -0600 Eric Blake wrote: > On 08/09/2012 11:28 AM, Luiz Capitulino wrote: > > Signed-off-by: Luiz Capitulino > > --- > > QMP/qmp-events.txt | 266 > > ++--- > > 1 file changed,

Re: [Qemu-devel] [PATCH 2/4] qmp: emit the WAKEUP event when the guest is put to run

2012-08-09 Thread Luiz Capitulino
On Thu, 09 Aug 2012 11:57:38 -0600 Eric Blake wrote: > On 08/09/2012 11:28 AM, Luiz Capitulino wrote: > > Today, the WAKEUP event is emitted when a wakeup _request_ is made. > > This could be the system_wakeup command, for example. > > > > A better semantic would be

Re: [Qemu-devel] [PATCH 5/5] qmp: add SUSPEND_DISK event

2012-08-09 Thread Luiz Capitulino
On Thu, 09 Aug 2012 13:51:10 -0600 Eric Blake wrote: > On 08/09/2012 11:30 AM, Luiz Capitulino wrote: > > Emitted when the guest makes a request to enter S4 state. > > > > There are three possible ways of having this event, as described here: > > > > http:

Re: [Qemu-devel] [PATCH 5/5] qmp: add SUSPEND_DISK event

2012-08-09 Thread Luiz Capitulino
On Thu, 9 Aug 2012 17:48:34 -0300 Luiz Capitulino wrote: > On Thu, 09 Aug 2012 13:51:10 -0600 > Eric Blake wrote: > > > On 08/09/2012 11:30 AM, Luiz Capitulino wrote: > > > Emitted when the guest makes a request to enter S4 state. > > > > > > There ar

Re: [Qemu-devel] [PATCH 11/34] qmp: query-block: add 'valid_encryption_key' field

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 09:56:11 +0200 Markus Armbruster wrote: > Revisited this one on review of v2, replying here for context. > > Luiz Capitulino writes: > > > On Thu, 02 Aug 2012 13:35:54 +0200 > > Markus Armbruster wrote: > > > >> Luiz Capitulino w

Re: [Qemu-devel] [PATCH 12/34] hmp: hmp_cont(): don't rely on QERR_DEVICE_ENCRYPTED

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 10:42:23 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Thu, 02 Aug 2012 13:53:08 +0200 > > Markus Armbruster wrote: > > > >> Luiz Capitulino writes: > >> > >> > This commit changes hmp_cont() to

Re: [Qemu-devel] [PATCH 13/35] hmp_change(): don't access DeviceEncrypted's data

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 11:02:21 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > It's not needed. The device name is already known and > > monitor_read_block_device_key() knows how to do the rest. This overly > > simplifies hmp_change(). > > &quo

Re: [Qemu-devel] [PATCH 14/35] net: inet_connect(), inet_connect_opts(): add in_progress argument

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 11:07:53 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > It's used to indicate the special case where a valid file-descriptor > > is returned (ie. success) but the connection can't be completed > > w/o blocking. > >

Re: [Qemu-devel] [PATCH 15/35] migration: don't rely on any QERR_SOCKET_*

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 11:13:57 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > Use the in_progress argument for QERR_SOCKET_CONNECT_IN_PROGRESS. The > > other errors are handled the same by checking if the error is set and > > then calling migrate_fd_error

Re: [Qemu-devel] [PATCH 3/7] qapi: add query-machines command

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 09:41:20 -0500 Anthony Liguori wrote: > Luiz Capitulino writes: > > > On Fri, 27 Jul 2012 08:37:15 -0500 > > Anthony Liguori wrote: > > > >> This provides the same output as -M ? but in a structured way. > >> > >>

Re: [Qemu-devel] [PATCH 3/7] qapi: add query-machines command

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 11:06:14 -0500 Anthony Liguori wrote: > Luiz Capitulino writes: > > > On Fri, 10 Aug 2012 09:41:20 -0500 > > Anthony Liguori wrote: > > > >> Luiz Capitulino writes: > >> > >> > On Fri, 27 Jul 2012 08:37:15 -0500 >

Re: [Qemu-devel] [PATCH 11/34] qmp: query-block: add 'valid_encryption_key' field

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 18:35:26 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Fri, 10 Aug 2012 09:56:11 +0200 > > Markus Armbruster wrote: > > > >> Revisited this one on review of v2, replying here for context. > >> > >> L

[Qemu-devel] [PATCH 01/35] monitor: drop unused monitor debug code

2012-08-10 Thread Luiz Capitulino
this last time. Let's just drop it. Signed-off-by: Luiz Capitulino --- configure | 10 -- monitor.c | 65 --- 2 files changed, 75 deletions(-) diff --git a/configure b/configure index 280726c..030d137 100755 --- a/

[Qemu-devel] [PATCH 02/35] qerror: QERR_AMBIGUOUS_PATH: drop %(object) from human msg

2012-08-10 Thread Luiz Capitulino
Actually, renames it to 'object'. This must be what the original author meant to write, as there's no 'object' in the error's data member. Signed-off-by: Luiz Capitulino --- qerror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qerror.c b/q

[Qemu-devel] [PATCH 14/35] net: inet_connect(), inet_connect_opts(): add in_progress argument

2012-08-10 Thread Luiz Capitulino
It's used to indicate the special case where a valid file-descriptor is returned (ie. success) but the connection can't be completed w/o blocking. This is needed because QERR_SOCKET_CONNECT_IN_PROGRESS is not treated like an error and a future commit will drop it. Signed-off-by: Luiz

Re: [Qemu-devel] [PATCH 11/34] qmp: query-block: add 'valid_encryption_key' field

2012-08-10 Thread Luiz Capitulino
On Fri, 10 Aug 2012 19:17:22 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Fri, 10 Aug 2012 18:35:26 +0200 > > Markus Armbruster wrote: > > > >> Luiz Capitulino writes: > >> > >> > On Fri, 10 A

[Qemu-devel] [PATCH 10/35] error: don't delay error message construction

2012-08-10 Thread Luiz Capitulino
Today, the error message is only constructed when it's used. This commit changes that to construct the error message when the error object is built (ie. when the error is reported). This simplifies the Error object. Signed-off-by: Luiz Capitulino --- error.c | 8 +--- qerror.c | 4 +-

[Qemu-devel] [PATCH 28/35] error: drop unused functions

2012-08-10 Thread Luiz Capitulino
Besides of being unused, they operate on the current error format, which is going to be replaced soon. Signed-off-by: Luiz Capitulino --- error.c | 48 error.h | 16 error_int.h | 1 - 3 files changed, 65 deletions

[Qemu-devel] [PATCH 35/35] docs: writing-qmp-commands.txt: update error section

2012-08-10 Thread Luiz Capitulino
Add information about the new error format and improve the text a bit. Signed-off-by: Luiz Capitulino --- docs/writing-qmp-commands.txt | 47 +-- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/docs/writing-qmp-commands.txt b/docs/writing

[Qemu-devel] [PATCH 13/35] hmp_change(): don't access DeviceEncrypted's data

2012-08-10 Thread Luiz Capitulino
It's not needed. As the device name is already known, we can replace the duplicated password prompting code by monitor_read_block_device_key(). This overly simplifies hmp_change(). Signed-off-by: Luiz Capitulino --- hmp.c | 29 ++--- 1 file changed, 2 insertions(+

[Qemu-devel] [PATCH 31/35] error: drop error_get_qobject()/error_set_qobject()

2012-08-10 Thread Luiz Capitulino
error_get_qobject() is unused since last commit, error_set_qobject() has never been used. Also drops error_int.h. Signed-off-by: Luiz Capitulino --- error.c | 20 error_int.h | 28 qapi/qmp-dispatch.c | 1 - qemu-ga.c

[Qemu-devel] [PATCH 24/35] error, qerror: add ErrorClass argument to error functions

2012-08-10 Thread Luiz Capitulino
ls to qerror_report() and error_set() (and also to initialize qerror_table[]). Next commit will update the QERR_ macros with a proper ErrorClass value. Signed-off-by: Luiz Capitulino --- error.c | 8 +++- error.h | 5 ++- qerror.c | 10 +++-- qerror.h

[Qemu-devel] [PATCH 26/35] error: add error_get_class()

2012-08-10 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- error.c | 5 + error.h | 5 + 2 files changed, 10 insertions(+) diff --git a/error.c b/error.c index 648706a..2d34cde 100644 --- a/error.c +++ b/error.c @@ -64,6 +64,11 @@ bool error_is_set(Error **errp) return (errp && *errp); } +Er

[Qemu-devel] [PATCH v3 00/35]: add new error format

2012-08-10 Thread Luiz Capitulino
v3 o rebase on top of master o replace 'valid_encryption_key' with 'encryption_key_missing', fixes a bug found by Markus o minor changes (changelogs, white-space fix and others) Only the following patches have changed: o [PATCH 11/35] qmp: query-block: add 'encryption_key_missing' field

[Qemu-devel] [PATCH 09/35] qerror: don't delay error message construction

2012-08-10 Thread Luiz Capitulino
ifies the code. Signed-off-by: Luiz Capitulino --- qerror.c | 29 - qerror.h | 2 +- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/qerror.c b/qerror.c index d073ed7..a254f88 100644 --- a/qerror.c +++ b/qerror.c @@ -385,22 +385,6 @@ static

[Qemu-devel] [PATCH 23/35] qerror: qerror_table: don't use C99 struct initializers

2012-08-10 Thread Luiz Capitulino
This allows for changing QERR_ macros to initialize two struct members at the same time. See next commit for more details. Signed-off-by: Luiz Capitulino --- qerror.c | 276 +++ qerror.h | 2 +- 2 files changed, 139 insertions

[Qemu-devel] [PATCH 12/35] hmp: hmp_cont(): don't rely on QERR_DEVICE_ENCRYPTED

2012-08-10 Thread Luiz Capitulino
This commit changes hmp_cont() to loop through all block devices and proactively set an encryption key for any encrypted device missing a key. This change is needed because QERR_DEVICE_ENCRYPTED is going to be dropped by a future commit. Signed-off-by: Luiz Capitulino --- hmp.c | 37

[Qemu-devel] [PATCH 20/35] qapi: generate correct enum names for camel case enums

2012-08-10 Thread Luiz Capitulino
An enum like GenericError in the schema, should generate GENERIC_ERROR and not GENERICERROR. Signed-off-by: Luiz Capitulino --- scripts/qapi-types.py | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 3ed9f04

[Qemu-devel] [PATCH 06/35] qerror: avoid passing qerr pointer

2012-08-10 Thread Luiz Capitulino
Helps dropping/modifying qerror functions. Signed-off-by: Luiz Capitulino --- qerror.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/qerror.c b/qerror.c index 7cb7c12..e717496 100644 --- a/qerror.c +++ b/qerror.c @@ -346,10 +346,10 @@ static

[Qemu-devel] [PATCH 19/35] qapi: qapi-types.h: don't include qapi/qapi-types-core.h

2012-08-10 Thread Luiz Capitulino
qapi-types.h needs only qemu-common.h. Including qapi-types-core.h causes problems when qerror.h or error.h includes qapi-types.h. Signed-off-by: Luiz Capitulino --- scripts/qapi-types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/qapi-types.py b/scripts/qapi

[Qemu-devel] [PATCH 15/35] migration: don't rely on any QERR_SOCKET_*

2012-08-10 Thread Luiz Capitulino
ted immediately (qemu) After this commit no spurious error is reported anymore. Signed-off-by: Luiz Capitulino --- migration-tcp.c | 22 +- qemu-sockets.c | 2 -- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/migration-tcp.c b/migration-tcp.c index 18944a4.

[Qemu-devel] [PATCH 04/35] qerror: reduce public exposure

2012-08-10 Thread Luiz Capitulino
qerror will be dropped in a near future, let's reduce its public exposure by making functions only used in qerror.c static. Signed-off-by: Luiz Capitulino --- qerror.c | 10 +- qerror.h | 5 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/qerror.c b/qerror.c

[Qemu-devel] [PATCH 05/35] qerror: drop qerror_abort()

2012-08-10 Thread Luiz Capitulino
qerror_abort() depends on the 'file', 'func' and 'linenr' members of QError. However, these members are going to be dropped by the next commit, so let's drop qerror_abort() in favor of printing an error message to stderr plus a call to abort(). Signed-off-by:

[Qemu-devel] [PATCH 34/35] error, qerror: drop QDict member

2012-08-10 Thread Luiz Capitulino
Used to store error information, but it's unused now. Signed-off-by: Luiz Capitulino --- error.c | 4 qerror.c | 4 qerror.h | 1 - 3 files changed, 9 deletions(-) diff --git a/error.c b/error.c index 0e10373..1f05fc4 100644 --- a/error.c +++ b/error.c @@ -19,7 +19,6 @@ s

[Qemu-devel] [PATCH 29/35] qmp: switch to the new error format on the wire

2012-08-10 Thread Luiz Capitulino
{ "error": { "class": "DeviceNotRemovable", "data": { "device": "virtio0" }, "desc": "Device 'virtio0' is not removable" } } Will now be emitted as: { "error": {

[Qemu-devel] [PATCH 03/35] qerror: QERR_DEVICE_ENCRYPTED: change error message

2012-08-10 Thread Luiz Capitulino
Match what HMP commands print on DeviceEncrypted errors. Signed-off-by: Luiz Capitulino --- qerror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qerror.c b/qerror.c index 082de98..de0a79e 100644 --- a/qerror.c +++ b/qerror.c @@ -81,7 +81,7 @@ static const

[Qemu-devel] [PATCH 25/35] qerror: add proper ErrorClass value for QERR_ macros

2012-08-10 Thread Luiz Capitulino
, which are maintained as they are today. Signed-off-by: Luiz Capitulino --- qerror.h | 140 +++ 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/qerror.h b/qerror.h index bcc93f8..4f92218 100644 --- a/qerror.h +++ b/qerror.h

[Qemu-devel] [PATCH 27/35] hmp: hmp_change(): use error_get_class()

2012-08-10 Thread Luiz Capitulino
The error_is_type() function is going to be dropped. Signed-off-by: Luiz Capitulino --- hmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index 54c37d7..9b44dfc 100644 --- a/hmp.c +++ b/hmp.c @@ -793,7 +793,8 @@ void hmp_change(Monitor *mon, const QDict

[Qemu-devel] [PATCH 22/35] qapi-schema: add ErrorClass enum

2012-08-10 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- qapi-schema.json | 30 ++ 1 file changed, 30 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index a62bf68..b513935 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3,6 +3,36 @@ # QAPI Schema

[Qemu-devel] [PATCH 21/35] qapi: don't convert enum strings to lowercase

2012-08-10 Thread Luiz Capitulino
Next commit will introduce enum strings in camel case. Signed-off-by: Luiz Capitulino --- scripts/qapi-types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 9b7da96..cf601ae 100644 --- a/scripts/qapi-types.py +++ b

[Qemu-devel] [PATCH 18/35] hmp: hmp.h: include qdict.h

2012-08-10 Thread Luiz Capitulino
hmp.h is relying on qdict.h being provided by qapi-types.h. Fix this, as a future commit will change qapi-types.h not to provide qdict.h. Signed-off-by: Luiz Capitulino --- hmp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hmp.h b/hmp.h index 8d2b0d7..3275522 100644 --- a/hmp.h +++ b

[Qemu-devel] [PATCH 08/35] qerror: qerror_format(): return an allocated string

2012-08-10 Thread Luiz Capitulino
Simplifies current and future users. Signed-off-by: Luiz Capitulino --- error.c | 5 + qerror.c | 10 -- qerror.h | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/error.c b/error.c index 58f55a0..3a62592 100644 --- a/error.c +++ b/error.c @@ -65,10 +65,7

[Qemu-devel] [PATCH 33/35] qerror: drop qerror_table and qerror_format()

2012-08-10 Thread Luiz Capitulino
They are unused since last commit. Signed-off-by: Luiz Capitulino --- qerror.c | 400 --- qerror.h | 7 -- 2 files changed, 407 deletions(-) diff --git a/qerror.c b/qerror.c index dda1427..ccc52be 100644 --- a/qerror.c +++ b

[Qemu-devel] [PATCH 30/35] qemu-ga: switch to the new error format on the wire

2012-08-10 Thread Luiz Capitulino
n|reboot" } } } qemu-ga now returns: { "error": { "class": "GenericError", "desc": "Parameter 'mode' expects halt|powerdown|reboot" } } Notice that this is also a bug fix, as qemu-ga wasn't returning the human mess

[Qemu-devel] [PATCH 32/35] error, qerror: pass desc string to error calls

2012-08-10 Thread Luiz Capitulino
function receive a human message instead and the qobject is not built anymore. Signed-off-by: Luiz Capitulino --- error.c | 3 +- error.h | 10 ++--- qerror.c | 42 +-- qerror.h | 141 +++ 4 files changed, 77

[Qemu-devel] [PATCH 11/35] qmp: query-block: add 'encryption_key_missing' field

2012-08-10 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- block.c | 1 + qapi-schema.json | 9 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 24323c1..016858b 100644 --- a/block.c +++ b/block.c @@ -2445,6 +2445,7 @@ BlockInfoList *qmp_query_block(Error **errp

[Qemu-devel] [PATCH 17/35] block: block_int: include qerror.h

2012-08-10 Thread Luiz Capitulino
Several block/ files are relying on qerror.h being provided by qapi-types.h. Fix this, as a future commit will change qapi-types.h not to provide qerror.h. Signed-off-by: Luiz Capitulino --- block_int.h | 1 + 1 file changed, 1 insertion(+) diff --git a/block_int.h b/block_int.h index 6c1d9ca

[Qemu-devel] [PATCH 16/35] qerror: drop QERR_SOCKET_CONNECT_IN_PROGRESS

2012-08-10 Thread Luiz Capitulino
Unused since last commit. Signed-off-by: Luiz Capitulino --- qerror.c | 4 qerror.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/qerror.c b/qerror.c index 5d38428..452ec69 100644 --- a/qerror.c +++ b/qerror.c @@ -309,10 +309,6 @@ static const QErrorStringTable qerror_table

[Qemu-devel] [PATCH 07/35] qerror: QError: drop file, linenr, func

2012-08-10 Thread Luiz Capitulino
They have never been fully used and conflict with future error improvements. Also makes qerror_report() a proper function, as there's no point in having it as a macro anymore. Signed-off-by: Luiz Capitulino --- qerror.c | 20 +++- qerror.h | 8 +--- 2 files chang

Re: [Qemu-devel] [PATCH v3 00/35]: add new error format

2012-08-13 Thread Luiz Capitulino
On Sat, 11 Aug 2012 09:05:33 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > [...] > > This series implements the 'Plan for error handling in QMP' as described > > by Anthony in this email: > > > > http://lists.gnu.org/ar

  1   2   3   4   5   6   7   8   9   10   >