[Spice-devel] [spice-gtk v3 12/19] log: use spice_warning instead of g_warning

Victor Toso victortoso at redhat.com
Sat Mar 12 14:32:13 UTC 2016


---
 src/bio-gio.c                |  4 +--
 src/channel-cursor.c         |  6 ++--
 src/channel-display.c        |  6 ++--
 src/channel-main.c           |  8 ++---
 src/channel-playback.c       |  8 ++---
 src/channel-record.c         |  6 ++--
 src/channel-smartcard.c      |  4 +--
 src/channel-usbredir.c       |  2 +-
 src/channel-webdav.c         | 14 ++++-----
 src/decode-jpeg.c            |  4 +--
 src/decode-zlib.c            |  4 +--
 src/desktop-integration.c    |  8 ++---
 src/spice-channel.c          | 54 ++++++++++++++++----------------
 src/spice-gstaudio.c         | 14 ++++-----
 src/spice-gtk-session.c      | 28 ++++++++---------
 src/spice-option.c           |  2 +-
 src/spice-pulse.c            | 74 ++++++++++++++++++++++----------------------
 src/spice-session.c          | 22 ++++++-------
 src/spice-widget.c           | 14 ++++-----
 src/usb-device-manager.c     | 30 +++++++++---------
 src/vncdisplaykeymap.c       | 26 ++++++++--------
 src/win-usb-dev.c            | 12 +++----
 src/win-usb-driver-install.c | 30 +++++++++---------
 23 files changed, 190 insertions(+), 190 deletions(-)

diff --git a/src/bio-gio.c b/src/bio-gio.c
index f6e3fdb..04d6613 100644
--- a/src/bio-gio.c
+++ b/src/bio-gio.c
@@ -44,7 +44,7 @@ static int bio_gio_write(BIO *bio, const char *in, int inl)
     if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
         BIO_set_retry_write(bio);
     if (error != NULL) {
-        g_warning("%s", error->message);
+        spice_warning("%s", error->message);
         g_clear_error(&error);
     }
 
@@ -63,7 +63,7 @@ static int bio_gio_read(BIO *bio, char *out, int outl)
     if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
         BIO_set_retry_read(bio);
     else if (error != NULL)
-        g_warning("%s", error->message);
+        spice_warning("%s", error->message);
 
     g_clear_error(&error);
 
diff --git a/src/channel-cursor.c b/src/channel-cursor.c
index 0765209..2dbdc90 100644
--- a/src/channel-cursor.c
+++ b/src/channel-cursor.c
@@ -375,8 +375,8 @@ static display_cursor *set_cursor(SpiceChannel *channel, SpiceCursor *scursor)
 
         break;
     default:
-        g_warning("%s: unimplemented cursor type %d", __FUNCTION__,
-                  hdr->type);
+        spice_warning("%s: unimplemented cursor type %d", __FUNCTION__,
+                      hdr->type);
         cursor->default_cursor = TRUE;
         goto cache_add;
     }
@@ -490,7 +490,7 @@ static void cursor_handle_trail(SpiceChannel *channel, SpiceMsgIn *in)
 
     g_return_if_fail(c->init_done == TRUE);
 
-    g_warning("%s: TODO", __FUNCTION__);
+    spice_warning("%s: TODO", __FUNCTION__);
 }
 
 /* coroutine context */
diff --git a/src/channel-display.c b/src/channel-display.c
index f87c7f7..8e4d3ea 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -702,7 +702,7 @@ static HDC create_compatible_dc(void)
 {
     HDC dc = CreateCompatibleDC(NULL);
     if (!dc) {
-        g_warning("create compatible DC failed");
+        spice_warning("create compatible DC failed");
     }
     return dc;
 }
@@ -1850,12 +1850,12 @@ static void display_handle_monitors_config(SpiceChannel *channel, SpiceMsgIn *in
 
     c->monitors_max = config->max_allowed;
     if (CLAMP_CHECK(c->monitors_max, 1, MONITORS_MAX)) {
-        g_warning("MonitorConfig max_allowed is not within permitted range, clamping");
+        spice_warning("MonitorConfig max_allowed is not within permitted range, clamping");
         c->monitors_max = CLAMP(c->monitors_max, 1, MONITORS_MAX);
     }
 
     if (CLAMP_CHECK(config->count, 1, c->monitors_max)) {
-        g_warning("MonitorConfig count is not within permitted range, clamping");
+        spice_warning("MonitorConfig count is not within permitted range, clamping");
         config->count = CLAMP(config->count, 1, c->monitors_max);
     }
 
diff --git a/src/channel-main.c b/src/channel-main.c
index c48e881..f3913e6 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -997,7 +997,7 @@ static void agent_send_msg_queue(SpiceMainChannel *channel)
     }
     if (g_queue_is_empty(c->agent_msg_queue) &&
         g_hash_table_size(c->flushing) != 0) {
-        g_warning("unexpected flush task in list, clearing");
+        spice_warning("unexpected flush task in list, clearing");
         file_xfer_flushed(channel, TRUE);
     }
 }
@@ -2137,8 +2137,8 @@ static void main_agent_handle_msg(SpiceChannel *channel,
         file_xfer_handle_status(self, payload);
         break;
     default:
-        g_warning("unhandled agent message type: %u (%s), size %u",
-                  msg->type, NAME(agent_msg_types, msg->type), msg->size);
+        spice_warning("unhandled agent message type: %u (%s), size %u",
+                      msg->type, NAME(agent_msg_types, msg->type), msg->size);
     }
 }
 
@@ -2570,7 +2570,7 @@ static void main_handle_migrate_switch_host(SpiceChannel *channel, SpiceMsgIn *i
                 host, mig->port, mig->sport, subject);
 
     if (c->switch_host_delayed_id != 0) {
-        g_warning("Switching host already in progress, aborting it");
+        spice_warning("Switching host already in progress, aborting it");
         g_warn_if_fail(g_source_remove(c->switch_host_delayed_id));
         c->switch_host_delayed_id = 0;
     }
diff --git a/src/channel-playback.c b/src/channel-playback.c
index 0b579ac..232c0f1 100644
--- a/src/channel-playback.c
+++ b/src/channel-playback.c
@@ -328,7 +328,7 @@ static void playback_handle_data(SpiceChannel *channel, SpiceMsgIn *in)
 
         if (snd_codec_decode(c->codec, packet->data, packet->data_size,
                     pcm, &n) != SND_CODEC_OK) {
-            g_warning("snd_codec_decode() error");
+            spice_warning("snd_codec_decode() error");
             return;
         }
     }
@@ -356,7 +356,7 @@ static void playback_handle_mode(SpiceChannel *channel, SpiceMsgIn *in)
     case SPICE_AUDIO_DATA_MODE_OPUS:
         break;
     default:
-        g_warning("%s: unhandled mode", __FUNCTION__);
+        spice_warning("%s: unhandled mode", __FUNCTION__);
         break;
     }
 }
@@ -378,7 +378,7 @@ static void playback_handle_start(SpiceChannel *channel, SpiceMsgIn *in)
 
     if (c->mode != SPICE_AUDIO_DATA_MODE_RAW) {
         if (snd_codec_create(&c->codec, c->mode, start->frequency, SND_CODEC_DECODE) != SND_CODEC_OK) {
-            g_warning("create decoder failed");
+            spice_warning("create decoder failed");
             return;
         }
     }
@@ -402,7 +402,7 @@ static void playback_handle_set_volume(SpiceChannel *channel, SpiceMsgIn *in)
     SpiceMsgAudioVolume *vol = spice_msg_in_parsed(in);
 
     if (vol->nchannels == 0) {
-        g_warning("spice-server send audio-volume-msg with 0 channels");
+        spice_warning("spice-server send audio-volume-msg with 0 channels");
         return;
     }
 
