[libvirt] [PATCHv4 4/4] blkiotune: add qemu support for blkiotune.device_weight
Eric Blake
eblake at redhat.com
Tue Nov 29 18:37:30 UTC 2011
On 11/14/2011 09:30 PM, Eric Blake wrote:
> From: Hu Tao <hutao at cn.fujitsu.com>
>
> Implement setting/getting per-device blkio weights in qemu,
> using the cgroups blkio.weight_device tunable.
> + if (vm->def->blkio.ndevices) {
> + if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) {
> + for (i = 0; i < vm->def->blkio.ndevices; i++) {
> + virBlkioDeviceWeightPtr dw = &vm->def->blkio.devices[i];
> + rc = virCgroupSetBlkioDeviceWeight(cgroup, dw->path,
> + dw->weight);
> + if (rc != 0) {
> + virReportSystemError(-rc,
> + _("Unable to set io device weight "
> + "for domain %s"),
> + vm->def->name);
> + goto cleanup;
> + }
> + }
> + } else {
> + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> + _("Block I/O tuning is not available on this host"));
> + }
Copy and paste, but this should 'goto cleanup' to ensure the error is
propagated.
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111129/e0a658e0/attachment-0001.sig>
More information about the libvir-list
mailing list