diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-04-15 09:49:26 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-04-29 08:01:52 +0200 |
commit | 80c710cb06ff40b45de033e4352528b3adcd2de9 (patch) | |
tree | 75705e97e3babe95842ebeb51818a4f6fdc5d6f1 /include/qemu | |
parent | 6d2b5cbafb8fb4bb3563cbf698b3a0903a993d7a (diff) | |
download | qemu-80c710cb06ff40b45de033e4352528b3adcd2de9.zip qemu-80c710cb06ff40b45de033e4352528b3adcd2de9.tar.gz qemu-80c710cb06ff40b45de033e4352528b3adcd2de9.tar.bz2 |
qemu-img: Move is_valid_option_list() to qemu-img.c and rewrite
is_valid_option_list()'s purpose is ensuring qemu-img.c's can safely
join multiple parameter strings separated by ',' like this:
g_strdup_printf("%s,%s", params1, params2);
How it does that is anything but obvious. A close reading of the code
reveals that it fails exactly when its argument starts with ',' or
ends with an odd number of ','. Makes sense, actually, because when
the argument starts with ',', a separating ',' preceding it would get
escaped, and when it ends with an odd number of ',', a separating ','
following it would get escaped.
Move it to qemu-img.c and rewrite it the obvious way.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200415074927.19897-9-armbru@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r-- | include/qemu/option.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/qemu/option.h b/include/qemu/option.h index 844587c..eb40978 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -33,7 +33,6 @@ const char *get_opt_value(const char *p, char **value); void parse_option_size(const char *name, const char *value, uint64_t *ret, Error **errp); bool has_help_option(const char *param); -bool is_valid_option_list(const char *param); enum QemuOptType { QEMU_OPT_STRING = 0, /* no parsing (use string as-is) */ |