diff --git a/src/channel-record.c b/src/channel-record.c
index 08269c9..be72b97 100644
--- a/src/channel-record.c
+++ b/src/channel-record.c
@@ -377,7 +377,7 @@ void spice_record_send_data(SpiceRecordChannel *channel, gpointer data,
         if (rc->mode != SPICE_AUDIO_DATA_MODE_RAW) {
             int len = SND_CODEC_MAX_COMPRESSED_BYTES;
             if (snd_codec_encode(rc->codec, frame, frame_size, encode_buf, &len) != SND_CODEC_OK) {
-                g_warning("encode failed");
+                spice_warning("encode failed");
                 return;
             }
             frame = encode_buf;
@@ -417,7 +417,7 @@ static void record_handle_start(SpiceChannel *channel, SpiceMsgIn *in)
 
     if (c->mode != SPICE_AUDIO_DATA_MODE_RAW) {
         if (snd_codec_create(&c->codec, c->mode, start->frequency, SND_CODEC_ENCODE) != SND_CODEC_OK) {
-            g_warning("Failed to create encoder");
+            spice_warning("Failed to create encoder");
             return;
         }
         frame_size = snd_codec_frame_size(c->codec);
@@ -448,7 +448,7 @@ static void record_handle_set_volume(SpiceChannel *channel, SpiceMsgIn *in)
     SpiceMsgAudioVolume *vol = spice_msg_in_parsed(in);
 
     if (vol->nchannels == 0) {
-        g_warning("spice-server send audio-volume-msg with 0 channels");
+        spice_warning("spice-server send audio-volume-msg with 0 channels");
         return;
     }
 
diff --git a/src/channel-smartcard.c b/src/channel-smartcard.c
index 7f3306e..bc13a54 100644
--- a/src/channel-smartcard.c
+++ b/src/channel-smartcard.c
@@ -468,7 +468,7 @@ static void spice_smartcard_channel_up_cb(GObject *source_object,
     spice_smartcard_manager_init_finish(SPICE_SESSION(source_object),
                                         res, &error);
     if (error) {
-        g_warning("%s", error->message);
+        spice_warning("%s", error->message);
         goto end;
     }
 
@@ -545,7 +545,7 @@ static void handle_smartcard_msg(SpiceChannel *channel, SpiceMsgIn *in)
                 case VSC_ReaderRemove:
                     break;
                 default:
-                    g_warning("Unexpected message: %d", priv->in_flight_message->message_type);
+                    spice_warning("Unexpected message: %d", priv->in_flight_message->message_type);
                     break;
             }
             smartcard_message_complete_in_flight(smartcard_channel);
diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
index f16a30f..844bb27 100644
--- a/src/channel-usbredir.c
+++ b/src/channel-usbredir.c
@@ -514,7 +514,7 @@ static void usbredir_log(void *user_data, int level, const char *msg)
         case usbredirparser_error:
             g_critical("%s", msg); break;
         case usbredirparser_warning:
-            g_warning("%s", msg); break;
+            spice_warning("%s", msg); break;
         default:
             CHANNEL_DEBUG(channel, "%s", msg); break;
     }
diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index e72c92c..2a3e2f1 100644
--- a/src/channel-webdav.c
+++ b/src/channel-webdav.c
@@ -120,7 +120,7 @@ static void output_queue_flush_cb(GObject *source_object,
     g_output_stream_flush_finish(G_OUTPUT_STREAM(source_object),
                                  res, &error);
     if (error)
-        g_warning("error: %s", error->message);
+        spice_warning("error: %s", error->message);
 
     g_clear_error(&error);
 
@@ -158,9 +158,9 @@ static gboolean output_queue_idle(gpointer user_data)
     return TRUE;
 
 err:
-    g_warning("failed to write to output stream");
+    spice_warning("failed to write to output stream");
     if (error)
-        g_warning("error: %s", error->message);
+        spice_warning("error: %s", error->message);
     g_clear_error(&error);
 
     q->idle_id = 0;
@@ -277,7 +277,7 @@ static void server_reply_cb(GObject *source_object,
 end:
     if (err) {
         if (!g_cancellable_is_cancelled(client->cancellable))
-            g_warning("read error: %s", err->message);
+            spice_warning("read error: %s", err->message);
         remove_client(self, client);
         g_clear_error(&err);
     }
@@ -413,7 +413,7 @@ static void data_read_cb(GObject *source_object,
 
     size = spice_vmc_input_stream_read_all_finish(G_INPUT_STREAM(source_object), res, &error);
     if (error) {
-        g_warning("error: %s", error->message);
+        spice_warning("error: %s", error->message);
         g_clear_error(&error);
         return;
     }
@@ -453,7 +453,7 @@ static void size_read_cb(GObject *source_object,
 
 end:
     if (error) {
-        g_warning("error: %s", error->message);
+        spice_warning("error: %s", error->message);
         g_clear_error(&error);
     }
 }
@@ -480,7 +480,7 @@ static void client_read_cb(GObject *source_object,
 
 end:
     if (error) {
-        g_warning("error: %s", error->message);
+        spice_warning("error: %s", error->message);
         g_clear_error(&error);
     }
 }
diff --git a/src/decode-jpeg.c b/src/decode-jpeg.c
index 697d0de..694178f 100644
--- a/src/decode-jpeg.c
+++ b/src/decode-jpeg.c
@@ -118,7 +118,7 @@ static void decode(SpiceJpegDecoder *decoder,
         converter = convert_rgb_to_bgrx;
         break;
     default:
-        g_warning("bad bitmap format, %d", format);
+        spice_warning("bad bitmap format, %d", format);
         return;
     }
 
@@ -146,7 +146,7 @@ static void jpeg_decoder_init_source(j_decompress_ptr cinfo)
 
 static boolean jpeg_decoder_fill_input_buffer(j_decompress_ptr cinfo)
 {
-    g_warning("no more data for jpeg");
+    spice_warning("no more data for jpeg");
     return FALSE;
 }
 
diff --git a/src/decode-zlib.c b/src/decode-zlib.c
index a5325c0..d49ce46 100644
--- a/src/decode-zlib.c
+++ b/src/decode-zlib.c
@@ -47,7 +47,7 @@ static void decode(SpiceZlibDecoder *decoder,
     z_ret = inflate(&d->_z_strm, Z_FINISH);
 
     if (z_ret != Z_STREAM_END) {
-        g_warning("zlib inflate failed, error %d", z_ret);
+        spice_warning("zlib inflate failed, error %d", z_ret);
     }
 }
 
@@ -67,7 +67,7 @@ SpiceZlibDecoder *zlib_decoder_new(void)
     d->_z_strm.avail_in = 0;
     z_ret = inflateInit(&d->_z_strm);
     if (z_ret != Z_OK) {
-        g_warning("zlib decoder init failed, error %d", z_ret);
+        spice_warning("zlib decoder init failed, error %d", z_ret);
         goto fail;
     }
 
diff --git a/src/desktop-integration.c b/src/desktop-integration.c
index 5868d48..db99a9b 100644
--- a/src/desktop-integration.c
+++ b/src/desktop-integration.c
@@ -56,7 +56,7 @@ static void handle_dbus_call_error(const char *call, GError **_error)
     GError *error = *_error;
     const char *message = error->message;
 
-    g_warning("Error calling '%s': %s", call, message);
+    spice_warning("Error calling '%s': %s", call, message);
     g_clear_error(_error);
 }
 
@@ -88,8 +88,8 @@ static gboolean gnome_integration_init(SpiceDesktopIntegration *self)
 #endif
 
     if (error) {
-        g_warning("Could not create org.gnome.SessionManager dbus proxy: %s",
-                  error->message);
+        spice_warning("Could not create org.gnome.SessionManager dbus proxy: %s",
+                      error->message);
         g_clear_error(&error);
         return FALSE;
     }
@@ -171,7 +171,7 @@ static void spice_desktop_integration_init(SpiceDesktopIntegration *self)
     self->priv = priv;
 
     if (!gnome_integration_init(self))
-       g_warning("Warning no automount-inhibiting implementation available");
+       spice_warning("Warning no automount-inhibiting implementation available");
 }
 
 static void spice_desktop_integration_dispose(GObject *gobject)
diff --git a/src/spice-channel.c b/src/spice-channel.c
index 4529505..4dbc1b8 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -707,7 +707,7 @@ void spice_msg_out_send(SpiceMsgOut *out)
 
     STATIC_MUTEX_LOCK(c->xmit_queue_lock);
     if (c->xmit_queue_blocked) {
-        g_warning("message queue is blocked, dropping message");
+        spice_warning("message queue is blocked, dropping message");
         goto end;
     }
 
@@ -816,8 +816,8 @@ static void spice_channel_flush_sasl(SpiceChannel *channel, const void *data, si
 
     err = sasl_encode(c->sasl_conn, data, len, &output, &outputlen);
     if (err != SASL_OK) {
-        g_warning ("Failed to encode SASL data %s",
-                   sasl_errstring(err, NULL, NULL));
+        spice_warning ("Failed to encode SASL data %s",
+                       sasl_errstring(err, NULL, NULL));
         c->has_error = TRUE;
         return;
     }
@@ -854,7 +854,7 @@ static void spice_channel_write_msg(SpiceChannel *channel, SpiceMsgOut *out)
 
     if (out->ro_check &&
         spice_channel_get_read_only(channel)) {
-        g_warning("Try to send message while read-only. Please report a bug.");
+        spice_warning("Try to send message while read-only. Please report a bug.");
         return;
     }
 
@@ -931,7 +931,7 @@ gint spice_channel_unix_read_fd(SpiceChannel *channel)
         if (errno == EWOULDBLOCK) {
             g_coroutine_socket_wait(&c->coroutine, c->sock, G_IO_IN);
         } else {
-            g_warning("failed to get fd: %s", g_strerror(errno));
+            spice_warning("failed to get fd: %s", g_strerror(errno));
             return -1;
         }
     }
@@ -1025,8 +1025,8 @@ static int spice_channel_read_sasl(SpiceChannel *channel, void *data, size_t len
         err = sasl_decode(c->sasl_conn, encoded, ret,
                           &c->sasl_decoded, &c->sasl_decoded_length);
         if (err != SASL_OK) {
-            g_warning("Failed to decode SASL data %s",
-                      sasl_errstring(err, NULL, NULL));
+            spice_warning("Failed to decode SASL data %s",
+                          sasl_errstring(err, NULL, NULL));
             c->has_error = TRUE;
             return -EINVAL;
         }
@@ -1291,12 +1291,12 @@ static gboolean spice_channel_recv_link_hdr(SpiceChannel *channel)
 
     rc = spice_channel_read(channel, &c->peer_hdr, sizeof(c->peer_hdr));
     if (rc != sizeof(c->peer_hdr)) {
-        g_warning("incomplete link header (%d/%" G_GSIZE_FORMAT ")",
-                  rc, sizeof(c->peer_hdr));
+        spice_warning("incomplete link header (%d/%" G_GSIZE_FORMAT ")",
+                      rc, sizeof(c->peer_hdr));
         goto error;
     }
     if (c->peer_hdr.magic != SPICE_MAGIC) {
-        g_warning("invalid SPICE_MAGIC!");
+        spice_warning("invalid SPICE_MAGIC!");
         goto error;
     }
 
@@ -1304,8 +1304,8 @@ static gboolean spice_channel_recv_link_hdr(SpiceChannel *channel)
                   GUINT32_FROM_LE(c->peer_hdr.major_version),
                   GUINT32_FROM_LE(c->peer_hdr.minor_version));
     if (c->peer_hdr.major_version != c->link_hdr.major_version) {
-        g_warning("major mismatch (got %d, expected %d)",
-                  c->peer_hdr.major_version, c->link_hdr.major_version);
+        spice_warning("major mismatch (got %d, expected %d)",
+                      c->peer_hdr.major_version, c->link_hdr.major_version);
         goto error;
     }
 
@@ -1315,7 +1315,7 @@ static gboolean spice_channel_recv_link_hdr(SpiceChannel *channel)
 
     c->peer_msg = g_malloc0(c->peer_hdr.size);
     if (c->peer_msg == NULL) {
-        g_warning("invalid peer header size: %u", c->peer_hdr.size);
+        spice_warning("invalid peer header size: %u", c->peer_hdr.size);
         goto error;
     }
 
@@ -1827,8 +1827,8 @@ static gboolean spice_channel_recv_link_msg(SpiceChannel *channel)
         c->tls = TRUE;
         return FALSE;
     default:
-        g_warning("%s: %s: unhandled error %d",
-                c->name, __FUNCTION__, c->peer_msg->error);
+        spice_warning("%s: %s: unhandled error %d",
+                      c->name, __FUNCTION__, c->peer_msg->error);
         goto error;
     }
 
@@ -1878,7 +1878,7 @@ static gboolean spice_channel_recv_link_msg(SpiceChannel *channel)
             if ((event = spice_channel_send_spice_ticket(channel)) != SPICE_CHANNEL_NONE)
                 goto error;
         } else {
-            g_warning("No compatible AUTH mechanism");
+            spice_warning("No compatible AUTH mechanism");
             goto error;
         }
     }
