<div dir="ltr">Hi<br><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 6, 2013 at 12:36 AM, Alon Levy <span dir="ltr"><<a href="mailto:alevy@redhat.com" target="_blank">alevy@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
><br>
> @@ -1475,6 +1543,7 @@ static void port_opened(SpiceChannel *channel,<br>
> GParamSpec *pspec,<br>
> /* only send a break event and disconnect */<br>
> if (g_strcmp0(name, "org.spice.spicy.break") == 0) {<br>
> spice_port_event(port, SPICE_PORT_EVENT_BREAK);<br>
> + spice_channel_flush_async(channel, NULL, port_flushed_cb, conn);<br>
<br>
</div></div>Here, and<br>
<div class="im"><br>
> }<br>
><br>
> /* handle the first spicy port and connect it to stdin/out */<br>
> @@ -1486,7 +1555,6 @@ static void port_opened(SpiceChannel *channel,<br>
> GParamSpec *pspec,<br>
> if (port == stdin_port)<br>
> goto end;<br>
><br>
> - spice_channel_flush_async(channel, NULL, port_flushed_cb, conn);<br>
<br>
</div>Here.<br></blockquote><div><br> <br></div><div>This is because that code was treating any Spice port and flushing it. But this conflict with SpiceNbd channel, which are SpicePort too. So I just moved the flush where it belonged.<br>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
> } else {<br>
> if (port == stdin_port)<br>
> stdin_port = NULL;<br>
> @@ -1565,6 +1633,15 @@ static void channel_new(SpiceSession *s, SpiceChannel<br>
> *channel, gpointer data)<br>
> G_CALLBACK(port_data), conn);<br>
> spice_channel_connect(channel);<br>
> }<br>
> +<br>
> + if (SPICE_IS_NBD_CHANNEL(channel)) {<br>
> + SpiceNbdChannel *nbd = SPICE_NBD_CHANNEL(channel);<br>
> + update_nbd_sensitive(conn);<br>
> + SPICE_DEBUG("new nbd channel");<br>
> + conn->nbd_channel = nbd;<br>
> + spice_channel_connect(channel);<br>
> + update_nbd_export(conn, nbd_file);<br>
> + }<br>
> }<br>
><br>
> static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer<br>
> data)<br>
> @@ -1593,6 +1670,10 @@ static void channel_destroy(SpiceSession *s,<br>
> SpiceChannel *channel, gpointer dat<br>
> update_auto_usbredir_sensitive(conn);<br>
> }<br>
><br>
> + if (SPICE_IS_NBD_CHANNEL(channel)) {<br>
> + update_nbd_sensitive(conn);<br>
> + }<br>
> +<br>
> if (SPICE_IS_PORT_CHANNEL(channel)) {<br>
> if (SPICE_PORT_CHANNEL(channel) == stdin_port)<br>
> stdin_port = NULL;<br>
> @@ -1693,6 +1774,12 @@ static GOptionEntry cmd_entries[] = {<br>
> .description = N_("Set the window title"),<br>
> .arg_description = N_("<title>"),<br>
> },{<br>
> + .long_name = "nbd-file",<br>
> + .arg = G_OPTION_ARG_FILENAME,<br>
> + .arg_data = &nbd_file,<br>
> + .description = N_("image file (for NBD channels)"),<br>
> + .arg_description = N_("<FILE>"),<br>
> + },{<br>
> /* end of list */<br>
> }<br>
> };<br>
> @@ -1888,6 +1975,7 @@ int main(int argc, char *argv[])<br>
> g_key_file_free(keyfile);<br>
><br>
> g_free(spicy_title);<br>
> + g_free(nbd_file);<br>
><br>
> setup_terminal(true);<br>
> return 0;<br>
> --<br>
> 1.8.3.rc1.49.g8d97506<br>
><br>
</div></div>> _______________________________________________<br>
> Spice-devel mailing list<br>
> <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br>Marc-André Lureau
</div></div></div>