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

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to