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

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

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]