aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-03-26 09:28:24 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-03-26 09:28:24 +0000
commit199f8d94be106f20dfce23fa4e157fc8d55fd494 (patch)
tree3447e0b2a1b449b5c79fa99db95fd71451b614f1
parent4aef51963924fd58ffe88daebbe8055a360d7c10 (diff)
parent413aeacd4b33f341472c153b18eeb5ff3a70239a (diff)
downloadqemu-199f8d94be106f20dfce23fa4e157fc8d55fd494.zip
qemu-199f8d94be106f20dfce23fa4e157fc8d55fd494.tar.gz
qemu-199f8d94be106f20dfce23fa4e157fc8d55fd494.tar.bz2
Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2019-03-26' into staging
Miscellaneous patches for 2019-03-26 # gpg: Signature made Tue 26 Mar 2019 07:10:23 GMT # gpg: using RSA key 3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-misc-2019-03-26: qapi/qmp-dispatch: fix return value in do_qmp_dispatch json: Fix off-by-one assert check in next_state() xen-block: Replace qdict_put_obj() by qdict_put() where appropriate util/error: Remove an unnecessary NULL check Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/block/xen-block.c4
-rw-r--r--qapi/qmp-dispatch.c2
-rw-r--r--qobject/json-lexer.c2
-rw-r--r--util/error.c4
4 files changed, 4 insertions, 8 deletions
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 70fc245..9c722b9 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -771,7 +771,7 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
QDict *cache_qdict = qdict_new();
qdict_put_bool(cache_qdict, "direct", true);
- qdict_put_obj(file_layer, "cache", QOBJECT(cache_qdict));
+ qdict_put(file_layer, "cache", cache_qdict);
qdict_put_str(file_layer, "aio", "native");
}
@@ -796,7 +796,7 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
qdict_put_str(driver_layer, "driver", driver);
g_free(driver);
- qdict_put_obj(driver_layer, "file", QOBJECT(file_layer));
+ qdict_put(driver_layer, "file", file_layer);
g_assert(!drive->node_name);
drive->node_name = xen_block_blockdev_add(drive->id, driver_layer,
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 5f812bb..e2c366e 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -111,7 +111,7 @@ static QObject *do_qmp_dispatch(QmpCommandList *cmds, QObject *request,
if (oob && !(cmd->options & QCO_ALLOW_OOB)) {
error_setg(errp, "The command %s does not support OOB",
command);
- return false;
+ return NULL;
}
if (runstate_check(RUN_STATE_PRECONFIG) &&
diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c
index a7df209..632320d 100644
--- a/qobject/json-lexer.c
+++ b/qobject/json-lexer.c
@@ -266,7 +266,7 @@ static inline uint8_t next_state(JSONLexer *lexer, char ch, bool flush,
{
uint8_t next;
- assert(lexer->state <= ARRAY_SIZE(json_lexer));
+ assert(lexer->state < ARRAY_SIZE(json_lexer));
next = json_lexer[lexer->state][(uint8_t)ch];
*char_consumed = !flush && !(next & LOOKAHEAD);
return next & ~LOOKAHEAD;
diff --git a/util/error.c b/util/error.c
index b5ccbd8..934a78e 100644
--- a/util/error.c
+++ b/util/error.c
@@ -103,10 +103,6 @@ void error_setg_errno_internal(Error **errp,
va_list ap;
int saved_errno = errno;
- if (errp == NULL) {
- return;
- }
-
va_start(ap, fmt);
error_setv(errp, src, line, func, ERROR_CLASS_GENERIC_ERROR, fmt, ap,
os_errno != 0 ? strerror(os_errno) : NULL);