[libvirt-glib 3/3] Only call gvir_error_new after failed libvirt calls

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

 



gvir_error_new is only meant to be used right after a failed
libvirt function call, in other cases we should be calling
g_error_new directly.
---
 libvirt-gobject/libvirt-gobject-connection.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c
index 95cd878..70b7411 100644
--- a/libvirt-gobject/libvirt-gobject-connection.c
+++ b/libvirt-gobject/libvirt-gobject-connection.c
@@ -583,9 +583,9 @@ gboolean gvir_connection_fetch_domains(GVirConnection *conn,
 
     g_mutex_lock(priv->lock);
     if (!priv->conn) {
-        *err = gvir_error_new(GVIR_CONNECTION_ERROR,
-                              0,
-                              "Connection is not open");
+        *err = g_error_new(GVIR_CONNECTION_ERROR,
+                           0,
+                           "Connection is not open");
         g_mutex_unlock(priv->lock);
         goto cleanup;
     }
@@ -708,9 +708,9 @@ gboolean gvir_connection_fetch_storage_pools(GVirConnection *conn,
 
     g_mutex_lock(priv->lock);
     if (!priv->conn) {
-        *err = gvir_error_new(GVIR_CONNECTION_ERROR,
-                              0,
-                              "Connection is not open");
+        *err = g_error_new(GVIR_CONNECTION_ERROR,
+                           0,
+                           "Connection is not open");
         g_mutex_unlock(priv->lock);
         goto cleanup;
     }
-- 
1.7.6.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]