Message ID | 1334180081-6172-15-git-send-email-pbonzini@redhat.com |
---|---|
State | New |
Headers | show |
On 04/11/2012 04:34 PM, Paolo Bonzini wrote: > 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<pbonzini@redhat.com> This breaks qemu-test. Specifically: out=`hmp netdev_add user,id=foo` Fails with an error in QemuOpts parsing. Regards, Anthony Liguori > --- > 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) {
> This breaks qemu-test. Specifically: > > out=`hmp netdev_add user,id=foo` > > Fails with an error in QemuOpts parsing. Ok, I'll take a look and work on top of Luiz's netdev patches when I come back from holiday. Are you applying the non-problematic patches to 1.1, or even only the first 11? Paolo
On 04/26/2012 11:56 AM, Paolo Bonzini wrote: >> This breaks qemu-test. Specifically: >> >> out=`hmp netdev_add user,id=foo` >> >> Fails with an error in QemuOpts parsing. > > Ok, I'll take a look and work on top of Luiz's netdev patches > when I come back from holiday. > > Are you applying the non-problematic patches to 1.1, or even > only the first 11? I had tried to do a subset of them but I ran into another SEGV. I ended up dropping them. If I get some time, I'll try to test again and find a working subset. Regards, Anthony Liguori > > Paolo
Il 26/04/2012 20:03, Anthony Liguori ha scritto: >> >> Ok, I'll take a look and work on top of Luiz's netdev patches >> when I come back from holiday. >> >> Are you applying the non-problematic patches to 1.1, or even >> only the first 11? > > I had tried to do a subset of them but I ran into another SEGV. I ended > up dropping them. > > If I get some time, I'll try to test again and find a working subset. Since my time is also (voluntarily :)) limited, let's postpone to 1.2. You have enough work... Paolo
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) {
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 <pbonzini@redhat.com> --- qemu-option.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)