提交 b648d962 编写于 作者: P Pavel Mores 提交者: Cole Robinson

qemu: default video device type selection algoritm moved into its own function

The default video device type selection algorithm we're about to deploy will
increase the amount of code dedicated to the task by amount enough to warrant
factoring the whole thing into its own function so as not to pollute the
caller qemuDomainDeviceVideoDefPostParse().  Do it now so that the actual
algorithm change later on is in a clean commit by itself and easy to review.
Reviewed-by: NCole Robinson <crobinso@redhat.com>
Signed-off-by: NPavel Mores <pmores@redhat.com>
上级 68aa7f38
......@@ -7881,19 +7881,25 @@ qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr net,
static int
qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video,
const virDomainDef *def)
qemuDomainDefaultVideoDevice(const virDomainDef *def)
{
if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
if (ARCH_IS_PPC64(def->os.arch))
video->type = VIR_DOMAIN_VIDEO_TYPE_VGA;
return VIR_DOMAIN_VIDEO_TYPE_VGA;
else if (qemuDomainIsARMVirt(def) ||
qemuDomainIsRISCVVirt(def) ||
ARCH_IS_S390(def->os.arch))
video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
return VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
else
video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
}
return VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
}
static int
qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video,
const virDomainDef *def)
{
if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT)
video->type = qemuDomainDefaultVideoDevice(def);
if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
!video->vgamem) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册