Received: from eggs.gnu.org ([2001:4830:134:3::10]:39941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVfwT-0007wh-6o for qemu-devel@nongnu.org; Wed, 11 Mar 2015 08:40:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVfwP-0000tV-3n for qemu-devel@nongnu.org; Wed, 11 Mar 2015 08:40:53 -0400 Received: from mail-qg0-x22f.google.com ([2607:f8b0:400d:c04::22f]:33694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVfwO-0000tL-Vn for qemu-devel@nongnu.org; Wed, 11 Mar 2015 08:40:49 -0400 Received: by qgef51 with SMTP id f51so9519557qge.0 for ; Wed, 11 Mar 2015 05:40:48 -0700 (PDT) Date: Wed, 11 Mar 2015 08:40:46 -0400 From: "Gabriel L. Somlo" Message-ID: <20150311124045.GP1832@HEDWIG.INI.CMU.EDU> References: <20150309175036.GK1832@HEDWIG.INI.CMU.EDU> <877fup1c0m.fsf@blackfin.pond.sub.org> <20150310173504.GM1832@HEDWIG.INI.CMU.EDU> <87oao0rmxp.fsf@blackfin.pond.sub.org> <20150311115940.GF6628@noname.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150311115940.GF6628@noname.str.redhat.com> Subject: Re: [Qemu-devel] help parsing qemu options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Markus Armbruster , qemu-devel@nongnu.org On Wed, Mar 11, 2015 at 12:59:40PM +0100, Kevin Wolf wrote: > > def_value_str exists in the current codebase, and it seems to take > precedence when a different default is specified by the caller. So I've now added .def_value_str fields: static QemuOptsList qemu_foo_opts = { .name = "foo", .head = QTAILQ_HEAD_INITIALIZER(qemu_foo_opts.head), .desc = { { .name = "name", .type = QEMU_OPT_STRING, .def_value_str = "abc", }, { .name = "file", .type = QEMU_OPT_STRING, .def_value_str = "xyz", }, { /* end of list */ } }, }; but "-foo name,file" still results in qemu_opt_get(opts, "name") returning "on", rather than "abc". Is that a bug, or am I missing something, or doing something wrong ? Thanks, --Gabriel