1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-09 01:18:00 +03:00

qemu: Don't assign alias to disabled balloon device

<memballoon model='none'/> is the only way to disable balloon driver
since libvirt will add one automatically if the memballoon element is
missing. In other words, there's no balloon device if model is 'none'
and generating an alias for it makes no sense. The alias will be ignored
when parsing the XML and it will disappear once libvirtd is restarted.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2018-03-19 18:14:52 +01:00
parent 8ef5db6581
commit 1554eafbe6
20 changed files with 21 additions and 58 deletions

View File

@ -612,7 +612,8 @@ qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr qemuCaps)
if (qemuAssignDeviceWatchdogAlias(def->watchdog) < 0) if (qemuAssignDeviceWatchdogAlias(def->watchdog) < 0)
return -1; return -1;
} }
if (def->memballoon) { if (def->memballoon &&
def->memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_NONE) {
if (qemuAssingDeviceMemballoonAlias(def->memballoon, 0) < 0) if (qemuAssingDeviceMemballoonAlias(def->memballoon, 0) < 0)
return -1; return -1;
} }

View File

@ -50,9 +50,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<panic model='s390'/> <panic model='s390'/>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -60,9 +60,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<panic model='s390'/> <panic model='s390'/>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -50,9 +50,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<panic model='s390'/> <panic model='s390'/>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -59,9 +59,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<panic model='s390'/> <panic model='s390'/>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -59,9 +59,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<panic model='s390'/> <panic model='s390'/>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -49,9 +49,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<panic model='s390'/> <panic model='s390'/>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -40,9 +40,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<panic model='s390'/> <panic model='s390'/>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>

View File

@ -66,9 +66,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -54,9 +54,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -54,9 +54,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -54,9 +54,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -44,9 +44,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<shmem name='shmem0'> <shmem name='shmem0'>
<model type='ivshmem-plain'/> <model type='ivshmem-plain'/>
<size unit='M'>4</size> <size unit='M'>4</size>

View File

@ -44,9 +44,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
<shmem name='shmem0'> <shmem name='shmem0'>
<model type='ivshmem-plain'/> <model type='ivshmem-plain'/>
<size unit='M'>4</size> <size unit='M'>4</size>

View File

@ -50,9 +50,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -48,9 +48,7 @@
<alias name='ua-UserWatchdog'/> <alias name='ua-UserWatchdog'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</watchdog> </watchdog>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -48,9 +48,7 @@
<alias name='watchdog0'/> <alias name='watchdog0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</watchdog> </watchdog>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -44,9 +44,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -48,9 +48,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>

View File

@ -58,9 +58,7 @@
<input type='keyboard' bus='ps2'> <input type='keyboard' bus='ps2'>
<alias name='input1'/> <alias name='input1'/>
</input> </input>
<memballoon model='none'> <memballoon model='none'/>
<alias name='balloon0'/>
</memballoon>
</devices> </devices>
<seclabel type='none' model='none'/> <seclabel type='none' model='none'/>
</domain> </domain>