Re: [PATCH] reject out of range memory in SetMemory APIs

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

 



On Tue, May 05, 2015 at 06:03:32PM +0200, Ján Tomko wrote:
The APIs take the memory value in KiB and we store it in KiB
internally, but we cannot parse the whole ULONG_MAX range
on 64-bit systems, because virDomainParseScaledValue
needs to fit the value in bytes in an unsigned long long.

https://bugzilla.redhat.com/show_bug.cgi?id=1176739
---
src/conf/domain_conf.c   |  7 +------
src/libvirt-domain.c     | 18 ++++++++++++++++++
src/libvirt_private.syms |  1 +
src/util/virutil.c       | 20 ++++++++++++++++++++
src/util/virutil.h       |  1 +
5 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/src/util/virutil.c b/src/util/virutil.c
index 0426517..e190308 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -2598,3 +2598,23 @@ virMemoryLimitIsSet(unsigned long long value)
{
    return value < VIR_DOMAIN_MEMORY_PARAM_UNLIMITED;
}
+
+
+/**
+ * virMemoryMaxValue
+ *
+ * @ulong: whether the value must fit into unsigned long
+ *   (unsigned long long is assumed otherwise)

s/unsigned long/long/

ACK with that fixed.

Attachment: signature.asc
Description: PGP 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]