]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: report errors when parsing video resolution
authorJonathon Jongsma <jjongsma@redhat.com>
Thu, 14 Nov 2019 21:59:15 +0000 (15:59 -0600)
committerCole Robinson <crobinso@redhat.com>
Fri, 15 Nov 2019 18:30:56 +0000 (13:30 -0500)
commit754e4c24ec4e5e07547da95b044b35e648508022
treeb967cf2c552f5d5c02fd3862d86acd31ec9e4d52
parent333cca0bfc035dbed0c4c07dc816f5c3fcd71af8
conf: report errors when parsing video resolution

The current code doesn't properly handle errors when parsing a video
device's resolution.  We were returning a NULL structure for the case
where 'x' or 'y' were missing. But for the other error cases, we were
logging an error (virReportError()), but still returning an
under-specified structure. That under-specified structure was used by
the calling function rather than properly reporting an error.

This patch changes the parse function to return NULL on any parsing
error and changes the calling function to report an error when NULL is
returned.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
src/conf/domain_conf.c