Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 1d34bd5ae937157c68c1d2a605bb0b67 > files > 26

libvirt-0.6.3-20.1.el5_4.src.rpm

diff -rup libvirt-0.6.3/qemud/remote.c libvirt-0.6.3.new/qemud/remote.c
--- libvirt-0.6.3/qemud/remote.c	2009-04-24 09:12:05.000000000 -0400
+++ libvirt-0.6.3.new/qemud/remote.c	2009-07-13 06:30:02.000000000 -0400
@@ -1366,7 +1366,7 @@ remoteDispatchDomainGetSecurityLabel(str
     memset(&seclabel, 0, sizeof seclabel);
     if (virDomainGetSecurityLabel(dom, &seclabel) == -1) {
         virDomainFree(dom);
-        remoteDispatchFormatError(rerr, "%s", _("unable to get security label"));
+        remoteDispatchConnError(rerr, conn);
         return -1;
     }
 
@@ -1395,7 +1395,7 @@ remoteDispatchNodeGetSecurityModel(struc
 
     memset(&secmodel, 0, sizeof secmodel);
     if (virNodeGetSecurityModel(conn, &secmodel) == -1) {
-        remoteDispatchFormatError(rerr, "%s", _("unable to get security model"));
+        remoteDispatchConnError(rerr, conn);
         return -1;
     }
 
diff -rup libvirt-0.6.3/src/libvirt.c libvirt-0.6.3.new/src/libvirt.c
--- libvirt-0.6.3/src/libvirt.c	2009-07-13 06:31:29.000000000 -0400
+++ libvirt-0.6.3.new/src/libvirt.c	2009-07-13 06:27:42.000000000 -0400
@@ -4212,15 +4212,24 @@ virDomainGetSecurityLabel(virDomainPtr d
 
     if (seclabel == NULL) {
         virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
-        return -1;
+        goto error;
     }
 
     conn = domain->conn;
 
-    if (conn->driver->domainGetSecurityLabel)
-        return conn->driver->domainGetSecurityLabel(domain, seclabel);
+    if (conn->driver->domainGetSecurityLabel) {
+        int ret;
+        ret = conn->driver->domainGetSecurityLabel(domain, seclabel);
+        if (ret < 0)
+            goto error;
+        return ret;
+    }
+
+    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
-    virLibConnWarning(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+    /* Copy to connection error object for back compatability */
+    virSetConnError(domain->conn);
     return -1;
 }
 
@@ -4245,13 +4254,22 @@ virNodeGetSecurityModel(virConnectPtr co
 
     if (secmodel == NULL) {
         virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
-        return -1;
+        goto error;
+    }
+
+    if (conn->driver->nodeGetSecurityModel) {
+        int ret;
+        ret = conn->driver->nodeGetSecurityModel(conn, secmodel);
+        if (ret < 0)
+            goto error;
+        return ret;
     }
 
-    if (conn->driver->nodeGetSecurityModel)
-        return conn->driver->nodeGetSecurityModel(conn, secmodel);
+    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
-    virLibConnWarning(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+    /* Copy to connection error object for back compatability */
+    virSetConnError(conn);
     return -1;
 }