]> git.ipfire.org Git - thirdparty/libvirt.git/commit
memtune: change the way how we store unlimited value
authorPavel Hrdina <phrdina@redhat.com>
Mon, 2 Mar 2015 19:04:12 +0000 (20:04 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 6 Mar 2015 10:52:24 +0000 (11:52 +0100)
commitcf521fc8bae5aa8bfb28806ced8ac3a9f58b0627
treece2c5edd201ffa6eeeea0e6f9c1159ebb758634f
parenta73395ae66c163ba2fefb39c558ea36972ef6406
memtune: change the way how we store unlimited value

There was a mess in the way how we store unlimited value for memory
limits and how we handled values provided by user.  Internally there
were two possible ways how to store unlimited value: as 0 value or as
VIR_DOMAIN_MEMORY_PARAM_UNLIMITED.  Because we chose to store memory
limits as unsigned long long, we cannot use -1 to represent unlimited.
It's much easier for us to say that everything greater than
VIR_DOMAIN_MEMORY_PARAM_UNLIMITED means unlimited and leave 0 as valid
value despite that it makes no sense to set limit to 0.

Remove unnecessary function virCompareLimitUlong.  The update of test
is to prevent the 0 to be miss-used as unlimited in future.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146539

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
19 files changed:
docs/formatdomain.html.in
src/conf/domain_conf.c
src/libvirt-domain.c
src/libvirt_private.syms
src/lxc/lxc_cgroup.c
src/lxc/lxc_driver.c
src/lxc/lxc_fuse.c
src/lxc/lxc_native.c
src/openvz/openvz_conf.c
src/openvz/openvz_driver.c
src/qemu/qemu_cgroup.c
src/qemu/qemu_command.c
src/qemu/qemu_driver.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_migration.c
src/util/virutil.c
src/util/virutil.h
tests/qemuxml2argvdata/qemuxml2argv-memtune.xml
tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml