From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTA0L-0007EZ-MM for qemu-devel@nongnu.org; Tue, 21 Jul 2009 03:43:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTA0H-00079W-SP for qemu-devel@nongnu.org; Tue, 21 Jul 2009 03:43:17 -0400 Received: from [199.232.76.173] (port=37545 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTA0H-00079O-MA for qemu-devel@nongnu.org; Tue, 21 Jul 2009 03:43:13 -0400 Received: from mx20.gnu.org ([199.232.41.8]:61087) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTA0H-0000jz-4n for qemu-devel@nongnu.org; Tue, 21 Jul 2009 03:43:13 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MTA0G-000260-F1 for qemu-devel@nongnu.org; Tue, 21 Jul 2009 03:43:12 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6L7hB7E016736 for ; Tue, 21 Jul 2009 03:43:11 -0400 Message-ID: <4A657148.9050106@redhat.com> Date: Tue, 21 Jul 2009 09:42:00 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v3 4/5] QemuOpts: framework for storing and parsing options. References: <1247756224-19219-1-git-send-email-kraxel@redhat.com> <1247756224-19219-5-git-send-email-kraxel@redhat.com> <4A602234.50208@redhat.com> <4A656D74.1010409@redhat.com> In-Reply-To: <4A656D74.1010409@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann schrieb: > On 07/17/09 09:03, Kevin Wolf wrote: >> Gerd Hoffmann schrieb: >>> 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. >> What about having the options typed like I did in qemu-option.[ch]? > > Oh, I didn't see that. I just looked at the (old) parsing code in vl.c > uses by almost everybody. Actually, some parts of this parsing code have moved to qemu-option.c. Probably they should all be moved (or replaced), but I did it only for the functions I needed in qemu-img. >> In general qemu-option seems to do more parsing/checking than QemuOpts >> does, on the other hand it's not yet generic enough to suit everything. >> Maybe a combination of both would be the right thing? > > I'll have a closer look. Who uses qemu-options? qemu-io I assume? It's currently only used for image creation. Since recently, image formats can provide driver specific options. You can find the call to the parser in qemu-img.c in img_create() and img_check(). The definition of the supported options are usually at the end of the block driver source file. Kevin