[Spice-commits] Changes to 'migration/3'

Marc-André Lureau elmarco at kemper.freedesktop.org
Mon Dec 1 08:30:14 PST 2014


New branch 'migration/3' available with the following commits:
commit 14dc8e170e71e4b860afe84cd20900b462e9b132
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 26 17:31:43 2014 +0100

    usb: keep USB context alive as long as channels exist
    
    It was assumed the session would remain alive as long as channel
    existed, so USB context would be valid too. Now that channels
    are removed from session, USB context may be destroyed before
    channels. This produces invalid read/write on USB context.
    Make sure the context is alive as long as USB channels are by
    adding a reference on USB manager.
    
    ==6939== Invalid write of size 4
    ==6939==    at 0x394B604482: libusb_set_debug (core.c:1850)
    ==6939==    by 0x3953A063D5: usbredirhost_open_full (usbredirhost.c:741)
    ==6939==    by 0x4EC7E2F:
    spice_usbredir_channel_set_context (channel-usbredir.c:212)
    ==6939==    by 0x4EC7AB6:
    spice_usbredir_channel_reset (channel-usbredir.c:125)
    ==6939==    by 0x4EACCDC: spice_channel_reset (spice-channel.c:2621)
    ==6939==    by 0x4EACDB4: channel_disconnect (spice-channel.c:2640)
    ==6939==    by 0x4EAC28F: spice_channel_coroutine (spice-channel.c:2423)
    ==6939==    by 0x4EE8B1C: coroutine_trampoline (coroutine_ucontext.c:63)
    ==6939==    by 0x4EE87D6: continuation_trampoline (continuation.c:55)
    ==6939==    by 0x3928247FEF: ??? (in /usr/lib64/libc-2.20.so)
    ==6939==    by 0x51E36FF: ??? (in
    /usr/local/stow/spice-gtk/lib/libspice-client-glib-2.0.so.8.5.0)
    ==6939==    by 0xCF0C18F: ???
    ==6939==  Address 0xff15f90 is 0 bytes inside a block of size 536 free'd
    ==6939==    at 0x4A07CE9: free (in
    /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==6939==    by 0x394B606466: libusb_exit (core.c:2041)
    ==6939==    by 0x4ECC590: spice_usb_device_manager_finalize (usb-device-manager.c:371)

commit a56c7296a61df3aba35baa498d2b3d5afc2af6bc
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 26 17:51:58 2014 +0100

    usb: return early if channel is not usb
    
    Return early if channel is not USB, replace:
    
    if (SPICE_IS_USBREDIR_CHANNEL(channel)) {
        /* code */
    }
    
    with
    
    if (!SPICE_IS_USBREDIR_CHANNEL(channel))
        return;

commit ff25f3eacb1776a754147cd57c76882392382030
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 12 15:55:23 2014 +0100

    session: disconnect in idle
    
    This is a workaround for existing clients such as virt-viewer that do
    not hold a reference to their sessions when calling
    spice_session_disconnect() and crash now that channels are removed from
    session during the call. They expect disconnection events to be deferred
    instead, let's defer actual disconnection to idle time for public
    disconnect API for compatibility reasons (it is still recommended to fix
    client code, for eventual future iterations)

commit 45f417a5f8329804f6d6cce1ba3aeefff3385f1d
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 12 15:55:23 2014 +0100

    session: keep a reference on disconnect
    
    It is idiomatic for client code to clean up its reference on channel
    disconnection. Keeping a reference during disconnect helps solving
    potential crashes if the session is unref'ed during callbacks.

commit 38bf189f0502a1f1570fb5825b571f45f2f47ba5
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 12 15:59:05 2014 +0100

    session: remove sticky disconnecting flag
    
    This used to help prevent double-unref when channel were considered part
    of the session as long as they lived. Now it shouldn't be required
    anymore

commit 5b41e43d0b178219ce295478bf9b35ce122f29aa
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Sun Nov 9 21:55:18 2014 +0100

    channel: deprecate spice_channel_destroy()
    
    This function is somewhat useless, and dangerous since it is calling
    g_object_unref() behind your back (although this is mentioned in the
    doc, I consider this a bad practice).

commit 80f2f98b2c9e908c44c419af543a782804457bec
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 13:55:18 2014 +0100

    display: don't reschedule stream if disconnected from session
    
    Avoid the following critical when a channel is disconnected with a
    pending stream (the streams are cleared on channel reset, after
    coroutine exit)
    
      (process:17188): GSpice-CRITICAL **: spice_session_get_mm_time: assertion 'session != NULL' failed
    
      #0  0x00007ffff71c24e5 in spice_session_get_mm_time (session=0x0) at spice-session.c:1999
      #1  0x00007ffff71d438c in display_stream_schedule (st=0xa33040) at channel-display.c:1014
      #2  0x00007ffff71d4a09 in display_stream_render (st=0xa33040,
          st at entry=<error reading variable: value has been optimized out>) at channel-display.c:1165
      #3  0x0000003e1944a553 in g_timeout_dispatch (source=0xad64e0, callback=<optimized out>, user_data=<optimized out>) at gmain.c:4520
      #4  0x0000003e19449aeb in g_main_context_dispatch (context=0x6a32b0) at gmain.c:3111
      #5  0x0000003e19449aeb in g_main_context_dispatch (context=context at entry=0x6a32b0) at gmain.c:3710
      #6  0x0000003e19449e88 in g_main_context_iterate (context=0x6a32b0, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>) at gmain.c:3781
      #7  0x0000003e1944a1b2 in g_main_loop_run (loop=0x97e200) at gmain.c:3975
      #8  0x0000003e1c9ebb35 in gtk_main () at gtkmain.c:1207
      #9  0x0000000000430185 in main (argc=1, argv=0x7fffffffdcb8) at virt-viewer-main.c:119

