[Spice-devel] [PATCH spice-common] RFC: spice.proto: Start a NBD channel

Hans de Goede hdegoede at redhat.com
Sat Jun 8 07:31:43 PDT 2013


Hi,

Looks good (with your own comments as something to fix in the future,
we may want to do that before doing an official release with this
proto in there).

Regards,

Hans


On 06/05/2013 05:34 PM, Marc-André Lureau wrote:
> The NBD channel is a specialized port channel which implements the NBD
> protocol over the Data messages (the NBD server implementation may not
> implement the whole protocol, for example, it may be read-only, but
> should reply with appropriate errors where required)
>
> To allow to gracefully switch NBD sessions, the Spice client should send
> a SPICE_PORT_EVENT_BREAK, so that the server can close the session, and
> take appropriate actions (such as eject the removable media).
>
> The NBD session is recreated when the channel receives the
> SPICE_PORT_EVENT_OPENED.
>
> The combinations of those 2 events allow the client to switch the
> exported images, ex:
>
> Client initiate a switch:
>> SPICE_PORT_EVENT_BREAK
> Server finishes the session, eject the medium and close NBD:
> < NBD_CMD_FLUSH
> < NBD_CMD_DISC
> Server is ready for a new session:
> < SPICE_PORT_EVENT_OPENED
>> NBD negotiation
>
> There is currently no information about the associated device or name.
> The spice client doesn't even know if this channel should be read-write
> etc (but it is still free to provide read-only services). We may want to
> use the port message to identify the associated device?
> ---
>   spice.proto | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/spice.proto b/spice.proto
> index 5eede6b..eff9706 100644
> --- a/spice.proto
> +++ b/spice.proto
> @@ -1347,6 +1347,9 @@ channel PortChannel : SpicevmcChannel {
>       } event;
>   };
>
> +channel NbdChannel : PortChannel {
> +};
> +
>   protocol Spice {
>       MainChannel main = 1;
>       DisplayChannel display;
> @@ -1357,5 +1360,6 @@ protocol Spice {
>       TunnelChannel tunnel;
>       SmartcardChannel smartcard;
>       UsbredirChannel usbredir;
> +    NbdChannel nbd;
>       PortChannel port;
>   };
>


More information about the Spice-devel mailing list