[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 37/54] qemu-config: Sections must consist of keys
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 37/54] qemu-config: Sections must consist of keys |
Date: |
Fri, 21 Feb 2014 23:12:34 +0100 |
From: Max Reitz <address@hidden>
In config_parse_qdict_section(), the QList returned by
qdict_array_split() is assumed to only contain QDicts. Currently, this
is true but it may (and will) change in the future. Therefore, check
whether the assumption actually holds.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
util/qemu-config.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 797df71..f610101 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -413,6 +413,12 @@ static void config_parse_qdict_section(QDict *options,
QemuOptsList *opts,
QDict *section = qobject_to_qdict(qlist_entry_obj(list_entry));
char *opt_name;
+ if (!section) {
+ error_setg(errp, "[%s] section (index %u) does not consist of "
+ "keys", opts->name, i);
+ goto out;
+ }
+
opt_name = g_strdup_printf("%s.%u", opts->name, i++);
subopts = qemu_opts_create(opts, opt_name, 1, &local_err);
g_free(opt_name);
--
1.8.1.4
- [Qemu-devel] [PULL 27/54] vmdk: do not try opening a file as both image and descriptor, (continued)
- [Qemu-devel] [PULL 27/54] vmdk: do not try opening a file as both image and descriptor, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 28/54] vmdk: correctly propagate errors, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 29/54] block: do not abuse EMEDIUMTYPE, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 30/54] vdi: say why an image is bad, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 31/54] qemu-option: has_help_option() and is_valid_option_list(), Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 32/54] qemu-img create: Support multiple -o options, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 33/54] qemu-img convert: Support multiple -o options, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 34/54] qemu-img amend: Support multiple -o options, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 35/54] qemu-img: Allow -o help with incomplete argument list, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 36/54] qemu-iotests: Check qemu-img command line parsing, Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 37/54] qemu-config: Sections must consist of keys,
Kevin Wolf <=
- [Qemu-devel] [PULL 38/54] qdict: Extract non-QDicts in qdict_array_split(), Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 41/54] quorum: Create quorum.c, add QuorumChildRequest and QuorumAIOCB., Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 42/54] quorum: Create BDRVQuorumState and BlkDriver and do init., Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 43/54] quorum: Add quorum_aio_writev and its dependencies., Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 40/54] check-qdict: Test termination of qdict_array_split(), Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 39/54] check-qdict: Adjust test for qdict_array_split(), Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 44/54] blkverify: Extract qemu_iovec_clone() and qemu_iovec_compare() from blkverify., Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 45/54] quorum: Add quorum_aio_readv., Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 46/54] quorum: Add quorum mechanism., Kevin Wolf, 2014/02/21
- [Qemu-devel] [PULL 48/54] quorum: Add quorum_invalidate_cache()., Kevin Wolf, 2014/02/21