The test domain allows <memory>0</memory>, but the RNG was stating
that memory had to be at least
4096000 bytes. Hypervisors should
enforce their own limits, rather than complicating the RNG.
Meanwhile, some copy and paste had introduced some fishy constructs
in various unit tests.
* docs/schemas/domaincommon.rng (memoryKB, memoryKBElement): Drop
limit that isn't enforced in code.
* src/conf/domain_conf.c (virDomainDefParseXML): Require current
<= maximum.
* tests/qemuxml2argvdata/*.xml: Fix offenders.
<!--
Type library
-
- A domain name should be made of ascii, numbers, _-+ and is non-empty
- memoryKB request at least 4Mbytes though Xen will grow bigger if too low
- weight currently is in range [100, 1000]
-->
<define name="cpuset">
<data type="string">
<param name="minInclusive">-1</param>
</data>
</define>
+ <!-- weight currently is in range [100, 1000] -->
<define name="weight">
<data type="unsignedInt">
<param name="pattern">[0-9]+</param>
<define name="memoryKB">
<data type="unsignedInt">
<param name="pattern">[0-9]+</param>
- <param name="minInclusive">4000</param>
</data>
</define>
<!-- Memory as an element, with optional unit attribute -->
</optional>
<data type='unsignedInt'>
<param name='pattern'>[0-9]+</param>
- <param name='minInclusive'>4000</param>
</data>
</define>
<define name="domainName">
&def->mem.cur_balloon) < 0)
def->mem.cur_balloon = def->mem.max_balloon;
+ if (def->mem.cur_balloon > def->mem.max_balloon) {
+ virDomainReportError(VIR_ERR_XML_ERROR,
+ _("current memory '%luk' exceeds maximum '%luk'"),
+ def->mem.cur_balloon, def->mem.max_balloon);
+ goto error;
+ }
+
node = virXPathNode("./memoryBacking/hugepages", ctxt);
if (node)
def->mem.hugepage_backed = 1;
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
+ <currentMemory unit='KiB'>219136</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>