[libvirt] [PATCH] Add support for VNC autoport feature for bhyve hypervisor.

Roman Bogorodskiy bogorodskiy at gmail.com
Mon May 15 13:45:29 UTC 2017


  Alexander Nusov wrote:

> ---- On Wed, 10 May 2017 17:58:05 +0300 Roman Bogorodskiy <bogorodskiy at gmail.com> wrote ----
> 
> 
> 
> Alexander Nusov wrote: 
> 
> 
> 
> > This patch adds support for automatic VNC port assignment for bhyve guests. 
> 
> > 
> 
> > --- 
> 
> > src/bhyve/bhyve_command.c | 9 +++++++++ 
> 
> > src/bhyve/bhyve_driver.c | 5 +++++ 
> 
> > src/bhyve/bhyve_utils.h | 3 +++ 
> 
> > 3 files changed, 17 insertions(+) 
> 
> 
> 
> Hi Alexander, 
> 
> 
> 
> Thanks for implementing this! Overall it looks good, two comments: 
> 
> 
> 
> * It doesn't take into account domains that use VNC with port 
> 
> explicitly specified. For example, if I start a domain with VNC 
> 
> configuration "port=5900 autoport=no", I will not be able 
> 
> to start a domain with "autoport=yes" because it will try to 
> 
> to 5900 and will fail to bind. 
> 
> 
> 
> Looking at the qemu driver code, it seems it's done by calling 
> 
> virPortAllocatorSetUsed(). 
> 
> 
> 
> 
> 
> Hi Roman. Thanks for finding this. I tried adding virPortAllocatorSetUsed() call but it seems it should be 
> 
> placed somewhere at the initialization of libvirtd driver also in case of restaring the libvirtd daemon.
> 

Yeah, that sounds right.

FWIW, the bhyve driver tries to reconnect to domains after restart, you
can check virBhyveProcessReconnectAll() in bhyve_process.c.

> 
> 
> 
> I'm also wondering how it's handled for autostarting domains, e.g. 
> 
> if I have vm1[5900], vm2[5901], vm3[autoport], vm4[autoport], 
> 
> they'll start fine in that order, but will fail to start if going 
> 
> this way: vm3, vm4, vm1, vm2 
> 
> 
> 
> 
> 
> To be honest, I'm concerned also.
> 
> 
> 
> https://www.redhat.com/archives/libvir-list/2011-April/msg00819.html
> 
> is that still actual?
> 

Daniel P. Berrange suggested on IRC that specifying autostart order is not
supported and it's actually not desired to mix manual port assignment
and autoport on the same host.

Also, qemu supports obtaining autoport range from the config file, we'd
probably want to have a similar behaviour for the bhyve driver (but as a
separate patch I guess).

Also, Daniel noted that this patch needs to add
virPortAllocatorRelease() when domain goes down.

> 
> 
> 
> * Nitpick: Commit message titles are usually don't end with a period. 
> 
> 
> Also, they're usually prefixed with the relevant subsystem, so 
> 
> this one could be "bhyve: Add support for VNC autoport feature" 
> 
> for example (you might glance through 'git log' for examples.
> 
> 
> 
> 
> good.
> 
> 
> 
> 

Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170515/98a816ee/attachment-0001.sig>


More information about the libvir-list mailing list