QemuOpts would parse incorrectly something that included ",,id=" (with an escaped comma) in a parameter value. Fix this by using get_param_value.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- qemu-option.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/qemu-option.c b/qemu-option.c index 7a89eeb..63759b0 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -864,17 +864,12 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params, { const char *firstname; char value[1024], *id = NULL; - const char *p; QemuOpts *opts; assert(!permit_abbrev || list->implied_opt_name); firstname = permit_abbrev ? list->implied_opt_name : NULL; - if (strncmp(params, "id=", 3) == 0) { - get_opt_value(value, sizeof(value), params+3); - id = value; - } else if ((p = strstr(params, ",id=")) != NULL) { - get_opt_value(value, sizeof(value), p+4); + if (get_param_value(value, sizeof(value), "id", params)) { id = value; } if (defaults) { -- 1.7.9.1