mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
xml: allow scaled memory on input
Output is still in kibibytes, but input can now be in different scales for ease of typing. * src/conf/domain_conf.c (virDomainParseMemory): New helper. (virDomainDefParseXML): Use it when parsing. * docs/schemas/domaincommon.rng: Expand XML; rename memoryKBElement to memoryElement and update callers. * docs/formatdomain.html.in (elementsMemoryAllocation): Document scaling. * tests/qemuxml2argvdata/qemuxml2argv-memtune.xml: Adjust test. * tests/qemuxml2xmltest.c: Likewise. * tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml: New file.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<memory unit='MiB'>214</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<memtune>
|
||||
<hard_limit unit='KiB'>512000</hard_limit>
|
||||
<soft_limit unit='KiB'>128000</soft_limit>
|
||||
<swap_hard_limit unit='KiB'>1024000</swap_hard_limit>
|
||||
<soft_limit unit='bytes'>131071999</soft_limit>
|
||||
<swap_hard_limit unit='KB'>1048576</swap_hard_limit>
|
||||
</memtune>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
|
||||
31
tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml
Normal file
31
tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<memtune>
|
||||
<hard_limit unit='KiB'>512000</hard_limit>
|
||||
<soft_limit unit='KiB'>128000</soft_limit>
|
||||
<swap_hard_limit unit='KiB'>1024000</swap_hard_limit>
|
||||
</memtune>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='ide' index='0'/>
|
||||
<memballoon model='virtio'/>
|
||||
</devices>
|
||||
</domain>
|
||||
@@ -195,7 +195,7 @@ mymain(void)
|
||||
DO_TEST("pci-rom");
|
||||
|
||||
DO_TEST("encrypted-disk");
|
||||
DO_TEST("memtune");
|
||||
DO_TEST_DIFFERENT("memtune");
|
||||
DO_TEST("blkiotune");
|
||||
DO_TEST("blkiotune-device");
|
||||
DO_TEST("cputune");
|
||||
|
||||
Reference in New Issue
Block a user