From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3kXA-0006Tl-1W for qemu-devel@nongnu.org; Wed, 24 Dec 2014 06:55:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y3kX9-0002tM-8T for qemu-devel@nongnu.org; Wed, 24 Dec 2014 06:55:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y3kX9-0002t7-0q for qemu-devel@nongnu.org; Wed, 24 Dec 2014 06:55:19 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBOBtIAp023283 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 24 Dec 2014 06:55:18 -0500 Message-ID: <549AA9A1.4020207@redhat.com> Date: Wed, 24 Dec 2014 12:55:13 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <5499E8D4.4010903@redhat.com> <549A87B0.7010002@redhat.com> <549A9D84.4050702@redhat.com> In-Reply-To: <549A9D84.4050702@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] '-usb' regressed by 49d2e648 ("machine: remove qemu_machine_opts global list") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: qemu devel list , Marcel Apfelbaum On 24/12/2014 12:03, Laszlo Ersek wrote: > 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 Hmm, it doesn't work though. parse_option_bool is not called. Something for new year I guess. Paolo