conf: validate video resolution

Ensure that both x and y are non-zero when resolution is specified for a
video device.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Jonathon Jongsma 2019-11-14 15:59:17 -06:00 committed by Cole Robinson
parent 026c2ffb50
commit 889cd827ae

View File

@ -6319,6 +6319,12 @@ virDomainVideoDefValidate(const virDomainVideoDef *video,
return -1;
}
if (video->res && (video->res->x == 0 || video->res->y == 0)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("video resolution values must be greater than 0"));
return -1;
}
return 0;
}