From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH 3/3 V2] kvm tools: Add cmdline options for loading multiple images Date: Wed, 04 May 2011 22:38:53 +0300 Message-ID: <1304537933.30916.1.camel@lappy> References: <1304516717-24512-1-git-send-email-levinsasha928@gmail.com> <1304516717-24512-4-git-send-email-levinsasha928@gmail.com> <4DC167E5.1020707@gmail.com> <1304521423.22299.8.camel@lappy> <4DC171C7.2060601@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: penberg@kernel.org, kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com To: David Ahern Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:52003 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380Ab1EDTjE (ORCPT ); Wed, 4 May 2011 15:39:04 -0400 Received: by wwa36 with SMTP id 36so1593464wwa.1 for ; Wed, 04 May 2011 12:39:03 -0700 (PDT) In-Reply-To: <4DC171C7.2060601@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2011-05-04 at 09:33 -0600, David Ahern wrote: > On 05/04/11 09:03, Sasha Levin wrote: > > On Wed, 2011-05-04 at 08:51 -0600, David Ahern wrote: > >> > >> On 05/04/11 07:45, Sasha Levin wrote: > >>> This is a simple cmdline addition to allow loading multiple images. > >>> perf's cmdline parser doesn't support having multiple args > >>> with the same name (i.e. --image --image ), so > >>> we have to choose either to extend the parser, or find a diiferent > >>> way to assign multiple images. > >>> > >>> Sample cmdline for loading 2 images: > >>> ./kvm run --image=image1.raw --readonly --image2=image2.raw --readonly2 > >> > >> syntax is getting a bit unwieldy. Why not use a scheme similar to qemu > >> and concatenate related arguments into one and handle multiple usages? > >> e.g., --image=image1.raw,ro --image=image2.raw,ro > > > > That'll probably how it'll end up being. Currently the cmdline parser > > doesn't support it and I didn't want to mix parser changes with > > virtio-blk patch. > > It's using the option parser from perf, so you need to change: > > OPT_STRING('i', "image", &image_filename, "image", "Disk image"), > > to OPT_CALLBACK and create a parser function specific to this input > argument. For example, checkout tools/perf/builtin-script.c, > parse_output_fields. > > The parser is specific to the image argument and hence should be a part > of this change set. > > David Thanks! -- Sasha.