commit 8943d232995147214e39314ec375d3e6f3a91bff
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Sun Nov 9 21:47:41 2014 +0100

    session: remove channels on disconnect
    
    A channel is considered to be part of a session as long as it is
    alive. However, this model is problematic, since library user may hold
    channel references, and thus the channel will remain in the
    session. Calling spice_session_disconnect() several time will end up
    calling spice_channel_destroy(), releasing references that aren't owned
    by the session. This usually causes crashes, in particular with language
    bindings that do not deal well with a library model where objects can't
    be referenced at will.

commit a67e5df1496812e6bc8405be95144f0eddc334b8
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 12:06:19 2014 +0100

    session: move SpiceSessionPrivate out of headers
    
    Make sure none of the SpiceSessionPrivate fields are accessed directly anymore

commit e0514dc3f8ebcdd2d97bcc5e561a391a0deae61f
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 12:02:06 2014 +0100

    gtk: do not require glib session private fields
    
    Use GObject object association for session helpers.
    
    GtkSession and DesktopIntegration are in the gtk library SpiceSession is
    in glib one. So far we had the SessionPriv structure shared between the
    two libraries, so they could fit their pointers there. But this is no
    longer possible when moving the private structure in .c. We could add
    more accessors, but they would need to be in public API, and this isn't
    supposed to be accessed by API users.

commit e02733abe9b43b6b84da1e240bf037a656ab98c3
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 11:57:47 2014 +0100

    usb: move device manager initialization to session
    
    Use session accessors to initialize the device manager.
    Add missing session parameter check (public API).

commit 5b0c345e744964e50a3c915ef5d756b7399c2b34
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 11:56:42 2014 +0100

    webdav: move initialization to session
    
    Use session accessors to initialize the webdav server

commit a88a31902a0998ad38f0206ddb5ff6c0c6ea417b
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 26 18:11:01 2014 +0100

    Rename display_channels_count/n_display_channels

commit 3623476d0dc6e4dcac24543a5918123db7b5a08f
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 11:52:13 2014 +0100

    session: add and use internal accessors
    
    Avoid dereferencing session private data directly, and use accessors
    instead.

commit 74c3d288639a12838709ed2cd4881d386c3bc55b
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 26 18:19:50 2014 +0100

    session: set session for migration when connecting

commit 48373b267f750de0ef93cf569206b38597972e43
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 26 13:33:19 2014 +0100

    session: rename migration_copy/for_migration

commit b6f25f9c667de83803ebb3ccb22b3f17c98dd6be
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 11:43:02 2014 +0100

    smartcard: use spice_session_is_for_migration()

commit 2a72a2c665d4d6ecd9861377f7dfb6223cf31c47
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 26 13:52:08 2014 +0100

    smartcard: do not initialize manager for migration session
    
    The migration session is temporary and shouldn't interact with system.

commit 5811432f49fde1ae22e21d94cce638116e0b4c5d
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 11:37:34 2014 +0100

    Add spice_session_is_for_migration()

commit 2fad13d010c395b23d865c03f8045cd654c35dad
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Nov 25 11:33:55 2014 +0100

    session: protect internal functions against invalid args
    
    Make sure calling an internal session function returns with an error
    when called with a NULL pointer. This will help channel code when
    it is removed from session before being destructed.

commit acf99be38c84e0eec4d87cfb1b207087f43a9460
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 26 13:26:38 2014 +0100

    audio: move spice_audio_get() to session

commit d29a23a82979bef25e8104b13f925fecc0961ee4
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Wed Nov 26 13:25:51 2014 +0100

    audio: add accessor to check if audio is enabled



More information about the Spice-commits mailing list