[libvirt] [PATCH] qemu: Fix setting of memory tunables

Eric Blake eblake at redhat.com
Mon Apr 22 16:50:21 UTC 2013


On 04/19/2013 04:01 AM, Peter Krempa wrote:
> 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 |  1 +
>  src/qemu/qemu_driver.c   | 95 ++++++++++++++++++++++++------------------------
>  src/util/virutil.c       | 12 ++++++
>  src/util/virutil.h       |  2 +
>  4 files changed, 63 insertions(+), 47 deletions(-)

> +++ b/src/util/virutil.c
> @@ -3832,3 +3832,15 @@ virFindFCHostCapableVport(const char *sysfs_prefix ATTRIBUTE_UNUSED)
>  }
> 
>  #endif /* __linux__ */
> +
> +int
> +virCompareLimitUlong(unsigned long long a, unsigned long b)

Please document this function, and that it special-cases 0 meaning
unlimited.

ACK with that improved.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130422/b4f6bf0f/attachment-0001.sig>


More information about the libvir-list mailing list