All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Bug: vnc + websocket = websocket autoport not working right at live migration
@ 2015-06-23 12:13 Piotr Rybicki
  2015-06-25 20:00 ` [Qemu-devel] [libvirt] " Martin Kletzander
  0 siblings, 1 reply; 2+ messages in thread
From: Piotr Rybicki @ 2015-06-23 12:13 UTC (permalink / raw)
  To: qemu-devel, libvir-list

Hello.

Problem description:

When i start qemu via libvirt with vnc websocket defined, it is not 
possible to live migrate to host where other qemu process is running 
with the same display id.

migration error is:

error: internal error: early end of file from monitor: possible problem:
             [1] => 2015-06-23T11:54:25.590506Z qemu-system-x86_64: -vnc 0.0.0.0:1,websocket=5700,password: Failed to start VNC server on `(null)': Failed to bind socket: Address already in use

(please note vnc display id=1 and websocket=5700 - where it should be 5701)

in libvirt's xml i have:
(...)
     <graphics type='vnc' port='-1' autoport='yes' websocket='-1' 
listen='0.0.0.0' passwd='xxx'>
       <listen type='address' address='0.0.0.0'/>
     </graphics>
(...)

for first and only qemu process on host, this creates qemu commandline:
(...) -vnc 0.0.0.0:0,websocket=5700,password (...)

for second qemu process on the same host:
(...)  -vnc 0.0.0.0:1,websocket=5701,password (...)

There is no problem with migration, when there is no websocket 
configuration.

Solution:

I believe, to solve this problem, libvirt has to omit websocket port 
definition in commandline string ('websocket=5700' => 'websocket') when 
autoport is defined in domain xml definition.

from man qemu:
      -vnc display[,option[,option[,...]]]
(...)
           websocket
                Opens an additional TCP listening port dedicated to VNC 
Websocket connections.  By definition the Websocket port is
                5700+display. If host is specified connections will only 
be allowed from this host.  As an alternative the Websocket port
                could be specified by using "websocket"=port.  TLS 
encryption for the Websocket connection is supported if the required
                certificates are specified with the VNC option x509.

So if I understand it right, not specifying websocket port means 
5700+display id, and display id is given via commandline and increments 
just fine.

Can anyone confirm this? Or perhaps there is some misconfiguration in my 
xml domain definition?

Best regards
Piotr Rybicki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [libvirt] Bug: vnc + websocket = websocket autoport not working right at live migration
  2015-06-23 12:13 [Qemu-devel] Bug: vnc + websocket = websocket autoport not working right at live migration Piotr Rybicki
@ 2015-06-25 20:00 ` Martin Kletzander
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Kletzander @ 2015-06-25 20:00 UTC (permalink / raw)
  To: Piotr Rybicki; +Cc: libvir-list, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2847 bytes --]

On Tue, Jun 23, 2015 at 02:13:21PM +0200, Piotr Rybicki wrote:
>Hello.
>
>Problem description:
>
>When i start qemu via libvirt with vnc websocket defined, it is not
>possible to live migrate to host where other qemu process is running
>with the same display id.
>
>migration error is:
>
>error: internal error: early end of file from monitor: possible problem:
>            [1] => 2015-06-23T11:54:25.590506Z qemu-system-x86_64: -vnc 0.0.0.0:1,websocket=5700,password: Failed to start VNC server on `(null)': Failed to bind socket: Address already in use
>
>(please note vnc display id=1 and websocket=5700 - where it should be 5701)
>
>in libvirt's xml i have:
>(...)
>    <graphics type='vnc' port='-1' autoport='yes' websocket='-1'
>listen='0.0.0.0' passwd='xxx'>
>      <listen type='address' address='0.0.0.0'/>
>    </graphics>
>(...)
>
>for first and only qemu process on host, this creates qemu commandline:
>(...) -vnc 0.0.0.0:0,websocket=5700,password (...)
>
>for second qemu process on the same host:
>(...)  -vnc 0.0.0.0:1,websocket=5701,password (...)
>
>There is no problem with migration, when there is no websocket
>configuration.
>
>Solution:
>
>I believe, to solve this problem, libvirt has to omit websocket port
>definition in commandline string ('websocket=5700' => 'websocket')
>when autoport is defined in domain xml definition.
>

Well, either that or increasing the websocket number as well.  And
that port should be auto-allocated so in case there is something
listening on port 5701 it can select 5702.  That would be even more
error-proof and libvirt would retain full control of qemu (we do that
so that in case the 'websocket = display + 5700' default gets changed,
we still know all the details we set up).

>from man qemu:
>     -vnc display[,option[,option[,...]]]
>(...)
>          websocket
>               Opens an additional TCP listening port dedicated to VNC
>Websocket connections.  By definition the Websocket port is
>               5700+display. If host is specified connections will
>only be allowed from this host.  As an alternative the Websocket port
>               could be specified by using "websocket"=port.  TLS
>encryption for the Websocket connection is supported if the required
>               certificates are specified with the VNC option x509.
>
>So if I understand it right, not specifying websocket port means
>5700+display id, and display id is given via commandline and
>increments just fine.
>
>Can anyone confirm this? Or perhaps there is some misconfiguration in
>my xml domain definition?
>

I believe this is a bug in libvirt.  Would you mind creating a bug in
bugzilla for this issue so we can properly track the issue?

Thanks,
Martin

>Best regards
>Piotr Rybicki
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-25 20:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-23 12:13 [Qemu-devel] Bug: vnc + websocket = websocket autoport not working right at live migration Piotr Rybicki
2015-06-25 20:00 ` [Qemu-devel] [libvirt] " Martin Kletzander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.