@@ -2376,7 +2376,7 @@ static int spice_channel_load_ca(SpiceChannel *channel)
     if (ca_file != NULL) {
         rc = SSL_CTX_load_verify_locations(c->ctx, ca_file, NULL);
         if (rc != 1)
-            g_warning("loading ca certs from %s failed", ca_file);
+            spice_warning("loading ca certs from %s failed", ca_file);
         else
             count++;
     }
@@ -2384,7 +2384,7 @@ static int spice_channel_load_ca(SpiceChannel *channel)
     if (count == 0) {
         rc = SSL_CTX_set_default_verify_paths(c->ctx);
         if (rc != 1)
-            g_warning("loading ca certs from default location failed");
+            spice_warning("loading ca certs from default location failed");
         else
             count++;
     }
@@ -2475,9 +2475,9 @@ reconnect:
             (SPICE_SESSION_VERIFY_SUBJECT | SPICE_SESSION_VERIFY_HOSTNAME)) {
             rc = spice_channel_load_ca(channel);
             if (rc == 0) {
-                g_warning("no cert loaded");
+                spice_warning("no cert loaded");
                 if (verify & SPICE_SESSION_VERIFY_PUBKEY) {
-                    g_warning("only pubkey active");
+                    spice_warning("only pubkey active");
                     verify = SPICE_SESSION_VERIFY_PUBKEY;
                 } else {
                     c->event = SPICE_CHANNEL_ERROR_TLS;
@@ -2491,7 +2491,7 @@ reconnect:
             if (ciphers != NULL) {
                 rc = SSL_CTX_set_cipher_list(c->ctx, ciphers);
                 if (rc != 1)
-                    g_warning("loading cipher list %s failed", ciphers);
+                    spice_warning("loading cipher list %s failed", ciphers);
             }
         }
 
@@ -2525,8 +2525,8 @@ ssl_reconnect:
                 g_coroutine_socket_wait(&c->coroutine, c->sock, G_IO_OUT|G_IO_ERR|G_IO_HUP);
                 goto ssl_reconnect;
             } else {
-                g_warning("%s: SSL_connect: %s",
-                          c->name, ERR_error_string(rc, NULL));
+                spice_warning("%s: SSL_connect: %s",
+                              c->name, ERR_error_string(rc, NULL));
                 c->event = SPICE_CHANNEL_ERROR_TLS;
                 goto cleanup;
             }
@@ -2545,8 +2545,8 @@ connected:
         && (errno != ENOTSUP)
 #endif
         ) {
-        g_warning("%s: could not set sockopt TCP_NODELAY: %s", c->name,
-                  strerror(errno));
+        spice_warning("%s: could not set sockopt TCP_NODELAY: %s", c->name,
+                      strerror(errno));
     }
 
     spice_channel_send_link(channel);
@@ -2606,7 +2606,7 @@ static gboolean channel_connect(SpiceChannel *channel, gboolean tls)
 
     if (c->session == NULL || c->channel_type == -1 || c->channel_id == -1) {
         /* unset properties or unknown channel type */
-        g_warning("%s: channel setup incomplete", __FUNCTION__);
+        spice_warning("%s: channel setup incomplete", __FUNCTION__);
         return false;
     }
 
@@ -2680,7 +2680,7 @@ gboolean spice_channel_open_fd(SpiceChannel *channel, int fd)
 
     c = channel->priv;
     if (c->state > SPICE_CHANNEL_STATE_CONNECTING) {
-        g_warning("Invalid channel_connect state: %d", c->state);
+        spice_warning("Invalid channel_connect state: %d", c->state);
         return true;
     }
 
