[libvirt] [PATCH v2 3/3] vbox: Read runtime RDP port and handle autoport

Dawid Zamirski dzamirski at datto.com
Wed Oct 25 21:54:08 UTC 2017


On Wed, 2017-10-25 at 17:35 -0400, John Ferlan wrote:
> 
> On 10/24/2017 05:09 PM, Dawid Zamirski wrote:
> > VirutalBox has a IVRDEServerInfo structure available that
> > gives the effective runtime port that the VM is using when it's
> > running. This is useful when the "TCP/Ports" VBox property was set
> > to
> > port range (e.g. via autoport = "yes" or via VBoxManage) in which
> > case it would be impossible to get the "active" port otherwise.
> > ---
> >  src/vbox/vbox_common.c        |   3 +-
> >  src/vbox/vbox_tmpl.c          | 134
> > +++++++++++++++++++++++++++++++-----------
> >  src/vbox/vbox_uniformed_api.h |   2 +-
> >  3 files changed, 104 insertions(+), 35 deletions(-)
> > 
> > diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
> > index 92ee37164..d542f2b76 100644
> > --- a/src/vbox/vbox_common.c
> > +++ b/src/vbox/vbox_common.c
> > @@ -3326,7 +3326,8 @@ vboxDumpDisplay(virDomainDefPtr def,
> > vboxDriverPtr data, IMachine *machine)
> >          if (VIR_ALLOC(graphics) < 0)
> >              goto cleanup;
> >  
> > -        gVBoxAPI.UIVRDEServer.GetPorts(data, VRDEServer,
> > graphics);
> > +        gVBoxAPI.UIVRDEServer.GetPorts(data, VRDEServer, machine,
> > graphics);
> > +        gVBoxAPI.UISession.Close(data->vboxSession);
> 
> But @data is used shortly after this and I don't see in the calling
> tree
> a corresponding UISession.Open* of some type or am I missing it in
> some
> called function?
> 
> 
> The rest looks good - just need to know about this.  I can remove
> before
> pushing or make some other sort of simple adjustment.

Yep this should be removed - it's a left over from my old internal
patch [1], that I forgot to remove when preparing for upstream
submission. It was originally preceded with OpenExisting (aka
LockMachine) to get the IConsole - the new patch does it internally in
the vboxGetActiveVRDEServerPort function.

https://github.com/datto/libvirt/commit/a3cb830bfce10b1a614c18a6ac50783
45433d900#diff-747d3af65e7ac81a564b7cb4fcd01eb6R3516

Thank you,
Dawid

> 
> John
> 
> (I'm at KVM Forum in Prague - so normal work schedule is a bit off)
> 
> >  
> > 
> > 




More information about the libvir-list mailing list