[Spice-commits] 2 commits - src/channel-main.c src/spice-session.c

Victor Toso de Carvalho victortoso at kemper.freedesktop.org
Thu Dec 1 17:19:45 UTC 2016


 src/channel-main.c  |    4 ++--
 src/spice-session.c |    7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 291f3e4419e6fb4077ae43a5e09eb1c37b9dd729
Author: Victor Toso <me at victortoso.com>
Date:   Tue Nov 29 22:34:04 2016 +0100

    channel-usbredir: Fix crash on channel-up
    
    SpiceSession does not initialize its SpiceUsbDeviceManager object on
    startup that could lead to a race condition where channel-usbredir is
    requested to flush data while it is uninitialized.
    
    In a few places, spice_usb_device_manager_get() is called as in
    usb-device-widget.c and spice-gtk-session.c but not used in
    spicy-stats, making the tool to crash on startup if it encounters an
    usbredir channel.
    
     #0 in usbredirhost_write_guest_data (host=0x0) at usbredir/usbredirhost/usbredirhost.c:876
     #1 in spice_usbredir_channel_up (c=0x643830) at channel-usbredir.c:821
     #2 in spice_channel_up (channel=0x643830) at spice-channel.c:1238
     #3 in spice_channel_recv_auth (channel=0x643830) at spice-channel.c:1225
     #4 in spice_channel_coroutine (data=0x643830) at spice-channel.c:2580
     #5 in coroutine_trampoline (cc=0x642ec0) at coroutine_ucontext.c:63
     #6 in continuation_trampoline (i0=6565568, i1=0) at continuation.c:55
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1399838
    
    Signed-off-by: Victor Toso <victortoso at redhat.com>
    Reported-by: Michael Cullen <michael at cullen-online.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/spice-session.c b/src/spice-session.c
index f900bd1..cc3dbdd 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -281,6 +281,7 @@ static void spice_session_init(SpiceSession *session)
 {
     SpiceSessionPrivate *s;
     gchar *channels;
+    GError *err = NULL;
 
     SPICE_DEBUG("New session (compiled from package " PACKAGE_STRING ")");
     s = session->priv = SPICE_SESSION_GET_PRIVATE(session);
@@ -293,6 +294,12 @@ static void spice_session_init(SpiceSession *session)
     s->images = cache_image_new((GDestroyNotify)pixman_image_unref);
     s->glz_window = glz_decoder_window_new();
     update_proxy(session, NULL);
+
+    s->usb_manager = spice_usb_device_manager_get(session, &err);
+    if (err != NULL) {
+        SPICE_DEBUG("Could not initialize SpiceUsbDeviceManager - %s", err->message);
+        g_clear_error(&err);
+    }
 }
 
 static void
commit 3b46d7c775f60224023239ea2f0bbf8d24eab15a
Author: Victor Toso <me at victortoso.com>
Date:   Wed Nov 30 18:45:42 2016 +0100

    channel-main: demote log level from warning to debug
    
    The volume-async happens when agent announce its capabilities. It is
    common that we don't have a playback stream being played at this time
    and it is even harder for a record stream.
    
    If the audio back-end does not cache the last volume used or if this
    is the first time the application is launched, this message will be
    seen.
    
    Failing to get playback or record volume async on startup is very
    common making this warning too worrisome for users.
    
    Signed-off-by: Victor Toso <victortoso at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/channel-main.c b/src/channel-main.c
index 72ca712..ed5d611 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -1171,7 +1171,7 @@ static void audio_playback_volume_info_cb(GObject *object, GAsyncResult *res, gp
                                                       &volume, &error);
     if (ret == FALSE || volume == NULL || nchannels == 0) {
         if (error != NULL) {
-            g_warning("Failed to get playback async volume info: %s", error->message);
+            SPICE_DEBUG("Failed to get playback async volume info: %s", error->message);
             g_error_free(error);
         } else {
             SPICE_DEBUG("Failed to get playback async volume info");
@@ -1227,7 +1227,7 @@ static void audio_record_volume_info_cb(GObject *object, GAsyncResult *res, gpoi
     ret = spice_audio_get_record_volume_info_finish(audio, res, &mute, &nchannels, &volume, &error);
     if (ret == FALSE || volume == NULL || nchannels == 0) {
         if (error != NULL) {
-            g_warning("Failed to get record async volume info: %s", error->message);
+            SPICE_DEBUG("Failed to get record async volume info: %s", error->message);
             g_error_free(error);
         } else {
             SPICE_DEBUG("Failed to get record async volume info");


More information about the Spice-commits mailing list