From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uum8L-0007Pl-Lm for qemu-devel@nongnu.org; Thu, 04 Jul 2013 12:11:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uum8K-0002ZT-Qn for qemu-devel@nongnu.org; Thu, 04 Jul 2013 12:11:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uum8K-0002ZP-IP for qemu-devel@nongnu.org; Thu, 04 Jul 2013 12:11:48 -0400 From: Markus Armbruster References: <1372943363-24081-1-git-send-email-armbru@redhat.com> <1372943363-24081-4-git-send-email-armbru@redhat.com> <87fvvuz7td.fsf@blackfin.pond.sub.org> Date: Thu, 04 Jul 2013 18:11:45 +0200 In-Reply-To: (Peter Maydell's message of "Thu, 4 Jul 2013 16:11:08 +0100") Message-ID: <87r4fepany.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 3/7] vl: New qemu_get_machine_opts() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org Peter Maydell writes: > On 4 July 2013 16:03, Markus Armbruster wrote: >> Peter Maydell writes: >>> This looks a bit odd -- why are we creating new >>> options in a function that claims to only be querying >>> them? >> >> So we never return null. If it bothers you, I can initialize the >> options to empty somewhere else, and assert they exist here. > > The other option would be to modify qemu_opt_get and > friends to accept a NULL QemuOpts* as meaning "return > the default". I considered it, but it's more involved, and it'll sweep accidental null opts arguments under the carpet (not sure that's worth worrying about). > That seems cleaner to me than having > "machine" opts be a special case. "machine" opts are a special case, because unlike most options, they're a singleton. Anyway, what do you guys want me to do? (1) Create empty machine options on the fly (this is what the current patch does) (2) Initialize machine options elsewhere (3) Make QemuOpts consistently treat NULL like empty options (possibly quite some work) I don't mind (1) or (2), but (3) feels like a bit more than I bargained for. I just want to fix the bug that bit me, not rework QemuOpts.