aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-02-26 12:16:46 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-02-26 12:16:46 +0000
commit041ccc922ee474693a2869d4e3b59e920c739bc0 (patch)
tree36b046a650b26079b3cbf634ee9ae8fe19384319
parent2559db069628981bfdc90637fac5bf1b4f4e8ef5 (diff)
parent912ae9c88669d0a0cbae1f20b8c80dde8e526251 (diff)
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp: qapi-types: add C99 index names to arrays monitor: Fix missing err = NULL in client_migrate_info() balloon: Fix typo hmp: Fix warning from smatch (wrong argument in function call) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--balloon.c6
-rw-r--r--hmp.c2
-rw-r--r--monitor.c3
-rw-r--r--scripts/qapi-types.py11
4 files changed, 13 insertions, 9 deletions
diff --git a/balloon.c b/balloon.c
index dea19a470a..70c00f5f84 100644
--- a/balloon.c
+++ b/balloon.c
@@ -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;
}
diff --git a/hmp.c b/hmp.c
index 12064096b9..735097c03b 100644
--- a/hmp.c
+++ b/hmp.c
@@ -412,7 +412,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;
}
diff --git a/monitor.c b/monitor.c
index 4f941e6d67..41900dad20 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1094,12 +1094,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;
}
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 1eb272dd26..db872180c6 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -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):