diff --git a/src/spice-gstaudio.c b/src/spice-gstaudio.c
index 2177df1..3f9eaab 100644
--- a/src/spice-gstaudio.c
+++ b/src/spice-gstaudio.c
@@ -168,14 +168,14 @@ static gboolean record_bus_cb(GstBus *bus, GstMessage *msg, gpointer data)
         s = gst_app_sink_pull_sample(GST_APP_SINK(p->record.sink));
         if (!s) {
             if (!gst_app_sink_is_eos(GST_APP_SINK(p->record.sink)))
-                g_warning("eos not reached, but can't pull new sample");
+                spice_warning("eos not reached, but can't pull new sample");
             return TRUE;
         }
 
         buffer = gst_sample_get_buffer(s);
         if (!buffer) {
             if (!gst_app_sink_is_eos(GST_APP_SINK(p->record.sink)))
-                g_warning("eos not reached, but can't pull new buffer");
+                spice_warning("eos not reached, but can't pull new buffer");
             return TRUE;
         }
         if (!gst_buffer_map(buffer, &mapping, GST_MAP_READ)) {
@@ -226,7 +226,7 @@ static void record_start(SpiceRecordChannel *channel, gint format, gint channels
 
         p->record.pipe = gst_parse_launch(pipeline, &error);
         if (error != NULL) {
-            g_warning("Failed to create pipeline: %s", error->message);
+            spice_warning("Failed to create pipeline: %s", error->message);
             goto cleanup;
         }
 
@@ -319,7 +319,7 @@ static void playback_start(SpicePlaybackChannel *channel, gint format, gint chan
         spice_debug("audio pipeline: %s", pipeline);
         p->playback.pipe = gst_parse_launch(pipeline, &error);
         if (error != NULL) {
-            g_warning("Failed to create pipeline: %s", error->message);
+            spice_warning("Failed to create pipeline: %s", error->message);
             goto cleanup;
         }
         p->playback.src = gst_bin_get_by_name(GST_BIN(p->playback.pipe), "appsrc");
@@ -455,7 +455,7 @@ static void record_volume_changed(GObject *object, GParamSpec *pspec, gpointer d
     if (GST_IS_STREAM_VOLUME(e))
         gst_stream_volume_set_volume(GST_STREAM_VOLUME(e), GST_STREAM_VOLUME_FORMAT_CUBIC, vol);
     else
-        g_warning("gst lacks volume capabilities on src (TODO)");
+        spice_warning("gst lacks volume capabilities on src (TODO)");
 
     g_object_unref(e);
 }
@@ -481,7 +481,7 @@ static void record_mute_changed(GObject *object, GParamSpec *pspec, gpointer dat
     if (GST_IS_STREAM_VOLUME (e))
         gst_stream_volume_set_mute(GST_STREAM_VOLUME(e), mute);
     else
-        g_warning("gst lacks mute capabilities on src: %d (TODO)", mute);
+        spice_warning("gst lacks mute capabilities on src: %d (TODO)", mute);
 
     g_object_unref(e);
 }
@@ -559,7 +559,7 @@ SpiceGstaudio *spice_gstaudio_new(SpiceSession *session, GMainContext *context,
                             NULL);
     }
 
-    g_warning("Disabling GStreamer audio support: %s", err->message);
+    spice_warning("Disabling GStreamer audio support: %s", err->message);
     g_clear_error(&err);
     return NULL;
 }
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 6924d86..28d120b 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -172,7 +172,7 @@ static guint32 get_keyboard_lock_modifiers(void)
         modifiers |= SPICE_INPUTS_SCROLL_LOCK;
     }
 #else
-    g_warning("get_keyboard_lock_modifiers not implemented");
+    spice_warning("get_keyboard_lock_modifiers not implemented");
 #endif // HAVE_X11_XKBLIB_H
 #endif // GTK_CHECK_VERSION(3,18,0)
     return modifiers;
@@ -483,7 +483,7 @@ static GtkClipboard* get_clipboard_from_selection(SpiceGtkSessionPrivate *s,
     } else if (selection == VD_AGENT_CLIPBOARD_SELECTION_PRIMARY) {
         return s->clipboard_primary;
     } else {
-        g_warning("Unhandled clipboard selection: %d", selection);
+        spice_warning("Unhandled clipboard selection: %d", selection);
         return NULL;
     }
 }
@@ -496,7 +496,7 @@ static gint get_selection_from_clipboard(SpiceGtkSessionPrivate *s,
     } else if (cb == s->clipboard_primary) {
         return VD_AGENT_CLIPBOARD_SELECTION_PRIMARY;
     } else {
-        g_warning("Unhandled clipboard");
+        spice_warning("Unhandled clipboard");
         return -1;
     }
 }
@@ -712,7 +712,7 @@ static void clipboard_got_from_guest(SpiceMainChannel *main, guint selection,
 
             conv = spice_dos2unix((gchar*)data, size, &err);
             if (err) {
-                g_warning("Failed to convert text line ending: %s", err->message);
+                spice_warning("Failed to convert text line ending: %s", err->message);
                 g_clear_error(&err);
                 goto end;
             }
@@ -736,7 +736,7 @@ end:
 
 static void clipboard_agent_connected(RunInfo *ri)
 {
-    g_warning("agent status changed, cancel clipboard request");
+    spice_warning("agent status changed, cancel clipboard request");
 
     if (g_main_loop_is_running(ri->loop))
         g_main_loop_quit(ri->loop);
@@ -837,8 +837,8 @@ static gboolean clipboard_grab(SpiceMainChannel *main, guint selection,
             }
         }
         if (!found) {
-            g_warning("clipboard: couldn't find a matching type for: %d",
-                      types[n]);
+            spice_warning("clipboard: couldn't find a matching type for: %d",
+                          types[n]);
         }
     }
 
