Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
libvirt
5db04621-qemu-move-validation-postparse.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5db04621-qemu-move-validation-postparse.patch of Package libvirt
commit 5db046211f27c339bacba216dad646c42b4d52c7 Author: Cole Robinson <crobinso@redhat.com> Date: Wed Jun 28 10:53:23 2017 -0400 qemu: domain: Move some validation out of DeviceDefPostParse And into DeviceDefValidate which is the expected place Reviewed-by: John Ferlan <jferlan@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com> Index: libvirt-3.3.0/src/qemu/qemu_domain.c =================================================================== --- libvirt-3.3.0.orig/src/qemu/qemu_domain.c +++ libvirt-3.3.0/src/qemu/qemu_domain.c @@ -3129,6 +3129,33 @@ qemuDomainDeviceDefValidate(const virDom } } + /* forbid capabilities mode hostdev in this kind of hypervisor */ + if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV && + dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("hostdev mode 'capabilities' is not " + "supported in %s"), + virDomainVirtTypeToString(def->virtType)); + goto cleanup; + } + + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + dev->data.video->vgamem) { + if (dev->data.video->vgamem < 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be at least 1 MiB " + "(1024 KiB)")); + goto cleanup; + } + if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be power of two")); + goto cleanup; + } + } + } + ret = 0; cleanup: virObjectUnref(cfg); @@ -3461,31 +3488,9 @@ qemuDomainDeviceDefPostParse(virDomainDe dev->type == VIR_DOMAIN_DEVICE_CHR) qemuDomainChrDefDropDefaultPath(dev->data.chr, driver); - /* forbid capabilities mode hostdev in this kind of hypervisor */ - if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV && - dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("hostdev mode 'capabilities' is not " - "supported in %s"), - virDomainVirtTypeToString(def->virtType)); - goto cleanup; - } - - if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && - dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { - if (dev->data.video->vgamem) { - if (dev->data.video->vgamem < 1024) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("value for 'vgamem' must be at least 1 MiB " - "(1024 KiB)")); - goto cleanup; - } - if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("value for 'vgamem' must be power of two")); - goto cleanup; - } - } else { + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + !dev->data.video->vgamem) { dev->data.video->vgamem = QEMU_QXL_VGAMEM_DEFAULT; } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor