[libvirt] [PATCH] domain_conf: vnc: preserve autoport value if no port was specified

Pavel Hrdina phrdina at redhat.com
Fri Jan 27 09:00:21 UTC 2017


On Thu, Jan 26, 2017 at 04:30:31PM -0500, John Ferlan wrote:
> 
> 
> On 01/25/2017 12:26 PM, Pavel Hrdina wrote:
> > The issue is that if this graphics definition is provided:
> > 
> >   <graphics type='vnc' port='0'/>
> > 
> > it's parsed as:
> > 
> >   <graphics type='vnc' autoport='no'>
> >     <listen type='address'/>
> >   </graphics>
> > 
> > but if the resulting XML is parsed again the output is:
> > 
> >   <graphics type='vnc' port='-1' autoport='yes'>
> >     <listen type='address'/>
> >   </graphics>
> > 
> > and this should not happen.  The XML have to always remain the same
> > after it was already parsed by libvirt.
> > 
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1383039
> > 
> > Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> > ---
> >  src/conf/domain_conf.c                             |  2 ++
> >  .../generic-graphics-vnc-autoport-no.xml           | 30 ++++++++++++++++++++++
> >  tests/genericxml2xmltest.c                         |  1 +
> >  3 files changed, 33 insertions(+)
> >  create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-autoport-no.xml
> > 
> 
> I know this is a VNC bug, but RDP has similar code which would seemingly
> have the same issue.

I've also checked the RDP code and tested it and it seemed that it didn't
have the same issue even though the code is the same.  However I've tested
it again and it does have the same issue, I'll send a patch for that as well.

> The SPICE code is a bit different (I assume it doesn't have the legacy
> compat issue). It doesn't set autoport when "port" is not supplied.
> 
> ACK for this change, though.

Thanks, I'll push it shortly.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170127/07978830/attachment-0001.sig>


More information about the libvir-list mailing list