From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRW2d-0006Du-6J for qemu-devel@nongnu.org; Thu, 16 Jul 2009 14:50:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRW2Y-0006AU-Fu for qemu-devel@nongnu.org; Thu, 16 Jul 2009 14:50:50 -0400 Received: from [199.232.76.173] (port=59942 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRW2Y-0006AJ-B3 for qemu-devel@nongnu.org; Thu, 16 Jul 2009 14:50:46 -0400 Received: from mx2.redhat.com ([66.187.237.31]:41634) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MRW2X-0003Zu-3D for qemu-devel@nongnu.org; Thu, 16 Jul 2009 14:50:45 -0400 Message-ID: <4A5F767F.5050808@redhat.com> Date: Thu, 16 Jul 2009 20:50:39 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1247756224-19219-1-git-send-email-kraxel@redhat.com> <1247756224-19219-5-git-send-email-kraxel@redhat.com> <4A5F56D4.7050900@siemens.com> In-Reply-To: <4A5F56D4.7050900@siemens.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v3 4/5] QemuOpts: framework for storing and parsing options. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On 07/16/09 18:35, Jan Kiszka wrote: > Gerd Hoffmann wrote: >> This stores device parameters in a better way than unparsed strings. >> >> New types: >> QemuOpt - one key-value pair. >> QemuOpts - group of key-value pairs, belonging to one >> device, i.e. one drive. >> QemuOptsList - list of some kind of devices, i.e. all drives. >> >> Functions are provided to work with these types. The plan is that some >> day we will pass around QemuOpts pointers instead of strings filled with >> "key1=value1,key2=value2". > > Will this also be able to handle the "-net[,options=...]" special > case? Then it would be really great and could save us a lot of ugly code. I don't see fundamental problems, I've tried to make it generic enough that it can fit for everything. If it doesn't we should fix it ;) I think we could either have a additional 'type' field added to QemuOpts, or we use a separate QemuOptsList for each net type. I'd tend to use the separate list approach because the list of valid options is linked to QemuOptsList, and each net type has a different set of options. cheers, Gerd