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

[Xen-changelog] [xen-unstable] Added xen_session_clear_error.



# HG changeset patch
# User ewan@xxxxxxxxxxxxxxxxxxxxx
# Date 1176765547 14400
# Node ID 80304d79a78c0441411012dde6c188e854812a56
# Parent  9e44519ee9a25121003357c4e3e825d64c3b13a4
Added xen_session_clear_error.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/libxen/include/xen_common.h |    7 +++++++
 tools/libxen/src/xen_common.c     |   17 +++++++++++++++++
 2 files changed, 24 insertions(+)

diff -r 9e44519ee9a2 -r 80304d79a78c tools/libxen/include/xen_common.h
--- a/tools/libxen/include/xen_common.h Sat Apr 21 11:37:34 2007 +0100
+++ b/tools/libxen/include/xen_common.h Mon Apr 16 19:19:07 2007 -0400
@@ -160,6 +160,13 @@ xen_session_logout(xen_session *session)
 
 
 /**
+ * Clear any error condition recorded on this session.
+ */
+void
+xen_session_clear_error(xen_session *session);
+
+
+/**
  * Get the UUID of the second given session.  Set *result to point at a
  * string, yours to free.
  */
diff -r 9e44519ee9a2 -r 80304d79a78c tools/libxen/src/xen_common.c
--- a/tools/libxen/src/xen_common.c     Sat Apr 21 11:37:34 2007 +0100
+++ b/tools/libxen/src/xen_common.c     Mon Apr 16 19:19:07 2007 -0400
@@ -204,6 +204,23 @@ xen_session_logout(xen_session *session)
 
     free((char *)session->session_id);
     free(session);
+}
+
+
+void
+xen_session_clear_error(xen_session *session)
+{
+    if (session->error_description != NULL)
+    {
+        for (int i = 0; i < session->error_description_count; i++)
+        {
+            free(session->error_description[i]);
+        }
+        free(session->error_description);
+    }
+    session->error_description = NULL;
+    session->error_description_count = 0;
+    session->ok = true;
 }
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.