[Libvir] [PATCH] Block device and network stats (version 2)

Daniel P. Berrange berrange at redhat.com
Tue Aug 21 13:33:43 UTC 2007


On Tue, Aug 21, 2007 at 12:55:19PM +0100, John Levon wrote:
> On Tue, Aug 21, 2007 at 03:37:41AM +0100, Daniel P. Berrange wrote:
> 
> > The Xen impl as coded only works for disks named xvdN, because the code for
> > calculating device ID assumes xvdN device numbering scheme:
> > 
> >     device = 202 * 256 + minor;
> 
> What's with device numbering at all? Must we really repeat this crazy
> Linuxism from xend in libvirt :(

We need to convert from 'xvda'  into /local/domain/0/backend/vbd/[domid]/[device num]

where 'device num' is a crazy ass number XenD calculaties using the formula
above. The other option is to just iterate over every backend node comparing
the device name field. O(n) vs O(1) xenstore queries.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 




More information about the libvir-list mailing list