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>
This commit is contained in:
Peter Maydell 2015-02-26 12:16:46 +00:00
commit 041ccc922e
4 changed files with 13 additions and 9 deletions

View File

@ -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;
}

2
hmp.c
View File

@ -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;
}

View File

@ -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;
}

View File

@ -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):