From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48162 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLzDR-0003Vf-CM for qemu-devel@nongnu.org; Tue, 08 Jun 2010 09:51:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLz6v-0007uO-1N for qemu-devel@nongnu.org; Tue, 08 Jun 2010 09:45:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29613) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLz6u-0007tr-Pn for qemu-devel@nongnu.org; Tue, 08 Jun 2010 09:44:56 -0400 Message-ID: <4C0E4952.3040209@redhat.com> Date: Tue, 08 Jun 2010 15:44:50 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 01/22] QemuOpts: fix a bug in QemuOpts when setting an option twice 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> <4C0E1C3B.9020701@redhat.com> <4C0E4096.9020705@codemonkey.ws> In-Reply-To: <4C0E4096.9020705@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , Glauber Costa , qemu-devel@nongnu.org On 06/08/10 15:07, Anthony Liguori wrote: >>> 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? > > The problem I was trying to address can be seen with something like: > > -drive file=foo.img,if=virtio,file=bar.img > > You get no error, and foo.img is what gets used. Hmm. I think qemuopts need to carry information about the option types, whenever it is single-entry or multiple-entry. Oh, and likewise for the sections. With multiple (unnamed) [device] sections we want create multiple (id-less) device sections. With multiple [machine] sections we probably want to merge the options instead. > Or more specifically: > > foo.conf: > > [drive] > file=foo.img > if=virtio > id=bar This would be '[drive "bar"]' without id= line btw. > qemu -readconfig foo.conf -drive file=bar.img,id=bar > IMHO, what's specified next on the command line ought to override what's > in the config. Or the user's config the global config. For multi-entry options this will be tricky. What do you expect to happen here: global.conf [net "user"] type="slirp" guestfwd= user.conf [net "user"] guestfwd= guestfwd= Which forwardings will be active then? All of them? Or will the user.conf forwardings override the global one? cheers, Gerd