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>
This commit is contained in:
Chunyan Liu
2014-06-05 17:20:44 +08:00
committed by Stefan Hajnoczi
parent e36af94f86
commit dc8622f2bf
3 changed files with 11 additions and 7 deletions

View File

@@ -30,8 +30,8 @@
#include "qemu/error-report.h"
struct QemuOpt {
const char *name;
const char *str;
char *name;
char *str;
const QemuOptDesc *desc;
union {