Re: [PATCH] spicevmc: Drop unsent data on client disconnection

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

 



On Wed, Jan 13, 2016 at 11:48:46AM +0100, Christophe Fergeau wrote:
> On Wed, Dec 09, 2015 at 10:59:07AM +0100, Christophe Fergeau wrote:
> > Hi,
> > On Wed, Dec 09, 2015 at 08:39:33AM +0100, Victor Toso wrote:
> > > On Tue, Dec 08, 2015 at 11:23:36AM -0600, Jonathon Jongsma wrote:
> > > > Hi Christophe,
> > > > 
> > > > I just ran across this patch while looking through some bugs and noticed that it
> > > > doesn't seem to ever have gone upstream. Is it still necessary?
> > > > 
> > > 
> > > Just to add that it was tested by QA so My question has already been
> > > answered! :)
> > 
> > Yes this is still needed, but I never got to test migration with it as
> > asked by Victor. If QA tested migration, then we can move forward with
> > it.
> 
> I've now pushed this.

For what it's worth, I'm fairly sure the smartcard code needs the same
fix, but I'm not sure how to reproduce failures with it:
commit 4ab65457d6c83da2c6e19f5b6fa51737085dcb51
Author: Christophe Fergeau <cfergeau@xxxxxxxxxx>
Date:   Tue Sep 29 12:12:48 2015 +0200

    smartcard: Drop unsent data on client disconnection

    Similarly to the spicevmc patch, we need to drop partial channel data on
    client disconnect, otherwise the smartcard channel may assert upon
    reconnection.

diff --git a/server/smartcard.c b/server/smartcard.c
index aad22aa..29d5f5f 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -549,9 +549,14 @@ static void smartcard_channel_on_disconnect(RedChannelClient *rcc)
 {
     SmartCardChannelClient *scc = SPICE_CONTAINEROF(rcc, SmartCardChannelClient, base);

+
     if (scc->smartcard_state) {
         SmartCardDeviceState *st = scc->smartcard_state;

+        if (scc->write_buf) { /* msg hasn't been pushed to the guest */
+            spice_char_device_write_buffer_release(st->chardev_st, scc->write_buf);
+            scc->write_buf = NULL;
+        }
         smartcard_char_device_detach_client(scc);
         smartcard_char_device_notify_reader_remove(st);
     }

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]