mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
xml: drop unenforced minimum memory limit from RNG
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.
This commit is contained in:
parent
2e14861224
commit
1b1402b90f
@ -3077,10 +3077,6 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
Type library
|
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">
|
<define name="cpuset">
|
||||||
<data type="string">
|
<data type="string">
|
||||||
@ -3122,6 +3118,7 @@
|
|||||||
<param name="minInclusive">-1</param>
|
<param name="minInclusive">-1</param>
|
||||||
</data>
|
</data>
|
||||||
</define>
|
</define>
|
||||||
|
<!-- weight currently is in range [100, 1000] -->
|
||||||
<define name="weight">
|
<define name="weight">
|
||||||
<data type="unsignedInt">
|
<data type="unsignedInt">
|
||||||
<param name="pattern">[0-9]+</param>
|
<param name="pattern">[0-9]+</param>
|
||||||
@ -3133,7 +3130,6 @@
|
|||||||
<define name="memoryKB">
|
<define name="memoryKB">
|
||||||
<data type="unsignedInt">
|
<data type="unsignedInt">
|
||||||
<param name="pattern">[0-9]+</param>
|
<param name="pattern">[0-9]+</param>
|
||||||
<param name="minInclusive">4000</param>
|
|
||||||
</data>
|
</data>
|
||||||
</define>
|
</define>
|
||||||
<!-- Memory as an element, with optional unit attribute -->
|
<!-- Memory as an element, with optional unit attribute -->
|
||||||
@ -3145,7 +3141,6 @@
|
|||||||
</optional>
|
</optional>
|
||||||
<data type='unsignedInt'>
|
<data type='unsignedInt'>
|
||||||
<param name='pattern'>[0-9]+</param>
|
<param name='pattern'>[0-9]+</param>
|
||||||
<param name='minInclusive'>4000</param>
|
|
||||||
</data>
|
</data>
|
||||||
</define>
|
</define>
|
||||||
<define name="domainName">
|
<define name="domainName">
|
||||||
|
@ -7625,6 +7625,13 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
|||||||
&def->mem.cur_balloon) < 0)
|
&def->mem.cur_balloon) < 0)
|
||||||
def->mem.cur_balloon = def->mem.max_balloon;
|
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);
|
node = virXPathNode("./memoryBacking/hugepages", ctxt);
|
||||||
if (node)
|
if (node)
|
||||||
def->mem.hugepage_backed = 1;
|
def->mem.hugepage_backed = 1;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<name>QEMUGuest1</name>
|
<name>QEMUGuest1</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219136</memory>
|
<memory unit='KiB'>219136</memory>
|
||||||
<currentMemory unit='KiB'>219200</currentMemory>
|
<currentMemory unit='KiB'>219136</currentMemory>
|
||||||
<vcpu>1</vcpu>
|
<vcpu>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user