From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43295 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLw6m-0004Ho-4l for qemu-devel@nongnu.org; Tue, 08 Jun 2010 06:32:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLw6h-0006W1-66 for qemu-devel@nongnu.org; Tue, 08 Jun 2010 06:32:36 -0400 Received: from mail-ww0-f45.google.com ([74.125.82.45]:52985) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLw6h-0006Vr-1s for qemu-devel@nongnu.org; Tue, 08 Jun 2010 06:32:31 -0400 Received: by wwb13 with SMTP id 13so3343659wwb.4 for ; Tue, 08 Jun 2010 03:32:30 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4C0E1C3B.9020701@redhat.com> Date: Tue, 08 Jun 2010 12:32:27 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1275954730-8196-1-git-send-email-aliguori@us.ibm.com> <1275954730-8196-2-git-send-email-aliguori@us.ibm.com> <4C0DF69D.4040306@redhat.com> In-Reply-To: <4C0DF69D.4040306@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 01/22] QemuOpts: fix a bug in QemuOpts when setting an option twice List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Anthony Liguori , Glauber Costa , qemu-devel@nongnu.org On 06/08/2010 09:51 AM, Gerd Hoffmann wrote: > On 06/08/10 01:51, Anthony Liguori wrote: >> Right now, if you set a QemuOpts option in a section twice, when >> you get the option you'll receive the value that was set the first >> time. This is less than ideal because if you're manipulating >> options in two places like a global config followed by the command >> line, you really want the later to override the former. >> >> This patch fixes this behavior. > > Note that this reverses the ordering for users which want multiple > values (slirp forwarding for example). And qemu_opt_find seems to have thought about this too: static QemuOpt *qemu_opt_find(QemuOpts *opts, const char *name) { QemuOpt *opt; QTAILQ_FOREACH_REVERSE(opt, &opts->head, QemuOptHead, next) { if (strcmp(opt->name, name) != 0) continue; return opt; } return NULL; } Can you show the behavior with commandline arguments only? Paolo