iPXE
Functions | Variables
xenstore.h File Reference

XenStore interface. More...

#include <ipxe/xen.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 __attribute__ ((sentinel)) int xenstore_read(struct xen_hypervisor *xen
char unsigned long const char
unsigned long char size_t void 
xenstore_dump (struct xen_hypervisor *xen, const char *key)
 Dump XenStore directory contents (for debugging)

Variables

char ** value
char unsigned long * num
char unsigned long const char
unsigned long char ** 
children
char unsigned long const char
unsigned long char size_t
len

Detailed Description

XenStore interface.

Definition in file xenstore.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
__attribute__ ( (sentinel)  )
char unsigned long const char unsigned long char size_t void xenstore_dump ( struct xen_hypervisor xen,
const char *  key 
)

Dump XenStore directory contents (for debugging)

Parameters:
xenXen hypervisor
keyKey

Definition at line 520 of file xenstore.c.

References asprintf(), children, DBGC, ENOMEM, free, len, NULL, rc, strlen(), value, xenstore_directory(), xenstore_dump(), and xenstore_read().

Referenced by xenstore_dump().

                                                                   {
        char *value;
        char *children;
        char *child;
        char *child_key;
        size_t len;
        int rc;

        /* Try to dump current key as a value */
        if ( ( rc = xenstore_read ( xen, &value, key, NULL ) ) == 0 ) {
                DBGC ( xen, "%s = \"%s\"\n", key, value );
                free ( value );
        }

        /* Try to recurse into each child in turn */
        if ( ( rc = xenstore_directory ( xen, &children, &len, key,
                                         NULL ) ) == 0 ) {
                for ( child = children ; child < ( children + len ) ;
                      child += ( strlen ( child ) + 1 /* NUL */ ) ) {

                        /* Construct child key */
                        if ( asprintf ( &child_key, "%s/%s", key, child ) < 0 ){
                                DBGC ( xen, "XENSTORE could not allocate child "
                                       "key \"%s/%s\"\n", key, child );
                                rc = -ENOMEM;
                                break;
                        }

                        /* Recurse into child key, continuing on error */
                        xenstore_dump ( xen, child_key );
                        free ( child_key );
                }
                free ( children );
        }
}

Variable Documentation

char unsigned long const char* value

Definition at line 15 of file xenstore.h.

char unsigned long const char unsigned long num
char unsigned long const char unsigned long char** children

Definition at line 25 of file xenstore.h.

Referenced by xenbus_probe_type(), and xenstore_dump().

char unsigned long const char unsigned long char size_t* len

Definition at line 25 of file xenstore.h.