Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
libvirt.10106
29a90f07-move-video-validation.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 29a90f07-move-video-validation.patch of Package libvirt.10106
commit 29a90f071dd7c1764f82c7fcbfdded35d252b174 Author: Cole Robinson <crobinso@redhat.com> Date: Sun Aug 27 11:04:40 2017 -0400 conf: domain: move video type validation to DeviceDefValidate This allows drivers to set their own default. But if a driver neglects to fill one in, we still error like we previously would at parse time. Signed-off-by: Cole Robinson <crobinso@redhat.com> Index: libvirt-3.3.0/src/conf/domain_conf.c =================================================================== --- libvirt-3.3.0.orig/src/conf/domain_conf.c +++ libvirt-3.3.0/src/conf/domain_conf.c @@ -4662,7 +4662,18 @@ virDomainVcpuDefPostParse(virDomainDefPt break; } } + return 0; +} + +static int +virDomainVideoDefValidate(const virDomainVideoDef *video) +{ + if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing video model and cannot determine default")); + return -1; + } return 0; } @@ -4952,11 +4963,13 @@ virDomainDeviceDefValidateInternal(const case VIR_DOMAIN_DEVICE_CONTROLLER: return virDomainControllerDefValidate(dev->data.controller); + case VIR_DOMAIN_DEVICE_VIDEO: + return virDomainVideoDefValidate(dev->data.video); + case VIR_DOMAIN_DEVICE_LEASE: case VIR_DOMAIN_DEVICE_FS: case VIR_DOMAIN_DEVICE_INPUT: case VIR_DOMAIN_DEVICE_SOUND: - case VIR_DOMAIN_DEVICE_VIDEO: case VIR_DOMAIN_DEVICE_HOSTDEV: case VIR_DOMAIN_DEVICE_WATCHDOG: case VIR_DOMAIN_DEVICE_GRAPHICS: @@ -13320,7 +13333,7 @@ virDomainVideoDefaultType(const virDomai case VIR_DOMAIN_VIRT_BHYVE: return VIR_DOMAIN_VIDEO_TYPE_GOP; default: - return -1; + return VIR_DOMAIN_VIDEO_TYPE_DEFAULT; } } @@ -13424,11 +13437,7 @@ virDomainVideoDefParseXML(xmlNodePtr nod goto error; } } else { - if ((def->type = virDomainVideoDefaultType(dom)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing video model and cannot determine default")); - goto error; - } + def->type = virDomainVideoDefaultType(dom); } if (ram) { @@ -20558,11 +20567,6 @@ virDomainDefAddImplicitVideo(virDomainDe if (VIR_ALLOC(video) < 0) goto cleanup; video->type = virDomainVideoDefaultType(def); - if (video->type < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot determine default video type")); - goto cleanup; - } video->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, video) < 0) goto cleanup;
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