[Spice-devel] [spice-gtk v3 16/19] log: use spice_error instead of g_error
Victor Toso
victortoso at redhat.com
Sat Mar 12 14:32:17 UTC 2016
---
src/channel-usbredir.c | 2 +-
src/coroutine_gthread.c | 2 +-
src/coroutine_ucontext.c | 2 +-
src/coroutine_winfibers.c | 4 ++--
src/usb-device-manager.c | 6 +++---
src/usb-device-widget.c | 2 +-
6 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
index efdc447..fd3a8b8 100644
--- a/src/channel-usbredir.c
+++ b/src/channel-usbredir.c
@@ -226,7 +226,7 @@ void spice_usbredir_channel_set_context(SpiceUsbredirChannel *channel,
spice_util_get_debug() ? usbredirparser_debug : usbredirparser_warning,
usbredirhost_fl_write_cb_owns_buffer);
if (!priv->host)
- g_error("Out of memory allocating usbredirhost");
+ spice_error("Out of memory allocating usbredirhost");
#if USBREDIR_VERSION >= 0x000701
usbredirhost_set_buffered_output_size_cb(priv->host, usbredir_buffered_output_size_callback);
diff --git a/src/coroutine_gthread.c b/src/coroutine_gthread.c
index 080a3f2..5c61423 100644
--- a/src/coroutine_gthread.c
+++ b/src/coroutine_gthread.c
@@ -99,7 +99,7 @@ void coroutine_init(struct coroutine *co)
G_THREAD_PRIORITY_NORMAL,
&err);
if (err != NULL)
- g_error("g_thread_create_full() failed: %s", err->message);
+ spice_error("g_thread_create_full() failed: %s", err->message);
co->exited = 0;
co->runnable = FALSE;
diff --git a/src/coroutine_ucontext.c b/src/coroutine_ucontext.c
index 04d35f2..730f7c4 100644
--- a/src/coroutine_ucontext.c
+++ b/src/coroutine_ucontext.c
@@ -74,7 +74,7 @@ void coroutine_init(struct coroutine *co)
MAP_PRIVATE | MAP_ANONYMOUS,
-1, 0);
if (co->cc.stack == MAP_FAILED)
- g_error("mmap(%" G_GSIZE_FORMAT ") failed: %s",
+ spice_error("mmap(%" G_GSIZE_FORMAT ") failed: %s",
co->stack_size, g_strerror(errno));
co->cc.entry = coroutine_trampoline;
diff --git a/src/coroutine_winfibers.c b/src/coroutine_winfibers.c
index 6ef2a08..ef07c1c 100644
--- a/src/coroutine_winfibers.c
+++ b/src/coroutine_winfibers.c
@@ -57,13 +57,13 @@ void coroutine_init(struct coroutine *co)
if (leader.fiber == NULL) {
leader.fiber = ConvertThreadToFiber(&leader);
if (leader.fiber == NULL)
- g_error("ConvertThreadToFiber() failed");
+ spice_error("ConvertThreadToFiber() failed");
}
co->exited = 0;
co->fiber = CreateFiber(0, &coroutine_trampoline, co);
if (co->fiber == NULL)
- g_error("CreateFiber() failed");
+ spice_error("CreateFiber() failed");
co->ret = 0;
}
diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index d97b1e7..2642e26 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -435,7 +435,7 @@ static void spice_usb_device_manager_set_property(GObject *gobject,
r = usbredirfilter_string_to_rules(filter, ",", "|", &rules, &count);
if (r) {
if (r == -ENOMEM)
- g_error("Failed to allocate memory for auto-connect-filter");
+ spice_error("Failed to allocate memory for auto-connect-filter");
spice_warning("Error parsing auto-connect-filter string, keeping old filter");
break;
}
@@ -460,7 +460,7 @@ static void spice_usb_device_manager_set_property(GObject *gobject,
&rules, &count);
if (r) {
if (r == -ENOMEM)
- g_error("Failed to allocate memory for redirect-on-connect");
+ spice_error("Failed to allocate memory for redirect-on-connect");
spice_warning("Error parsing redirect-on-connect string, keeping old filter");
break;
}
@@ -1361,7 +1361,7 @@ GPtrArray* spice_usb_device_manager_get_devices_with_filter(
r = usbredirfilter_string_to_rules(filter, ",", "|", &rules, &count);
if (r) {
if (r == -ENOMEM)
- g_error("Failed to allocate memory for filter");
+ spice_error("Failed to allocate memory for filter");
spice_warning("Error parsing filter, ignoring");
rules = NULL;
count = 0;
diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
index 8c7e9ea..c0c04c5 100644
--- a/src/usb-device-widget.c
+++ b/src/usb-device-widget.c
@@ -195,7 +195,7 @@ static GObject *spice_usb_device_widget_constructor(
self = SPICE_USB_DEVICE_WIDGET(obj);
priv = self->priv;
if (!priv->session)
- g_error("SpiceUsbDeviceWidget constructed without a session");
+ spice_error("SpiceUsbDeviceWidget constructed without a session");
priv->label = gtk_label_new(NULL);
str = g_strdup_printf("<b>%s</b>", _("Select USB devices to redirect"));
--
2.5.0
More information about the Spice-devel
mailing list