提交 9bf53474 编写于 作者: J Ján Tomko 提交者: Cole Robinson

conf: also mark the implicit video as primary

Commit 119cd06e 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 6d8b6d28)
上级 c273d72d
......@@ -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);
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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'/>
......
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......
......@@ -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>
......@@ -53,7 +53,7 @@
<model type='vlance'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -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>
......@@ -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>
......@@ -37,7 +37,7 @@
<model type='e1000'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -30,7 +30,7 @@
<model type='vmxnet3'/>
</interface>
<video>
<model type='vmvga' vram='8192'/>
<model type='vmvga' vram='8192' primary='yes'/>
</video>
</devices>
</domain>
......@@ -29,7 +29,7 @@
<model type='vmxnet3'/>
</interface>
<video>
<model type='vmvga' vram='8192'/>
<model type='vmvga' vram='8192' primary='yes'/>
</video>
</devices>
</domain>
......@@ -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>
......@@ -17,7 +17,7 @@
<target dev='vmnet7'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -17,7 +17,7 @@
<model type='e1000'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -17,7 +17,7 @@
<model type='vmxnet2'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -33,7 +33,7 @@
<source bridge=''/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -16,7 +16,7 @@
<target port='0'/>
</parallel>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -16,7 +16,7 @@
<target port='0'/>
</parallel>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -16,7 +16,7 @@
<target dir='shared'/>
</filesystem>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -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>
......@@ -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>
......@@ -29,7 +29,7 @@
<model type='e1000'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
......@@ -30,7 +30,7 @@
<model type='e1000'/>
</interface>
<video>
<model type='vmvga' vram='4096'/>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</devices>
</domain>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册