[libvirt] [PATCH v2 14/18] LXC from native: add lxc.cgroup.blkio.* mapping
Cedric Bosdonnat
cbosdonnat at suse.com
Tue Feb 4 13:03:35 UTC 2014
On Tue, 2014-02-04 at 12:39 +0000, Daniel P. Berrange wrote:
> > diff --git a/tests/lxcconf2xmldata/lxcconf2xml-blkiotune.config b/tests/lxcconf2xmldata/lxcconf2xml-blkiotune.config
> > new file mode 100644
> > index 0000000..8083c71
> > --- /dev/null
> > +++ b/tests/lxcconf2xmldata/lxcconf2xml-blkiotune.config
> > @@ -0,0 +1,7 @@
> > +lxc.rootfs = /var/lib/lxc/migrate_test/rootfs
> > +lxc.utsname = migrate_test
> > +lxc.autodev=1
> > +
> > +lxc.cgroup.blkio.weight = 500
> > +lxc.cgroup.blkio.device_weight = 8:16 1000
> > +lxc.cgroup.blkio.device_weight = 8:0 300
> > diff --git a/tests/lxcconf2xmldata/lxcconf2xml-blkiotune.xml b/tests/lxcconf2xmldata/lxcconf2xml-blkiotune.xml
> > new file mode 100644
> > index 0000000..d2408f4
> > --- /dev/null
> > +++ b/tests/lxcconf2xmldata/lxcconf2xml-blkiotune.xml
> > @@ -0,0 +1,35 @@
> > +<domain type='lxc'>
> > + <name>migrate_test</name>
> > + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> > + <memory unit='KiB'>65536</memory>
> > + <currentMemory unit='KiB'>0</currentMemory>
> > + <blkiotune>
> > + <weight>500</weight>
> > + <device>
> > + <path>/dev/block/8:16</path>
> > + <weight>1000</weight>
> > + </device>
> > + <device>
> > + <path>/dev/block/8:0</path>
>
> Hmm, I don't think this is correct. The libvirt XML takes block
> paths like /dev/sda, rather than relative sysfs block paths.
>
> If this works, it is by luck rather than by design.
Then how could we safely map this?
lxc.cgroup.blkio.device_weight = 8:0 300
AFAICT there is no way to guess a /dev/sda-like path from the
major:minor values of the device... and since we can't assume we have
the device around it's surely impossible to map this. So it's a best
effort. If that doesn't work for some users, then they will have to
convert manually.
The other option we have is to extend the domain configuration to allow
giving major and minor as input for the lxc driver (those are used
anyway when setting the cgroup).
--
Cedric
More information about the libvir-list
mailing list