Re: [PATCH 5/9] blkio: Setting throttle blkio cgroup for domain

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

 



On Mon, Dec 02, 2013 at 02:48:00PM +0800, Gao feng wrote:
> This patch extends virCgroupSetBlkioWeightDevice and
> rename it the virCgroupSetBlkioDevice, now we can use
> this interface to set up throttle blkio cgroup too.
> 
> Signed-off-by: Guan Qiang <hzguanqiang@xxxxxxxxxxxxxxxx>
> Signed-off-by: Gao feng <gaofeng@xxxxxxxxxxxxxx>
> ---
>  src/libvirt_private.syms |   3 +
>  src/lxc/lxc_cgroup.c     |  10 ++-
>  src/qemu/qemu_cgroup.c   |  11 +--
>  src/qemu/qemu_driver.c   |  10 ++-
>  src/util/vircgroup.c     | 170 ++++++++++++++++++++++++++++++++++++++++++++---
>  src/util/vircgroup.h     |  18 +++++
>  6 files changed, 203 insertions(+), 19 deletions(-)
> diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
> index 835eb30..99c3a35 100644
> --- a/src/util/vircgroup.h
> +++ b/src/util/vircgroup.h
> @@ -126,6 +126,24 @@ int virCgroupSetBlkioDeviceWeight(virCgroupPtr group,
>                                    const char *path,
>                                    unsigned int weight);
>  
> +int virCgroupSetBlkioDeviceIops(virCgroupPtr group,
> +                                const char *path,
> +                                bool read,
> +                                unsigned int iops);
> +
> +int virCgroupSetBlkioDeviceBps(virCgroupPtr group,
> +                                const char *path,
> +                                bool read,
> +                                unsigned long long bps);

I think it is preferrable to have separate methods for read and
write, because no one reading the code will ever remember that
'true == read' and 'false == write' in parameters.

> +int virCgroupSetBlkioDevice(virCgroupPtr group,
> +                            const char *path,
> +                            unsigned int weight,
> +                            unsigned int riops,
> +                            unsigned int wiops,
> +                            unsigned long long rbps,
> +                            unsigned long long wbps);

I don't think this method serves any real useful purpose - just call
the other public APIs directly.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]