]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Make specifying <memory> optional
authorPeter Krempa <pkrempa@redhat.com>
Wed, 4 Mar 2015 10:04:27 +0000 (11:04 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 Mar 2015 13:32:20 +0000 (14:32 +0100)
commit4bca6192f20802773012d935145811fb4ba4a4d4
treedd91762c095a7eb0087077149ce13bb189758e06
parentcaf88a3c888b104a787fa8d37e956d48f607ef72
conf: Make specifying <memory> optional

Now that the size of guest's memory can be inferred from the NUMA
configuration (if present) make it optional to specify <memory>
explicitly.

To make sure that memory is specified add a check that some form of
memory size was specified. One side effect of this change is that it is
no longer possible to specify 0KiB as memory size for the VM, but I
don't think it would be any useful to do so. (I can imagine embedded
systems without memory, just registers, but that's far from what libvirt
is usually doing).

Forbidding 0 memory for guests also fixes a few corner cases where 0 was
not interpreted correctly and caused failures. (Arguments for numad when
using automatic placement, size of the balloon). This fixes problems
described in https://bugzilla.redhat.com/show_bug.cgi?id=1161461

Test case changes are added to verify that the schema change and code
behave correctly.
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-no-memory-element.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-no-memory-element.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-minimal-no-memory.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa-no-memory-element.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c