qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libguestfs] Provide NBD via Browser over Websockets


From: Eric Blake
Subject: Re: [Libguestfs] Provide NBD via Browser over Websockets
Date: Fri, 29 May 2020 08:58:06 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 5/29/20 8:50 AM, Daniel P. Berrangé wrote:

(2) You need to persuade qemu's NBD client to read from a WebSocket.
I didn't really know anything about WebSockets until today but it
seems as if they are a full-duplex protocol layered on top of HTTP [a].
Is there a WebSocket proxy that turns WS into plain TCP (a bit like
stunnel)?  Google suggests [b].

[a] https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake
[b] https://github.com/novnc/websockify

qemu already knows how to connect as a client to websockets; Dan Berrange
knows more about that setup.  I suspect it would not be too difficult to
teach the qemu NBD client code to use a WebSocket instead of a Unix or TCP
socket as its data source.

Actually the inverse. The QIOChannelWebsocket impl is only the server
side of the problem, as used by QEMU's VNC server. We've never implemented
the client side. There is nothing especially stopping us doing that - just
needs someone motivated with time to work on it.

In the meantime, you may still be able to set up something like:

local machine:
iso -> NBD server -> Unix socket -> websockify -> WebSocket

remote machine:
WebSocket -> websockify -> Unix socket -> qemu NBD client

Adding websocket client support into qemu would reduce the length of the chain slightly (for less data copying) by getting rid of a websockify proxy middleman, but would not necessarily improve performance (it's hard to say where the latency bottlenecks will be in the chain).

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]