[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2] add --cache, --serial, --sharable and --pciaddress options(was Re: [PATCH 1/3] add --cache option for attach-disk)



On Tue, Jul 12, 2011 at 03:47:36PM +0800, Hu Tao wrote:
> On Tue, Jul 05, 2011 at 11:58:31AM -0600, Eric Blake wrote:
> > On 07/05/2011 01:25 AM, Hu Tao wrote:
> > > Add --cache option to allow user to specify cache mode of disk device
> > > from virsh command line when attaching a disk device.
> > > ---
> > >  tools/virsh.c   |   10 ++++++++--
> > >  tools/virsh.pod |    5 +++--
> > >  2 files changed, 11 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/tools/virsh.c b/tools/virsh.c
> > > index 9a189fd..cab5a35 100644
> > > --- a/tools/virsh.c
> > > +++ b/tools/virsh.c
> > > @@ -10176,6 +10176,7 @@ static const vshCmdOptDef opts_attach_disk[] = {
> > >      {"target",  VSH_OT_DATA, VSH_OFLAG_REQ, N_("target of disk device")},
> > >      {"driver",    VSH_OT_STRING, 0, N_("driver of disk device")},
> > >      {"subdriver", VSH_OT_STRING, 0, N_("subdriver of disk device")},
> > > +    {"cache",     VSH_OT_STRING, 0, N_("cache mode of disk device")},
> > 
> > Nice.
> > 
> > >  
> > > +    ignore_value(vshCommandOptString(cmd, "cache", &cache));
> > 
> > Not so nice.
> > 
> > --cache ''
> > 
> > will make vshCommandOptString return -1, because that usage is a virsh
> > usage error and should be diagnosed as such up front, rather than
> > accidentally passing cache='' through the XML to the libvirt API.
> 
> I found that in the case of --cache '' vshCommandOptString returns 0,
> with cache(3rd parameter) unchanged. So can we safely ignore value or do
> I miss something?
> 
> This v2 also adds another new option, --pciaddress.
> 
> >From 3e3473baf24f1b6ff014cc26f05271a2da87d12e Mon Sep 17 00:00:00 2001
> From: Hu Tao <hutao cn fujitsu com>
> Date: Tue, 12 Jul 2011 15:19:42 +0800
> Subject: [PATCH] add --cache, --serial, --sharable and --pciaddress options
>  for attach-disk
> 
> This add three options for virsh command attach-disk.
> 
> --cache option allows user to specify cache mode of disk device
> from virsh command line when attaching a disk device.
> 
> --serial option allows user to specify serial string of disk device
> from virsh command line when attaching a disk device.
> 
> --sharable option allows user to specify whether the disk device is
> sharable between domains when attaching a disk device from virsh
> command line.
> 
> --pciaddress option allows user to specify pci address of disk
> controller when attaching a disk device.

"--pciaddress" would only be useful for certain types of disks
which are directly attached to the PCI bus. it wouldn't work
for IDE, SCSI or USB.  IMHO we should have a more general
'--address' argument which takes a formatted string

   '--address pci:1.2.3.4'
   '--address ide:1.2'
   '--address scsi:1.2.3'

etc,

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]