[libvirt] [PATCH]: Rework xenLinuxDomainDeviceID to support more devices

Chris Lalancette clalance at redhat.com
Tue Aug 5 10:12:21 UTC 2008


Recently upstream Xen added support for having xvd devices > 16.  For the most
part, this doesn't really concern libvirt, since for things like attach and
detach we just pass it through and let xend worry about whether it is supported
or not.  The one place this breaks down is in the stats collecting code, where
we need to figure out the device number so we can go digging in /sys for the
statistics.

To remedy this, I've re-written xenLinuxDomainDeviceID() to use regular
expressions to figure out the device number from the name.  The major advantage
is that now xenLinuxDomainDeviceID() looks fairly identical to
tools/python/xen/util/blkif.py (in the Xen sources), so that adding additional
devices in the future should be much easier.  It also reduces the size of the
code, and, in my opinion, the code complexity.

With this patch in place, I was able to get block statistics both on older style
devices (/dev/xvda) and on the new, expanded devices (/dev/xvdaa).

Signed-off-by: Chris Lalancette <clalance at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-stats-linux-expand.patch
Type: text/x-patch
Size: 9396 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080805/f847e2e2/attachment-0001.bin>


More information about the libvir-list mailing list