On Thu, Sep 15, 2011 at 08:53:35AM +0100, Daniel P. Berrange wrote:
On Thu, Sep 15, 2011 at 03:31:48PM +0800, Hu Tao wrote:
> > > +
> > > +/**
> > > + * virDomainBlkioWeightDeviceParseXML
> > > + *
> > > + * this function parses a XML node:
> > > + *
> > > + * <device>
> > > + * <major>major</major>
> > > + * <minor>minor</minor>
> > > + * <weight>weight</weight>
> > > + * </device>
> > > + *
> > > + * and fills a virBlkioWeightDevice struct.
> > > + */
> >
> > I'm not really seeing the benefit in using major, minor in the XML for
> > this. The <disk> element is using the /dev/hda1 path for the host
> > device, so I'd expect the same path to be usable for the block I/O
> > tuning.
> >
> > How does the scope work here, does major,minor have to refer to a block
> > device, or can it refer to a partition ? If we have multiple <device>
> > elements, each giving a different partition on the same device can we
> > set different weight for each partition ?
>
> blkio doesn't support io control on a partition, so I add major, minor
> to refer to a block device as a whole, rather than utilizing the existing
> <disk> element.
Hmm, well I think we should still just use the '/dev/hda' block device
path. The major/minor numbers cannot be assumed to be stable across
different hosts, so would break migration. Whereas you can use the
/dev/disk/by-{id,path} symlinks for block paths and thus be migration
safe.
Good idea. Thanks for the suggestion. To summarize, the XML describing
weight_device like this will be acceptable:
<device>
<id>by-id</id> (or path here)
<weight>weight</weight>
</device>
Should the <device> be changed into <disk> to remind user that the id is
in fact a disk id?
--
Thanks,
Hu Tao