qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu devel list <qemu-devel@nongnu.org>,
	Marcel Apfelbaum <marcel.a@redhat.com>
Subject: Re: [Qemu-devel] '-usb' regressed by 49d2e648 ("machine: remove qemu_machine_opts global list")
Date: Wed, 24 Dec 2014 12:03:32 +0100	[thread overview]
Message-ID: <549A9D84.4050702@redhat.com> (raw)
In-Reply-To: <549A87B0.7010002@redhat.com>

On 12/24/14 10:30, Paolo Bonzini wrote:
> 
> 
> On 23/12/2014 23:12, Laszlo Ersek wrote:
>> Apologies if this problem is known. After building qemu at ab0302ee:
>>
>> $ qemu-system-x86_64 -usb
>>
>> qemu-system-x86_64: util/qemu-option.c:387: qemu_opt_get_bool_helper: Assertion `opt->desc && opt->desc->type == QEMU_OPT_BOOL' failed.
> 
> Does this work?
> 
> diff --git a/util/qemu-option.c b/util/qemu-option.c
> index a708241..4f1f86a 100644
> --- a/util/qemu-option.c
> +++ b/util/qemu-option.c
> @@ -384,7 +384,7 @@ static bool qemu_opt_get_bool_helper(QemuOpts *opts,
> const char *name,
>          }
>          return ret;
>      }
> -    assert(opt->desc && opt->desc->type == QEMU_OPT_BOOL);
> +    assert(!opt->desc || opt->desc->type == QEMU_OPT_BOOL);
>      ret = opt->value.boolean;
>      if (del) {
>          qemu_opt_del_all(opts, name);
> @@ -420,7 +420,7 @@ static uint64_t qemu_opt_get_number_helper(QemuOpts
> *opts, const char *name,
>          }
>          return ret;
>      }
> -    assert(opt->desc && opt->desc->type == QEMU_OPT_NUMBER);
> +    assert(!opt->desc || opt->desc->type == QEMU_OPT_NUMBER);
>      ret = opt->value.uint;
>      if (del) {
>          qemu_opt_del_all(opts, name);
> @@ -457,7 +457,7 @@ static uint64_t qemu_opt_get_size_helper(QemuOpts
> *opts, const char *name,
>          }
>          return ret;
>      }
> -    assert(opt->desc && opt->desc->type == QEMU_OPT_SIZE);
> +    assert(!opt->desc || opt->desc->type == QEMU_OPT_SIZE);
>      ret = opt->value.uint;
>      if (del) {
>          qemu_opt_del_all(opts, name);

Tested-by: Laszlo Ersek <lersek@redhat.com>

Thanks!
Laszlo

  parent reply	other threads:[~2014-12-24 11:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 22:12 [Qemu-devel] '-usb' regressed by 49d2e648 ("machine: remove qemu_machine_opts global list") Laszlo Ersek
2014-12-24  9:30 ` Paolo Bonzini
2014-12-24  9:51   ` Gonglei
2014-12-24 11:03   ` Laszlo Ersek [this message]
2014-12-24 11:55     ` Paolo Bonzini
2014-12-24 11:45 ` Marcel Apfelbaum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=549A9D84.4050702@redhat.com \
    --to=lersek@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).