summaryrefslogtreecommitdiff
path: root/qobject/qdict.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-02-24 15:00:51 +0000
committerPeter Maydell <peter.maydell@linaro.org>2017-02-24 15:00:51 +0000
commitfe8ee082db5038a05dbd8872e946049e9a9c550e (patch)
tree08196bf3cf3c278b6f8fcf51a91affb87b45162f /qobject/qdict.c
parent63f495beb4007de5444614125fd6fd178ca6e2b1 (diff)
parent7c81e4e9db5f63635fbf11d66bf08e73d325ae97 (diff)
downloadqemu-fe8ee082db5038a05dbd8872e946049e9a9c550e.tar.gz
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-02-22' into staging
QAPI patches for 2017-02-22 # gpg: Signature made Wed 22 Feb 2017 19:12:27 GMT # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2017-02-22: block: Don't bother asserting type of output visitor's output monitor: Clean up handle_hmp_command() a bit tests: Don't check qobject_type() before qobject_to_qbool() tests: Don't check qobject_type() before qobject_to_qfloat() tests: Don't check qobject_type() before qobject_to_qint() tests: Don't check qobject_type() before qobject_to_qstring() tests: Don't check qobject_type() before qobject_to_qlist() Don't check qobject_type() before qobject_to_qdict() test-qmp-event: Simplify and tighten event_test_emit() libqtest: Clean up qmp_response() a bit check-qjson: Simplify around compare_litqobj_to_qobj() check-qdict: Tighten qdict_crumple_test_recursive() some check-qdict: Simplify qdict_crumple_test_recursive() qdict: Make qdict_get_qlist() safe like qdict_get_qdict() net: Flatten simple union NetLegacyOptions numa: Flatten simple union NumaOptions Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qobject/qdict.c')
-rw-r--r--qobject/qdict.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 197b0fbd47..b0c5364506 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -178,20 +178,6 @@ size_t qdict_size(const QDict *qdict)
}
/**
- * qdict_get_obj(): Get a QObject of a specific type
- */
-static QObject *qdict_get_obj(const QDict *qdict, const char *key, QType type)
-{
- QObject *obj;
-
- obj = qdict_get(qdict, key);
- assert(obj != NULL);
- assert(qobject_type(obj) == type);
-
- return obj;
-}
-
-/**
* qdict_get_double(): Get an number mapped by 'key'
*
* This function assumes that 'key' exists and it stores a
@@ -241,25 +227,15 @@ bool qdict_get_bool(const QDict *qdict, const char *key)
}
/**
- * qdict_get_qlist(): Get the QList mapped by 'key'
- *
- * This function assumes that 'key' exists and it stores a
- * QList object.
- *
- * Return QList mapped by 'key'.
+ * qdict_get_qlist(): If @qdict maps @key to a QList, return it, else NULL.
*/
QList *qdict_get_qlist(const QDict *qdict, const char *key)
{
- return qobject_to_qlist(qdict_get_obj(qdict, key, QTYPE_QLIST));
+ return qobject_to_qlist(qdict_get(qdict, key));
}
/**
- * qdict_get_qdict(): Get the QDict mapped by 'key'
- *
- * This function assumes that 'key' exists and it stores a
- * QDict object.
- *
- * Return QDict mapped by 'key'.
+ * qdict_get_qdict(): If @qdict maps @key to a QDict, return it, else NULL.
*/
QDict *qdict_get_qdict(const QDict *qdict, const char *key)
{