[libvirt] [PATCH 5/5] Add new domblkinfo command to virsh
Daniel P. Berrange
berrange at redhat.com
Wed Apr 28 10:59:33 UTC 2010
On Tue, Apr 27, 2010 at 05:00:22PM -0600, Eric Blake wrote:
> On 04/27/2010 01:35 PM, Daniel P. Berrange wrote:
> > virsh # domblkinfo demoguest /dev/hda2
> > Capacity: 1048576000
> > Allocation: 104857600
> > Physical: 104857600
> >
> > * tools/virsh.c: Implement domblkinfo command mapping to the
> > new virDomainGetBlockInfo API
>
> And the changes to tools/virsh.pod?
>
> > /*
> > + * "domblkinfo" command
> > + */
> > +static const vshCmdInfo info_domblkinfo[] = {
> > + {"help", N_("domain information")},
> > + {"desc", N_("Returns basic information about the domain.")},
>
> Seems like too much copy and paste from dominfo. Maybe:
>
> Returns information about a block device used by the domain.
Yeah, I was rather fast & loose with this patch :-)
>
> > +static const vshCmdOptDef opts_domblkinfo[] = {
> > + {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
> > + {"device", VSH_OT_DATA, VSH_OFLAG_REQ, N_("block device")},
> > + {NULL, 0, 0, NULL}
> > +};
>
> Is there an easy way to query all of the block devices currently tied to
> a domain, so that it is possible to script a loop that calls domblkinfo
> for each of those devices? Or would we need to add a new command, maybe
> 'domblkinfo uuid --all', in addition to your implementation of
> 'domblkinfo uuid blk'.
To query all block devices, you want to do an xpath query on the guest
XML & then iterate on them. This is probably something worth doing, but
we can do it as a followup to apply to domblkstats and domifstats at the
same time.
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list