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)
 
 FILE_SECBOOT (PERMITTED)
 
 __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) More...
 

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_tlen
 

Detailed Description

XenStore interface.

Definition in file xenstore.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED  )

◆ __attribute__()

__attribute__ ( (sentinel)  )

◆ xenstore_dump()

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 521 of file xenstore.c.

521  {
522  char *value;
523  char *children;
524  char *child;
525  char *child_key;
526  size_t len;
527  int rc;
528 
529  /* Try to dump current key as a value */
530  if ( ( rc = xenstore_read ( xen, &value, key, NULL ) ) == 0 ) {
531  DBGC ( xen, "%s = \"%s\"\n", key, value );
532  free ( value );
533  }
534 
535  /* Try to recurse into each child in turn */
536  if ( ( rc = xenstore_directory ( xen, &children, &len, key,
537  NULL ) ) == 0 ) {
538  for ( child = children ; child < ( children + len ) ;
539  child += ( strlen ( child ) + 1 /* NUL */ ) ) {
540 
541  /* Construct child key */
542  if ( asprintf ( &child_key, "%s/%s", key, child ) < 0 ){
543  DBGC ( xen, "XENSTORE could not allocate child "
544  "key \"%s/%s\"\n", key, child );
545  rc = -ENOMEM;
546  break;
547  }
548 
549  /* Recurse into child key, continuing on error */
550  xenstore_dump ( xen, child_key );
551  free ( child_key );
552  }
553  free ( children );
554  }
555 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define DBGC(...)
Definition: compiler.h:505
int xenstore_read(struct xen_hypervisor *xen, char **value,...)
Read XenStore value.
Definition: xenstore.c:372
#define ENOMEM
Not enough space.
Definition: errno.h:535
char unsigned long const char unsigned long char ** children
Definition: xenstore.h:26
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
ring len
Length.
Definition: dwmac.h:231
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:55
int xenstore_directory(struct xen_hypervisor *xen, char **children, size_t *len,...)
Read XenStore directory.
Definition: xenstore.c:504
int asprintf(char **strp, const char *fmt,...)
Write a formatted string to newly allocated memory.
Definition: asprintf.c:42
size_t strlen(const char *src)
Get length of string.
Definition: string.c:244
void xenstore_dump(struct xen_hypervisor *xen, const char *key)
Dump XenStore directory contents (for debugging)
Definition: xenstore.c:521
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322
union @391 key
Sense key.
Definition: scsi.h:18

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

Referenced by xenstore_dump().

Variable Documentation

◆ value

char unsigned long const char* value

Definition at line 16 of file xenstore.h.

◆ num

char unsigned long const char unsigned long num

Definition at line 18 of file xenstore.h.

◆ children

char unsigned long const char unsigned long char** children

Definition at line 26 of file xenstore.h.

Referenced by efi_driver_stop(), xenbus_probe_type(), xenstore_directory(), and xenstore_dump().

◆ len

char unsigned long const char unsigned long char size_t* len

Definition at line 26 of file xenstore.h.