@@ -855,7 +855,7 @@ static gboolean clipboard_grab(SpiceMainChannel *main, guint selection,
 
     if (!gtk_clipboard_set_with_owner(cb, targets, i,
                                       clipboard_get, clipboard_clear, G_OBJECT(self))) {
-        g_warning("clipboard grab failed");
+        spice_warning("clipboard grab failed");
         return FALSE;
     }
     s->clipboard_by_guest[selection] = TRUE;
@@ -872,8 +872,8 @@ static gboolean check_clipboard_size_limits(SpiceGtkSession *session,
 
     g_object_get(session->priv->main, "max-clipboard", &max_clipboard, NULL);
     if (max_clipboard != -1 && clipboard_len > max_clipboard) {
-        g_warning("discarded clipboard of size %d (max: %d)",
-                  clipboard_len, max_clipboard);
+        spice_warning("discarded clipboard of size %d (max: %d)",
+                      clipboard_len, max_clipboard);
         return FALSE;
     } else if (clipboard_len <= 0) {
         spice_debug("discarding empty clipboard");
@@ -919,7 +919,7 @@ static void clipboard_received_cb(GtkClipboard *clipboard,
         }
 
         if (m >= SPICE_N_ELEMENTS(atom2agent)) {
-            g_warning("clipboard_received for unsupported type: %s", name);
+            spice_warning("clipboard_received for unsupported type: %s", name);
         } else {
             type = atom2agent[m].vdagent;
         }
@@ -937,7 +937,7 @@ static void clipboard_received_cb(GtkClipboard *clipboard,
 
             conv = spice_unix2dos((gchar*)data, len, &err);
             if (err) {
-                g_warning("Failed to convert text line ending: %s", err->message);
+                spice_warning("Failed to convert text line ending: %s", err->message);
                 g_clear_error(&err);
                 return;
             }
@@ -1186,13 +1186,13 @@ void spice_gtk_session_paste_from_guest(SpiceGtkSession *self)
     int selection = VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD;
 
     if (s->nclip_targets[selection] == 0) {
-        g_warning("Guest clipboard is not available.");
+        spice_warning("Guest clipboard is not available.");
         return;
     }
 
     if (!gtk_clipboard_set_with_owner(s->clipboard, s->clip_targets[selection], s->nclip_targets[selection],
                                       clipboard_get, clipboard_clear, G_OBJECT(self))) {
-        g_warning("Clipboard grab failed");
+        spice_warning("Clipboard grab failed");
         return;
     }
     s->clipboard_by_guest[selection] = TRUE;
diff --git a/src/spice-option.c b/src/spice-option.c
index 06b9b19..51ec801 100644
--- a/src/spice-option.c
+++ b/src/spice-option.c
@@ -144,7 +144,7 @@ static gboolean parse_usbredir_filter(const gchar *option_name,
                                       gpointer data, GError **error)
 
 {
-    g_warning("--spice-usbredir-filter is deprecated, please use --spice-usbredir-auto-redirect-filter instead");
+    spice_warning("--spice-usbredir-filter is deprecated, please use --spice-usbredir-auto-redirect-filter instead");
     g_free(usbredir_auto_redirect_filter);
     usbredir_auto_redirect_filter = g_strdup(value);
     return TRUE;
diff --git a/src/spice-pulse.c b/src/spice-pulse.c
index 36c021c..0a39cdc 100644
--- a/src/spice-pulse.c
+++ b/src/spice-pulse.c
@@ -194,7 +194,7 @@ static void pulse_uncork_cb(pa_stream *pastream, int success, void *data)
     struct stream *s = data;
 
     if (!success)
-        g_warning("pulseaudio uncork operation failed");
+        spice_warning("pulseaudio uncork operation failed");
 
     pa_operation_unref(s->uncork_op);
     s->uncork_op = NULL;
@@ -215,8 +215,8 @@ static void stream_uncork(SpicePulse *pulse, struct stream *s)
 
     if (pa_stream_is_corked(s->stream) && !s->uncork_op) {
         if (!(o = pa_stream_cork(s->stream, 0, pulse_uncork_cb, s))) {
-            g_warning("pa_stream_uncork() failed: %s",
-                      pa_strerror(pa_context_errno(p->context)));
+            spice_warning("pa_stream_uncork() failed: %s",
+                          pa_strerror(pa_context_errno(p->context)));
         }
         s->uncork_op = o;
     }
@@ -227,7 +227,7 @@ static void pulse_flush_cb(pa_stream *pastream, int success, void *data)
     struct stream *s = data;
 
     if (!success)
-        g_warning("pulseaudio flush operation failed");
+        spice_warning("pulseaudio flush operation failed");
 
     pa_operation_unref(s->cork_op);
     s->cork_op = NULL;
@@ -238,12 +238,12 @@ static void pulse_cork_flush_cb(pa_stream *pastream, int success, void *data)
     struct stream *s = data;
 
     if (!success)
-        g_warning("pulseaudio cork operation failed");
+        spice_warning("pulseaudio cork operation failed");
 
     pa_operation_unref(s->cork_op);
 
     if (!(s->cork_op = pa_stream_flush(s->stream, pulse_flush_cb, s))) {
-        g_warning("pa_stream_flush() failed");
+        spice_warning("pa_stream_flush() failed");
     }
 }
 
@@ -253,7 +253,7 @@ static void pulse_cork_cb(pa_stream *pastream, int success, void *data)
 
     spice_debug("%s: cork started", __FUNCTION__);
     if (!success)
-        g_warning("pulseaudio cork operation failed");
+        spice_warning("pulseaudio cork operation failed");
 
     pa_operation_unref(s->cork_op);
     s->cork_op = NULL;
@@ -275,8 +275,8 @@ static void stream_cork(SpicePulse *pulse, struct stream *s, gboolean with_flush
                                  with_flush ? pulse_cork_flush_cb :
                                               pulse_cork_cb,
                                  s))) {
-            g_warning("pa_stream_cork() failed: %s",
-                      pa_strerror(pa_context_errno(p->context)));
+            spice_warning("pa_stream_cork() failed: %s",
+                          pa_strerror(pa_context_errno(p->context)));
         }
         s->cork_op = o;
     }
@@ -287,8 +287,8 @@ static void stream_stop(SpicePulse *pulse, struct stream *s)
     SpicePulsePrivate *p = pulse->priv;
 
     if (pa_stream_disconnect(s->stream) < 0) {
-        g_warning("pa_stream_disconnect() failed: %s",
-                  pa_strerror(pa_context_errno(p->context)));
+        spice_warning("pa_stream_disconnect() failed: %s",
+                      pa_strerror(pa_context_errno(p->context)));
     }
     pa_stream_unref(s->stream);
     s->stream = NULL;
@@ -311,7 +311,7 @@ static void stream_state_callback(pa_stream *s, void *userdata)
             break;
         case PA_STREAM_FAILED:
         default:
-            g_warning("Stream error: %s", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
+            spice_warning("Stream error: %s", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
     }
 }
 
@@ -357,7 +357,7 @@ static void stream_update_latency_callback(pa_stream *s, void *userdata)
         return;
 
     if (pa_stream_get_latency(s, &usec, &negative) < 0) {
-        g_warning("Failed to get latency: %s", pa_strerror(pa_context_errno(p->context)));
+        spice_warning("Failed to get latency: %s", pa_strerror(pa_context_errno(p->context)));
         return;
     }
 
@@ -400,8 +400,8 @@ static void create_playback(SpicePulse *pulse)
 
     if (pa_stream_connect_playback(p->playback.stream,
                                    NULL, &buffer_attr, flags, NULL, NULL) < 0) {
-        g_warning("pa_stream_connect_playback() failed: %s",
-                  pa_strerror(pa_context_errno(p->context)));
+        spice_warning("pa_stream_connect_playback() failed: %s",
+                      pa_strerror(pa_context_errno(p->context)));
     }
 }
 
@@ -475,8 +475,8 @@ static void playback_data(SpicePlaybackChannel *channel,
             spice_debug("%s: pulse playback stream ready", __FUNCTION__);
         }
         if (pa_stream_write(p->playback.stream, audio, size, NULL, 0, PA_SEEK_RELATIVE) < 0) {
-            g_warning("pa_stream_write() failed: %s",
-                      pa_strerror(pa_context_errno(p->context)));
+            spice_warning("pa_stream_write() failed: %s",
+                          pa_strerror(pa_context_errno(p->context)));
         }
         break;
     default:
@@ -513,8 +513,8 @@ static void stream_read_callback(pa_stream *s, size_t length, void *data)
         const void *snddata;
 
         if (pa_stream_peek(s, &snddata, &length) < 0) {
-            g_warning("pa_stream_peek() failed: %s",
-                      pa_strerror(pa_context_errno(p->context)));
+            spice_warning("pa_stream_peek() failed: %s",
+                          pa_strerror(pa_context_errno(p->context)));
             return;
         }
 
@@ -528,8 +528,8 @@ static void stream_read_callback(pa_stream *s, size_t length, void *data)
                                    (gpointer)snddata, length, 0);
 
         if (pa_stream_drop(s) < 0) {
-            g_warning("pa_stream_drop() failed: %s",
-                      pa_strerror(pa_context_errno(p->context)));
+            spice_warning("pa_stream_drop() failed: %s",
+                          pa_strerror(pa_context_errno(p->context)));
             return;
         }
     }
@@ -560,8 +560,8 @@ static void create_record(SpicePulse *pulse)
     flags = PA_STREAM_ADJUST_LATENCY;
 
     if (pa_stream_connect_record(p->record.stream, NULL, &buffer_attr, flags) < 0) {
-        g_warning("pa_stream_connect_record() failed: %s",
-                  pa_strerror(pa_context_errno(p->context)));
+        spice_warning("pa_stream_connect_record() failed: %s",
+                      pa_strerror(pa_context_errno(p->context)));
     }
 }
 
@@ -598,8 +598,8 @@ static void record_start(SpiceRecordChannel *channel, gint format, gint channels
         break;
     default:
         if (p->state != state) {
-            g_warning("%s: pulse context not ready (%s)",
-                      __FUNCTION__, STATE_NAME(context_state_names, state));
+            spice_warning("%s: pulse context not ready (%s)",
+                          __FUNCTION__, STATE_NAME(context_state_names, state));
         }
         break;
     }
@@ -649,8 +649,8 @@ static void playback_volume_changed(GObject *object, GParamSpec *pspec, gpointer
         pa_stream_get_index(p->playback.stream),
         &v, NULL, NULL);
     if (!op)
-        g_warning("set_sink_input_volume() failed: %s",
-                  pa_strerror(pa_context_errno(p->context)));
+        spice_warning("set_sink_input_volume() failed: %s",
+                      pa_strerror(pa_context_errno(p->context)));
     else
         pa_operation_unref(op);
 }
@@ -673,8 +673,8 @@ static void playback_mute_changed(GObject *object, GParamSpec *pspec, gpointer d
         pa_stream_get_index(p->playback.stream),
         mute, NULL, NULL);
     if (!op)
-        g_warning("set_sink_input_mute() failed: %s",
-                  pa_strerror(pa_context_errno(p->context)));
+        spice_warning("set_sink_input_mute() failed: %s",
+                      pa_strerror(pa_context_errno(p->context)));
     else
         pa_operation_unref(op);
 }
@@ -721,8 +721,8 @@ static void record_mute_changed(GObject *object, GParamSpec *pspec, gpointer dat
 #endif
         mute, NULL, NULL);
     if (!op)
-        g_warning("set_source_output_mute() failed: %s",
-                  pa_strerror(pa_context_errno(p->context)));
+        spice_warning("set_source_output_mute() failed: %s",
+                      pa_strerror(pa_context_errno(p->context)));
     else
         pa_operation_unref(op);
 }
@@ -762,8 +762,8 @@ static void record_volume_changed(GObject *object, GParamSpec *pspec, gpointer d
 #endif
         &v, NULL, NULL);
     if (!op)
-        g_warning("set_source_output_volume() failed: %s",
-                  pa_strerror(pa_context_errno(p->context)));
+        spice_warning("set_source_output_volume() failed: %s",
+                      pa_strerror(pa_context_errno(p->context)));
     else
         pa_operation_unref(op);
 }
@@ -868,8 +868,8 @@ static void context_state_callback(pa_context *c, void *userdata)
     }
 
     case PA_CONTEXT_FAILED:
-        g_warning("PulseAudio context failed %s",
-                  pa_strerror(pa_context_errno(p->context)));
+        spice_warning("PulseAudio context failed %s",
+                      pa_strerror(pa_context_errno(p->context)));
         goto context_fail;
 
     case PA_CONTEXT_TERMINATED:
@@ -905,8 +905,8 @@ SpicePulse *spice_pulse_new(SpiceSession *session, GMainContext *context,
     p->context = pa_context_new(pa_glib_mainloop_get_api(p->mainloop), name);
     pa_context_set_state_callback(p->context, context_state_callback, pulse);
     if (pa_context_connect(p->context, NULL, 0, NULL) < 0) {
-        g_warning("pa_context_connect() failed: %s",
-            pa_strerror(pa_context_errno(p->context)));
+        spice_warning("pa_context_connect() failed: %s",
+                      pa_strerror(pa_context_errno(p->context)));
         goto error;
     }
 
diff --git a/src/spice-session.c b/src/spice-session.c
index cb11077..1c2c133 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -268,7 +268,7 @@ static void update_proxy(SpiceSession *self, const gchar *str)
     if (!spice_uri_parse(proxy, str, &error))
         g_clear_object(&proxy);
     if (error) {
-        g_warning("%s", error->message);
+        spice_warning("%s", error->message);
         g_clear_error(&error);
     }
 
@@ -436,8 +436,8 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
      * path (ignored) and query
      */
     if (!g_str_has_prefix(uri, URI_SCHEME_SPICE)) {
-        g_warning("Expected a URI scheme of '%s' in URI '%s'",
-                  URI_SCHEME_SPICE, uri);
+        spice_warning("Expected a URI scheme of '%s' in URI '%s'",
+                      URI_SCHEME_SPICE, uri);
         goto fail;
     }
     authority = uri + strlen(URI_SCHEME_SPICE);
@@ -474,7 +474,7 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
     if (authority[0] == '[') {
         tmp = strchr(authority, ']');
         if (!tmp) {
-            g_warning("Missing closing ']' in authority for URI '%s'", uri);
+            spice_warning("Missing closing ']' in authority for URI '%s'", uri);
             goto fail;
         }
         tmp[0] = '\0';
@@ -494,7 +494,7 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
 
     if (path && !(g_str_equal(path, "") ||
                   g_str_equal(path, "/"))) {
-        g_warning("Unexpected path data '%s' for URI '%s'", path, uri);
+        spice_warning("Unexpected path data '%s' for URI '%s'", path, uri);
         /* don't fail, just ignore */
     }
     unescaped_path = g_uri_unescape_string(path, NULL);
@@ -536,14 +536,14 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
             target_key = &tls_port;
         } else if (g_str_equal(key, "password")) {
             target_key = &password;
-            g_warning("password may be visible in process listings");
+            spice_warning("password may be visible in process listings");
         } else {
-            g_warning("unknown key in spice URI parsing: '%s'", key);
+            spice_warning("unknown key in spice URI parsing: '%s'", key);
             goto fail;
         }
         if (target_key) {
             if (*target_key) {
-                g_warning("Double set of '%s' in URI '%s'", key, uri);
+                spice_warning("Double set of '%s' in URI '%s'", key, uri);
                 goto fail;
             }
             *target_key = g_uri_unescape_string(value, NULL);
@@ -551,7 +551,7 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
     }
 
     if (port == NULL && tls_port == NULL) {
-        g_warning("Missing port or tls-port in spice URI '%s'", uri);
+        spice_warning("Missing port or tls-port in spice URI '%s'", uri);
         goto fail;
     }
 
@@ -1489,7 +1489,7 @@ SpiceSession *spice_session_new_from_session(SpiceSession *session)
     SpiceSessionPrivate *c;
 
     if (s->client_provided_sockets) {
-        g_warning("migration with client provided fd is not supported yet");
+        spice_warning("migration with client provided fd is not supported yet");
         return NULL;
     }
 
@@ -2186,7 +2186,7 @@ GSocketConnection* spice_session_channel_open_host(SpiceSession *session, SpiceC
         open_host.port = strtol(port, &endptr, 10);
         if (*port == '\0' || *endptr != '\0' ||
             open_host.port <= 0 || open_host.port > G_MAXUINT16) {
-            g_warning("Invalid port value %s", port);
+            spice_warning("Invalid port value %s", port);
             return NULL;
         }
     }
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 2d0b953..7a2844b 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -300,8 +300,8 @@ static void update_monitor_area(SpiceDisplay *display)
     }
 
     if (c->surface_id != 0) {
-        g_warning("FIXME: only support monitor config with primary surface 0, "
-                  "but given config surface %d", c->surface_id);
+        spice_warning("FIXME: only support monitor config with primary surface 0, "
+                      "but given config surface %d", c->surface_id);
         goto whole;
     }
 
@@ -767,7 +767,7 @@ static void try_keyboard_grab(SpiceDisplay *display)
     status = gdk_keyboard_grab(gtk_widget_get_window(widget), FALSE,
                                GDK_CURRENT_TIME);
     if (status != GDK_GRAB_SUCCESS) {
-        g_warning("keyboard grab failed %d", status);
+        spice_warning("keyboard grab failed %d", status);
         d->keyboard_grab_active = false;
     } else {
         d->keyboard_grab_active = true;
@@ -844,7 +844,7 @@ static void set_mouse_accel(SpiceDisplay *display, gboolean enabled)
         g_return_if_fail(SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)10, SPIF_SENDCHANGE)); // default
     }
 #else
-    g_warning("Mouse acceleration code missing for your platform");
+    spice_warning("Mouse acceleration code missing for your platform");
 #endif
 }
 
@@ -885,7 +885,7 @@ error:
     {
         DWORD errval  = GetLastError();
         gchar *errstr = g_win32_error_message(errval);
-        g_warning("failed to clip cursor (%ld) %s", errval, errstr);
+        spice_warning("failed to clip cursor (%ld) %s", errval, errstr);
     }
 
     return false;
@@ -928,7 +928,7 @@ static GdkGrabStatus do_pointer_grab(SpiceDisplay *display)
                      GDK_CURRENT_TIME);
     if (status != GDK_GRAB_SUCCESS) {
         d->mouse_grab_active = false;
-        g_warning("pointer grab failed %d", status);
+        spice_warning("pointer grab failed %d", status);
     } else {
         d->mouse_grab_active = true;
         g_signal_emit(display, signals[SPICE_DISPLAY_MOUSE_GRAB], 0, true);
@@ -1448,7 +1448,7 @@ static guint get_scancode_from_keyval(SpiceDisplay *display, guint keyval)
         keycode = keys[0].keycode;
         g_free(keys);
     } else {
-        g_warning("could not lookup keyval %u, please report a bug", keyval);
+        spice_warning("could not lookup keyval %u, please report a bug", keyval);
         return 0;
     }
 
diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index a323db5..d97b1e7 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -253,7 +253,7 @@ static gboolean spice_usb_device_manager_initable_init(GInitable  *initable,
     rc = libusb_init(&priv->context);
     if (rc < 0) {
         const char *desc = spice_usbutil_libusb_strerror(rc);
-        g_warning("Error initializing USB support: %s [%i]", desc, rc);
+        spice_warning("Error initializing USB support: %s [%i]", desc, rc);
         g_set_error(err, SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
                     "Error initializing USB support: %s [%i]", desc, rc);
         return FALSE;
@@ -282,7 +282,7 @@ static gboolean spice_usb_device_manager_initable_init(GInitable  *initable,
         spice_usb_device_manager_hotplug_cb, self, &priv->hp_handle);
     if (rc < 0) {
         const char *desc = spice_usbutil_libusb_strerror(rc);
-        g_warning("Error initializing USB hotplug support: %s [%i]", desc, rc);
+        spice_warning("Error initializing USB hotplug support: %s [%i]", desc, rc);
         g_set_error(err, SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
                   "Error initializing USB hotplug support: %s [%i]", desc, rc);
         return FALSE;
@@ -436,7 +436,7 @@ static void spice_usb_device_manager_set_property(GObject       *gobject,
         if (r) {
             if (r == -ENOMEM)
                 g_error("Failed to allocate memory for auto-connect-filter");
-            g_warning("Error parsing auto-connect-filter string, keeping old filter");
+            spice_warning("Error parsing auto-connect-filter string, keeping old filter");
             break;
         }
 
@@ -461,7 +461,7 @@ static void spice_usb_device_manager_set_property(GObject       *gobject,
         if (r) {
             if (r == -ENOMEM)
                 g_error("Failed to allocate memory for redirect-on-connect");
-            g_warning("Error parsing redirect-on-connect string, keeping old filter");
+            spice_warning("Error parsing redirect-on-connect string, keeping old filter");
             break;
         }
 
@@ -709,8 +709,8 @@ static gboolean spice_usb_device_manager_get_device_descriptor(
         bus = libusb_get_bus_number(libdev);
         addr = libusb_get_device_address(libdev);
         errstr = spice_usbutil_libusb_strerror(errcode);
-        g_warning("cannot get device descriptor for (%p) %d.%d -- %s(%d)",
-                  libdev, bus, addr, errstr, errcode);
+        spice_warning("cannot get device descriptor for (%p) %d.%d -- %s(%d)",
+                      libdev, bus, addr, errstr, errcode);
         return FALSE;
     }
     return TRUE;
@@ -933,8 +933,8 @@ static void spice_usb_device_manager_remove_dev(SpiceUsbDeviceManager *self,
 
     device = spice_usb_device_manager_find_device(self, bus, address);
     if (!device) {
-        g_warning("Could not find USB device to remove " DEV_ID_FMT,
-                  bus, address);
+        spice_warning("Could not find USB device to remove " DEV_ID_FMT,
+                      bus, address);
         return;
     }
 
@@ -976,7 +976,7 @@ static void spice_usb_device_manager_add_udev(SpiceUsbDeviceManager  *self,
         return;
 
     if (!spice_usb_device_manager_get_udev_bus_n_address(udev, &bus, &address)) {
-        g_warning("USB device without bus number or device address");
+        spice_warning("USB device without bus number or device address");
         return;
     }
 
@@ -1005,8 +1005,8 @@ static void spice_usb_device_manager_add_udev(SpiceUsbDeviceManager  *self,
     if (libdev)
         spice_usb_device_manager_add_dev(self, libdev);
     else
-        g_warning("Could not find USB device to add " DEV_ID_FMT,
-                  bus, address);
+        spice_warning("Could not find USB device to add " DEV_ID_FMT,
+                      bus, address);
 
     if (!priv->coldplug_list)
         libusb_free_device_list(dev_list, 1);
@@ -1151,7 +1151,7 @@ static void spice_usb_device_manager_drv_install_cb(GObject *gobject,
     spice_debug("Win USB driver install finished");
 
     if (!spice_win_usb_driver_install_finish(installer, res, &err)) {
-        g_warning("win usb driver install failed -- %s", err->message);
+        spice_warning("win usb driver install failed -- %s", err->message);
         g_error_free(err);
     }
 
@@ -1179,7 +1179,7 @@ static void spice_usb_device_manager_drv_uninstall_cb(GObject *gobject,
     g_return_if_fail(SPICE_IS_USB_DEVICE_MANAGER(self));
 
     if (!spice_win_usb_driver_uninstall_finish(cbinfo->installer, res, &err)) {
-        g_warning("win usb driver uninstall failed -- %s", err->message);
+        spice_warning("win usb driver uninstall failed -- %s", err->message);
         g_clear_error(&err);
     }
 
@@ -1204,7 +1204,7 @@ static gpointer spice_usb_device_manager_usb_ev_thread(gpointer user_data)
         rc = libusb_handle_events(priv->context);
         if (rc && rc != LIBUSB_ERROR_INTERRUPTED) {
             const char *desc = spice_usbutil_libusb_strerror(rc);
-            g_warning("Error handling USB events: %s [%i]", desc, rc);
+            spice_warning("Error handling USB events: %s [%i]", desc, rc);
             break;
         }
     }
@@ -1362,7 +1362,7 @@ GPtrArray* spice_usb_device_manager_get_devices_with_filter(
         if (r) {
             if (r == -ENOMEM)
                 g_error("Failed to allocate memory for filter");
-            g_warning("Error parsing filter, ignoring");
+            spice_warning("Error parsing filter, ignoring");
             rules = NULL;
             count = 0;
         }
diff --git a/src/vncdisplaykeymap.c b/src/vncdisplaykeymap.c
index 1651618..e113981 100644
--- a/src/vncdisplaykeymap.c
+++ b/src/vncdisplaykeymap.c
@@ -183,7 +183,7 @@ const guint16 *vnc_display_keymap_gdk2xtkbd_table(GdkWindow *window,
 			if (XkbGetNames(xdisplay, XkbKeycodesNameMask, desc) == Success) {
 				keycodes = gdk_x11_get_xatom_name(desc->names->keycodes);
 				if (!keycodes)
-					g_warning("could not lookup keycode name");
+					spice_warning("could not lookup keycode name");
 			}
 			XkbFreeKeyboard(desc, XkbGBN_AllComponentsMask, True);
 		}
@@ -205,16 +205,16 @@ const guint16 *vnc_display_keymap_gdk2xtkbd_table(GdkWindow *window,
 			*maplen = G_N_ELEMENTS(keymap_xorgkbd2xtkbd);
 			return keymap_xorgkbd2xtkbd;
 		} else {
-			g_warning("Unknown keycode mapping '%s'.\n"
-				  "Please report to gtk-vnc-list at gnome.org\n"
-				  "including the following information:\n"
-				  "\n"
-				  "  - Operating system\n"
-				  "  - GDK build\n"
-				  "  - X11 Server\n"
-				  "  - xprop -root\n"
-				  "  - xdpyinfo\n",
-				  keycodes);
+			spice_warning("Unknown keycode mapping '%s'.\n"
+				"Please report to gtk-vnc-list at gnome.org\n"
+				"including the following information:\n"
+				"\n"
+				"  - Operating system\n"
+				"  - GDK build\n"
+				"  - X11 Server\n"
+				"  - xprop -root\n"
+				"  - xdpyinfo\n",
+				keycodes);
 			return NULL;
 		}
 	}
@@ -246,14 +246,14 @@ const guint16 *vnc_display_keymap_gdk2xtkbd_table(GdkWindow *window,
 
 #ifdef GDK_WINDOWING_BROADWAY
 	if (GDK_IS_BROADWAY_WINDOW(window)) {
-                g_warning("experimental: using broadway, x11 virtual keysym mapping - with very limited support. See also https://bugzilla.gnome.org/show_bug.cgi?id=700105");
+		spice_warning("experimental: using broadway, x11 virtual keysym mapping - with very limited support. See also https://bugzilla.gnome.org/show_bug.cgi?id=700105");
 
 			*maplen = G_N_ELEMENTS(keymap_x112xtkbd);
 			return keymap_x112xtkbd;
         }
 #endif
 
-	g_warning("Unsupported GDK Windowing platform.\n"
+	spice_warning("Unsupported GDK Windowing platform.\n"
 		  "Disabling extended keycode tables.\n"
 		  "Please report to gtk-vnc-list at gnome.org\n"
 		  "including the following information:\n"
diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
index e02ad9c..3bdd697 100644
--- a/src/win-usb-dev.c
+++ b/src/win-usb-dev.c
@@ -137,7 +137,7 @@ g_udev_client_list_devices(GUdevClient *self, GList **devs,
     rc = libusb_get_device_list(priv->ctx, &lusb_list);
     if (rc < 0) {
         const char *errstr = spice_usbutil_libusb_strerror(rc);
-        g_warning("%s: libusb_get_device_list failed", name);
+        spice_warning("%s: libusb_get_device_list failed", name);
         g_set_error(err, G_UDEV_CLIENT_ERROR, G_UDEV_CLIENT_LIBUSB_FAILED,
                     "%s: Error getting device list from libusb: %s [%"G_GSSIZE_FORMAT"]",
                     name, errstr, rc);
@@ -189,7 +189,7 @@ g_udev_client_initable_init(GInitable *initable, GCancellable *cancellable,
     rc = libusb_init(&priv->ctx);
     if (rc < 0) {
         const char *errstr = spice_usbutil_libusb_strerror(rc);
-        g_warning("Error initializing USB support: %s [%i]", errstr, rc);
+        spice_warning("Error initializing USB support: %s [%i]", errstr, rc);
         g_set_error(err, G_UDEV_CLIENT_ERROR, G_UDEV_CLIENT_LIBUSB_FAILED,
                     "Error initializing USB support: %s [%i]", errstr, rc);
         return FALSE;
@@ -210,7 +210,7 @@ g_udev_client_initable_init(GInitable *initable, GCancellable *cancellable,
     wcls.lpszClassName = G_UDEV_CLIENT_WINCLASS_NAME;
     if (!RegisterClass(&wcls)) {
         DWORD e = GetLastError();
-        g_warning("RegisterClass failed , %ld", (long)e);
+        spice_warning("RegisterClass failed , %ld", (long)e);
         g_set_error(err, G_UDEV_CLIENT_ERROR, G_UDEV_CLIENT_WINAPI_FAILED,
                     "RegisterClass failed: %ld", (long)e);
         goto g_udev_client_init_failed;
@@ -219,7 +219,7 @@ g_udev_client_initable_init(GInitable *initable, GCancellable *cancellable,
                               NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
     if (!priv->hwnd) {
         DWORD e = GetLastError();
-        g_warning("CreateWindow failed: %ld", (long)e);
+        spice_warning("CreateWindow failed: %ld", (long)e);
         g_set_error(err, G_UDEV_CLIENT_ERROR, G_UDEV_CLIENT_LIBUSB_FAILED,
                     "CreateWindow failed: %ld", (long)e);
         goto g_udev_client_init_failed_unreg;
@@ -301,7 +301,7 @@ static gboolean get_usb_dev_info(libusb_device *dev, GUdevDeviceInfo *udevinfo)
     g_return_val_if_fail(udevinfo, FALSE);
 
     if (libusb_get_device_descriptor(dev, &desc) < 0) {
-        g_warning("cannot get device descriptor %p", dev);
+        spice_warning("cannot get device descriptor %p", dev);
         return FALSE;
     }
 
@@ -390,7 +390,7 @@ static void handle_dev_change(GUdevClient *self)
     }
 
     if (!changed_dev) {
-        g_warning("couldn't find any device change");
+        spice_warning("couldn't find any device change");
         goto leave;
     }
 
diff --git a/src/win-usb-driver-install.c b/src/win-usb-driver-install.c
index 69d4e0f..7bfb6d6 100644
--- a/src/win-usb-driver-install.c
+++ b/src/win-usb-driver-install.c
@@ -143,13 +143,13 @@ void win_usb_driver_handle_reply_cb(GObject *gobject,
     g_clear_object(&istream);
 
     if (err) {
-        g_warning("failed to read reply from usbclerk (%s)", err->message);
+        spice_warning("failed to read reply from usbclerk (%s)", err->message);
         g_simple_async_result_take_error(priv->result, err);
         goto failed_reply;
     }
 
     if (bytes == 0) {
-        g_warning("unexpected EOF from usbclerk");
+        spice_warning("unexpected EOF from usbclerk");
         g_simple_async_result_set_error(priv->result,
                                         SPICE_WIN_USB_DRIVER_ERROR,
                                         SPICE_WIN_USB_DRIVER_ERROR_FAILED,
@@ -158,15 +158,15 @@ void win_usb_driver_handle_reply_cb(GObject *gobject,
     }
 
     if (bytes != sizeof(priv->reply)) {
-        g_warning("usbclerk size mismatch: read %"G_GSSIZE_FORMAT" bytes,expected "
-                  "%"G_GSSIZE_FORMAT" (header %"G_GSSIZE_FORMAT", size in header %d)",
-                  bytes, sizeof(priv->reply), sizeof(priv->reply.hdr), priv->reply.hdr.size);
+        spice_warning("usbclerk size mismatch: read %"G_GSSIZE_FORMAT" bytes,expected "
+                      "%"G_GSSIZE_FORMAT" (header %"G_GSSIZE_FORMAT", size in header %d)",
+                      bytes, sizeof(priv->reply), sizeof(priv->reply.hdr), priv->reply.hdr.size);
         /* For now just warn, do not fail */
     }
 
     if (priv->reply.hdr.magic != USB_CLERK_MAGIC) {
-        g_warning("usbclerk magic mismatch: mine=0x%04x  server=0x%04x",
-                  USB_CLERK_MAGIC, priv->reply.hdr.magic);
+        spice_warning("usbclerk magic mismatch: mine=0x%04x  server=0x%04x",
+                      USB_CLERK_MAGIC, priv->reply.hdr.magic);
         g_simple_async_result_set_error(priv->result,
                                         SPICE_WIN_USB_DRIVER_ERROR,
                                         SPICE_WIN_USB_DRIVER_ERROR_MESSAGE,
@@ -175,8 +175,8 @@ void win_usb_driver_handle_reply_cb(GObject *gobject,
     }
 
     if (priv->reply.hdr.version != USB_CLERK_VERSION) {
-        g_warning("usbclerk version mismatch: mine=0x%04x  server=0x%04x",
-                  USB_CLERK_VERSION, priv->reply.hdr.version);
+        spice_warning("usbclerk version mismatch: mine=0x%04x  server=0x%04x",
+                      USB_CLERK_VERSION, priv->reply.hdr.version);
         g_simple_async_result_set_error(priv->result,
                                         SPICE_WIN_USB_DRIVER_ERROR,
                                         SPICE_WIN_USB_DRIVER_ERROR_MESSAGE,
@@ -184,8 +184,8 @@ void win_usb_driver_handle_reply_cb(GObject *gobject,
     }
 
     if (priv->reply.hdr.type != USB_CLERK_REPLY) {
-        g_warning("usbclerk message with unexpected type %d",
-                  priv->reply.hdr.type);
+        spice_warning("usbclerk message with unexpected type %d",
+                      priv->reply.hdr.type);
         g_simple_async_result_set_error(priv->result,
                                         SPICE_WIN_USB_DRIVER_ERROR,
                                         SPICE_WIN_USB_DRIVER_ERROR_MESSAGE,
@@ -194,8 +194,8 @@ void win_usb_driver_handle_reply_cb(GObject *gobject,
     }
 
     if (priv->reply.hdr.size != bytes) {
-        g_warning("usbclerk message size mismatch: read %"G_GSSIZE_FORMAT" bytes  hdr.size=%d",
-                  bytes, priv->reply.hdr.size);
+        spice_warning("usbclerk message size mismatch: read %"G_GSSIZE_FORMAT" bytes  hdr.size=%d",
+                      bytes, priv->reply.hdr.size);
         g_simple_async_result_set_error(priv->result,
                                         SPICE_WIN_USB_DRIVER_ERROR,
                                         SPICE_WIN_USB_DRIVER_ERROR_MESSAGE,
@@ -311,7 +311,7 @@ void spice_win_usb_driver_op(SpiceWinUsbDriver *self,
                                        spice_win_usb_driver_op);
 
     if (priv->result) { /* allow one install/uninstall request at a time */
-        g_warning("Another request exists -- try later");
+        spice_warning("Another request exists -- try later");
         g_simple_async_result_set_error(result,
                   SPICE_WIN_USB_DRIVER_ERROR, SPICE_WIN_USB_DRIVER_ERROR_FAILED,
                   "Another request exists -- try later");
@@ -324,7 +324,7 @@ void spice_win_usb_driver_op(SpiceWinUsbDriver *self,
 
     if (!spice_win_usb_driver_send_request(self, op_type,
                                            vid, pid, &err)) {
-        g_warning("failed to send a request to usbclerk %s", err->message);
+        spice_warning("failed to send a request to usbclerk %s", err->message);
         g_simple_async_result_take_error(result, err);
         goto failed_request;
     }
-- 
2.5.0



More information about the Spice-devel mailing list