diff options
| author | Chunyan Liu | 2014-06-05 11:20:44 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2014-06-16 11:23:20 +0200 |
| commit | dc8622f2bf9174cd42932ad86bcc98c6f7c98832 (patch) | |
| tree | 14e4d35b5b4bd428a0c0206d8200c31314f5fe7e /util/qemu-option.c | |
| parent | qapi: output def_value_str when query command line options (diff) | |
| download | qemu-dc8622f2bf9174cd42932ad86bcc98c6f7c98832.tar.gz qemu-dc8622f2bf9174cd42932ad86bcc98c6f7c98832.tar.xz qemu-dc8622f2bf9174cd42932ad86bcc98c6f7c98832.zip | |
QemuOpts: change opt->name|str from (const char *) to (char *)
qemu_opt_del() already assumes that all QemuOpt instances contain
malloc'd name and value; but it had to cast away const because
opts_start_struct() was doing its own thing and using static storage
instead. By using the correct type and malloced strings everywhere, the
usage of this struct becomes clearer.
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Leandro Dorileo <l@dorileo.org>
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'util/qemu-option.c')
| -rw-r--r-- | util/qemu-option.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/qemu-option.c b/util/qemu-option.c index 5af39a2f18..d4fd7b5f35 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -664,8 +664,8 @@ static void qemu_opt_parse(QemuOpt *opt, Error **errp) static void qemu_opt_del(QemuOpt *opt) { QTAILQ_REMOVE(&opt->opts->head, opt, next); - g_free((/* !const */ char*)opt->name); - g_free((/* !const */ char*)opt->str); + g_free(opt->name); + g_free(opt->str); g_free(opt); } |
