[libvirt] [PATCH 4/5] conf: ensure both resolution values are non-zero

Jonathon Jongsma jjongsma at redhat.com
Wed Oct 23 16:11:27 UTC 2019


On Wed, 2019-10-23 at 12:24 +0200, Ján Tomko wrote:
> On Fri, Oct 18, 2019 at 04:40:22PM -0500, Jonathon Jongsma wrote:
> > Since the users of the resolution expect the x and y values to be
> > non-zero, enforce it in the parser and report an error if either is
> > zero.
> > 
> > Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
> > ---
> > src/conf/domain_conf.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> > 
> 
> This only works when somebody explicitly specifies x='0', but does
> not
> catch the case where x is omitted from the XML completely
> 

That's true with respect to the changes within this diff, but earlier
in the function we already ensure that 'x' and 'y' are non-null. So if
the attributes were omitted, we would have already failed before this
point.

Jonathon




More information about the libvir-list mailing list