[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv4 4/4] blkiotune: add qemu support for blkiotune.device_weight



On 11/14/2011 09:30 PM, Eric Blake wrote:
> From: Hu Tao <hutao 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 redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]