QMP queue
The following changes since commit cd2d5541271f1934345d8ca42f5fafff1744eee7:
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20150212' into staging (2015-02-13 11:44:50 +0000)
are available in the git repository at:
git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
for you to fetch changes up to 912ae9c88669d0a0cbae1f20b8c80dde8e526251:
qapi-types: add C99 index names to arrays (2015-02-23 11:00:05 -0500)
----------------------------------------------------------------
Eric Blake (1):
balloon: Fix typo
Gonglei (1):
monitor: Fix missing err = NULL in client_migrate_info()
Michael S. Tsirkin (1):
qapi-types: add C99 index names to arrays
Stefan Weil (1):
hmp: Fix warning from smatch (wrong argument in function call)
balloon.c | 6 +++--- hmp.c | 2 +- monitor.c | 3 ++- scripts/qapi-types.py | 11 +++++++---- 4 files changed, 13 insertions(+), 9 deletions(-)
[Qemu-devel] [PULL 3/4] monitor: Fix missing err = NULL in client_migrate_info()
From: Gonglei <[email protected]>
When SPICE isn't used, we either fail an assertion in error_set(), or leak an error object. Broken in commit b25d81b.
--- monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
monitor.c +2 -1
@@ -1095,12 +1095,13 @@ static int client_migrate_info(Monitor *mon, const QDict *qdict,const char *subject =qdict_get_try_str (qdict,"cert-subject" );int port =qdict_get_try_int (qdict,"port" ,-1 );int tls_port =qdict_get_try_int (qdict,"tls-port" ,-1 ); -Error *err; +Error *err =NULL ;int ret;if (strcmp (protocol,"spice" ) ==0 ) {if (!qemu_using_spice (&err)) {qerror_report_err (err); +error_free (err);return -1 ; }
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 2/4] balloon: Fix typo
In reply to Luiz CapitulinoFrom: Eric Blake <[email protected]>
Commit 422e0501 introduced a typo (unless removing an 'o' from balloon is how you deflate it?)
--- balloon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
balloon.c +3 -3
@@ -36,7 +36,7 @@ static QEMUBalloonEvent *balloon_event_fn;static QEMUBalloonStatus *balloon_stat_fn;static void *balloon_opaque; -static bool have_ballon (Error **errp) +static bool have_balloon (Error **errp) {if (kvm_enabled () && !kvm_has_sync_mmu ()) { error_set(errp, ERROR_CLASS_KVM_MISSING_CAP,
@@ -81,7 +81,7 @@ BalloonInfo *qmp_query_balloon(Error **errp) {BalloonInfo *info; -if (!have_ballon (errp)) { +if (!have_balloon (errp)) {return NULL ; }
@@ -92,7 +92,7 @@ BalloonInfo *qmp_query_balloon(Error **errp)void qmp_balloon (int64_t target,Error **errp) { -if (!have_ballon (errp)) { +if (!have_balloon (errp)) {return ; }
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 1/4] hmp: Fix warning from smatch (wrong argument in function call)
In reply to Luiz CapitulinoFrom: Stefan Weil <[email protected]>
Fix this warning:
hmp.c:414:38: warning: Using plain integer as NULL pointer
qmp_query_block expects a pointer argument, so passing false is wrong.
--- hmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hmp.c +1 -1
@@ -411,7 +411,7 @@ void hmp_info_block(Monitor *mon, const QDict *qdict)/* Print BlockBackend information */ if (!nodes) { - block_list =qmp_query_block (false); + block_list =qmp_query_block (NULL ); }else { block_list =NULL ; }
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 4/4] qapi-types: add C99 index names to arrays
In reply to Luiz CapitulinoFrom: "Michael S. Tsirkin" <[email protected]>
It's not easy to figure out how monitor translates
strings: most QEMU code deals with translated indexes, these are translated using _lookup arrays,
so you need to find the array name, and find the appropriate offset.
This patch adds C99 indexes to lookup arrays, which makes it possible to find the correct key using simple grep, and see that the matching is correct at a glance.
Example:
Before:
const char *MigrationCapability_lookup[] = {
"xbzrle",
"rdma-pin-all",
"auto-converge",
"zero-blocks",
NULL,
};After:
const char *MigrationCapability_lookup[] = {
[MIGRATION_CAPABILITY_XBZRLE] = "xbzrle", [MIGRATION_CAPABILITY_RDMA_PIN_ALL] = "rdma-pin-all", [MIGRATION_CAPABILITY_AUTO_CONVERGE] = "auto-converge", [MIGRATION_CAPABILITY_ZERO_BLOCKS] = "zero-blocks", [MIGRATION_CAPABILITY_MAX] = NULL,
};
--- scripts/qapi-types.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
scripts/qapi-types.py +7 -4
@@ -123,16 +123,19 @@ const char *%(name)s_lookup[] = { name=name) i = 0 for value in values: + index = generate_enum_full_value(name, value) ret += mcgen(''' - "%(value)s", + [%(index)s] = "%(value)s", ''', - value=value) + index = index, value = value) + max_index = generate_enum_full_value(name, 'MAX') ret += mcgen(''' - NULL, + [%(max_index)s] = NULL, }; -''') +''', + max_index=max_index) return ret def generate_enum(name, values):
Signature · 1 line
1.9.3
Peter Maydell
AppliedQuoted 23 lines · Luiz Capitulino
The following changes since commit
cd2d5541271f1934345d8ca42f5fafff1744eee7:Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20150212' into staging (2015-02-13 11:44:50 +0000)
are available in the git repository at:
git://repo.or.cz/qemu/qmp-unstable.gitqueue/qmpfor you to fetch changes up to
912ae9c88669d0a0cbae1f20b8c80dde8e526251:qapi-types: add C99 index names to arrays (2015-02-23 11:00:05 -0500)
----------------------------------------------------------------
Eric Blake (1):
balloon: Fix typoGonglei (1):
monitor: Fix missing err = NULL inclient_migrate_info()Michael S. Tsirkin (1):
qapi-types: add C99 index names to arrays
Quoted 8 lines
Stefan Weil (1):
hmp: Fix warning from smatch (wrong argument in function call)balloon.c | 6 +++--- hmp.c | 2 +- monitor.c | 3 ++- scripts/qapi-types.py | 11 +++++++---- 4 files changed, 13 insertions(+), 9 deletions(-)
Applied, thanks.
-- PMM