conf: also mark the implicit video as primary

Commit 119cd06 started setting the primary bool for the first
user-specified video even if user omitted the 'primary' attribute.

However this was done before the addition of the implicit device.
This broke startup of transient qemu domains with no <video>:
https://bugzilla.redhat.com/show_bug.cgi?id=1325757

Move this default to virDomainDefPostParseInternal,
after the addition of the implicit video device, to catch the implicit
video as well.

(cherry picked from commit 6d8b6d2847f31a3d7a234536c12b8feca751a02f)
This commit is contained in:
Ján Tomko 2016-04-11 14:26:06 +02:00 committed by Cole Robinson
parent c273d72de6
commit 9bf5347469
68 changed files with 72 additions and 70 deletions

View File

@ -3926,6 +3926,11 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
if (virDomainDefAddImplicitDevices(def) < 0)
return -1;
/* Mark the first video as primary. If the user specified primary="yes",
* the parser already inserted the device at def->videos[0] */
if (def->nvideos != 0)
def->videos[0]->primary = true;
/* clean up possibly duplicated metadata entries */
virDomainDefMetadataSanitize(def);
@ -16368,9 +16373,6 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error;
}
}
/* if not specified by user mark the first video as primary */
if (n && !primaryVideo)
def->videos[0]->primary = true;
VIR_FREE(nodes);

View File

@ -27,7 +27,7 @@
<input type='keyboard' bus='ps2'/>
<graphics type='sdl' display=':0.1' xauth='/root/.Xauthority' fullscreen='yes'/>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
</devices>

View File

@ -27,7 +27,7 @@
<input type='keyboard' bus='ps2'/>
<graphics type='sdl' display=':0.1' xauth='/root/.Xauthority'/>
<video>
<model type='vga' vram='16384' heads='1'/>
<model type='vga' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
</devices>

View File

@ -29,7 +29,7 @@
<listen type='address' address='::'/>
</graphics>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
</devices>

View File

@ -29,7 +29,7 @@
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
</devices>

View File

@ -27,7 +27,7 @@
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' socket='/tmp/foo.socket'/>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
</devices>

View File

@ -29,7 +29,7 @@
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
</devices>

View File

@ -22,7 +22,7 @@
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
</devices>

View File

@ -29,7 +29,7 @@
<listen type='address' address='2001:1:2:3:4:5:1234:1234'/>
</graphics>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
</devices>

View File

@ -34,7 +34,7 @@
<input type='mouse' bus='usb'/>
<graphics type='sdl'/>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<memballoon model='none'/>
<panic model='pseries'/>

View File

@ -13,7 +13,7 @@
<on_crash>destroy</on_crash>
<devices>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -26,7 +26,7 @@
<source bridge='VM NETWORK'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -26,7 +26,7 @@
<source bridge='vm network'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='ide' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -17,7 +17,7 @@
</disk>
<controller type='ide' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='ide' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='ide' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='ide' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='scsi' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -17,7 +17,7 @@
</disk>
<controller type='scsi' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='scsi' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='scsi' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='scsi' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='scsi' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -12,7 +12,7 @@
<on_crash>destroy</on_crash>
<devices>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
<vmware:datacenterpath>folder1/folder2/datacenter1</vmware:datacenterpath>

View File

@ -26,7 +26,7 @@
<source bridge='VM Network'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -53,7 +53,7 @@
<model type='vlance'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -35,7 +35,7 @@
<source bridge='VM Network'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -42,7 +42,7 @@
<target type='serial' port='0'/>
</console>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -37,7 +37,7 @@
<model type='e1000'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -30,7 +30,7 @@
<model type='vmxnet3'/>
</interface>
<video>
<model type='vmvga' vram='8192'/>
<model type='vmvga' vram='8192' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -29,7 +29,7 @@
<model type='vmxnet3'/>
</interface>
<video>
<model type='vmvga' vram='8192'/>
<model type='vmvga' vram='8192' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -16,7 +16,7 @@
<source bridge='VM Network'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -17,7 +17,7 @@
<target dev='vmnet7'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -17,7 +17,7 @@
<model type='e1000'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -16,7 +16,7 @@
<source bridge='VM Network'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -15,7 +15,7 @@
<mac address='00:50:56:11:22:33'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -16,7 +16,7 @@
<source bridge='VM Network'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -16,7 +16,7 @@
<source bridge='VM Network'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -17,7 +17,7 @@
<model type='vmxnet2'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -16,7 +16,7 @@
<source bridge='VM Network'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='fdc' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -23,7 +23,7 @@
</disk>
<controller type='fdc' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -33,7 +33,7 @@
<source bridge=''/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -13,7 +13,7 @@
<devices>
<graphics type='vnc' port='5903' autoport='no' keymap='de' passwd='password'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -24,7 +24,7 @@
<target dev='/dev/vmnet1'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -24,7 +24,7 @@
<target dev='/dev/vmnet1'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -29,7 +29,7 @@
<target dev='/dev/vmnet2'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -24,7 +24,7 @@
<target dev='/dev/vmnet2'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='ide' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -18,7 +18,7 @@
</disk>
<controller type='scsi' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -19,7 +19,7 @@
</disk>
<controller type='ide' index='0'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -12,7 +12,7 @@
<on_crash>destroy</on_crash>
<devices>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -12,7 +12,7 @@
<on_crash>destroy</on_crash>
<devices>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -16,7 +16,7 @@
<target port='0'/>
</parallel>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -16,7 +16,7 @@
<target port='0'/>
</parallel>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -36,7 +36,7 @@
<controller type='scsi' index='2' model='lsisas1068'/>
<controller type='scsi' index='3' model='vmpvscsi'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -19,7 +19,7 @@
</disk>
<controller type='scsi' index='0' model='buslogic'/>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -24,7 +24,7 @@
<target type='serial' port='0'/>
</console>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -20,7 +20,7 @@
<target type='serial' port='0'/>
</console>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -22,7 +22,7 @@
<target type='serial' port='0'/>
</console>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -22,7 +22,7 @@
<target type='serial' port='0'/>
</console>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -20,7 +20,7 @@
<target type='serial' port='0'/>
</console>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -16,7 +16,7 @@
<target dir='shared'/>
</filesystem>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -13,7 +13,7 @@
<on_crash>destroy</on_crash>
<devices>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -12,7 +12,7 @@
<on_crash>destroy</on_crash>
<devices>
<video>
<model type='vmvga' vram='8192'/>
<model type='vmvga' vram='8192' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -29,7 +29,7 @@
<model type='e1000'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>

View File

@ -30,7 +30,7 @@
<model type='e1000'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>