]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Fix setting of memory tunables
authorPeter Krempa <pkrempa@redhat.com>
Wed, 17 Apr 2013 15:50:56 +0000 (17:50 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 23 Apr 2013 05:10:56 +0000 (07:10 +0200)
commitfa006c4fdd8c8580bca3db1436e3201350e973f4
tree90fee9ea34f691a8eed07b902586c2386ec2bf90
parentfd2e55302b916689af96dcda75d23d1e0245a68b
qemu: Fix setting of memory tunables

Refactoring done in 19c6ad9ac7e7eb2fd3c8262bff5f087b508ad07f didn't
correctly take into account the order cgroup limit modification needs to
be done in. This resulted into errors when decreasing the limits.

The operations need to take place in this order:

decrease hard limit
change swap hard limit

or

change swap hard limit
increase hard limit

This patch also fixes the check if the hard_limit is less than
swap_hard_limit to print better error messages. For this purpose I
introduced a helper function virCompareLimitUlong to compare limit
values where value of 0 is equal to unlimited. Additionally the check is
now applied also when the user does not provide all of the tunables
through the API and in that case the currently set values are used.

This patch resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=950478
src/libvirt_private.syms
src/qemu/qemu_driver.c
src/util/virutil.c
src/util/virutil.h