ia64/xen-unstable

changeset 14890:80304d79a78c

Added xen_session_clear_error.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author ewan@localhost.localdomain
date Mon Apr 16 19:19:07 2007 -0400 (2007-04-16)
parents 9e44519ee9a2
children 295858ddac87
files tools/libxen/include/xen_common.h tools/libxen/src/xen_common.c
line diff
     1.1 --- a/tools/libxen/include/xen_common.h	Sat Apr 21 11:37:34 2007 +0100
     1.2 +++ b/tools/libxen/include/xen_common.h	Mon Apr 16 19:19:07 2007 -0400
     1.3 @@ -160,6 +160,13 @@ xen_session_logout(xen_session *session)
     1.4  
     1.5  
     1.6  /**
     1.7 + * Clear any error condition recorded on this session.
     1.8 + */
     1.9 +void
    1.10 +xen_session_clear_error(xen_session *session);
    1.11 +
    1.12 +
    1.13 +/**
    1.14   * Get the UUID of the second given session.  Set *result to point at a
    1.15   * string, yours to free.
    1.16   */
     2.1 --- a/tools/libxen/src/xen_common.c	Sat Apr 21 11:37:34 2007 +0100
     2.2 +++ b/tools/libxen/src/xen_common.c	Mon Apr 16 19:19:07 2007 -0400
     2.3 @@ -207,6 +207,23 @@ xen_session_logout(xen_session *session)
     2.4  }
     2.5  
     2.6  
     2.7 +void
     2.8 +xen_session_clear_error(xen_session *session)
     2.9 +{
    2.10 +    if (session->error_description != NULL)
    2.11 +    {
    2.12 +        for (int i = 0; i < session->error_description_count; i++)
    2.13 +        {
    2.14 +            free(session->error_description[i]);
    2.15 +        }
    2.16 +        free(session->error_description);
    2.17 +    }
    2.18 +    session->error_description = NULL;
    2.19 +    session->error_description_count = 0;
    2.20 +    session->ok = true;
    2.21 +}
    2.22 +
    2.23 +
    2.24  bool
    2.25  xen_session_get_uuid(xen_session *session, char **result,
    2.26                       xen_session *self_session)