TianoCore EDK2 master
Loading...
Searching...
No Matches
XenStore.h File Reference
#include "XenBusDxe.h"
#include <IndustryStandard/Xen/io/xs_wire.h>

Go to the source code of this file.

Typedefs

typedef struct _XENSTORE_WATCH XENSTORE_WATCH
 

Functions

XENSTORE_STATUS XenStoreListDirectory (IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node, OUT UINT32 *DirectoryCountPtr, OUT CONST CHAR8 ***DirectoryListPtr)
 
BOOLEAN XenStorePathExists (IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Directory, IN CONST CHAR8 *Node)
 
XENSTORE_STATUS XenStoreRead (IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node, OUT UINT32 *LenPtr OPTIONAL, OUT VOID **Result)
 
XENSTORE_STATUS XenStoreWrite (IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node, IN CONST CHAR8 *Str)
 
XENSTORE_STATUS XenStoreRemove (IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node)
 
XENSTORE_STATUS XenStoreTransactionStart (OUT XENSTORE_TRANSACTION *Transaction)
 
XENSTORE_STATUS XenStoreTransactionEnd (IN CONST XENSTORE_TRANSACTION *Transaction, IN BOOLEAN Abort)
 
XENSTORE_STATUS EFIAPI XenStoreSPrint (IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node, IN CONST CHAR8 *FormatString,...)
 
XENSTORE_STATUS EFIAPI XenStoreVSPrint (IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
 
XENSTORE_STATUS XenStoreRegisterWatch (IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node, OUT XENSTORE_WATCH **WatchPtr)
 
VOID XenStoreUnregisterWatch (IN XENSTORE_WATCH *Watch)
 
CHAR8 * XenStoreJoin (IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node)
 
EFI_STATUS XenStoreInit (XENBUS_DEVICE *Dev)
 
VOID XenStoreDeinit (IN XENBUS_DEVICE *Dev)
 
XENSTORE_STATUS EFIAPI XenBusWaitForWatch (IN XENBUS_PROTOCOL *This, IN VOID *Token)
 
XENSTORE_STATUS EFIAPI XenBusXenStoreRead (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node, OUT VOID **Value)
 
XENSTORE_STATUS EFIAPI XenBusXenStoreBackendRead (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node, OUT VOID **Value)
 
XENSTORE_STATUS EFIAPI XenBusXenStoreRemove (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node)
 
XENSTORE_STATUS EFIAPI XenBusXenStoreTransactionStart (IN XENBUS_PROTOCOL *This, OUT XENSTORE_TRANSACTION *Transaction)
 
XENSTORE_STATUS EFIAPI XenBusXenStoreTransactionEnd (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN BOOLEAN Abort)
 
XENSTORE_STATUS EFIAPI XenBusXenStoreSPrint (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *DirectoryPath, IN CONST CHAR8 *Node, IN CONST CHAR8 *FormatString,...)
 
XENSTORE_STATUS EFIAPI XenBusRegisterWatch (IN XENBUS_PROTOCOL *This, IN CONST CHAR8 *Node, OUT VOID **Token)
 
XENSTORE_STATUS EFIAPI XenBusRegisterWatchBackend (IN XENBUS_PROTOCOL *This, IN CONST CHAR8 *Node, OUT VOID **Token)
 
VOID EFIAPI XenBusUnregisterWatch (IN XENBUS_PROTOCOL *This, IN VOID *Token)
 

Detailed Description

Method declarations and structures for accessing the XenStore

Copyright (C) 2005 Rusty Russell, IBM Corporation Copyright (C) 2005 XenSource Ltd. Copyright (C) 2009,2010 Spectra Logic Corporation Copyright (C) 2014, Citrix Ltd.

This file may be distributed separately from the Linux kernel, or incorporated into other software packages, subject to the following license:

SPDX-License-Identifier: MIT

Definition in file XenStore.h.

Typedef Documentation

◆ XENSTORE_WATCH

Definition at line 22 of file XenStore.h.

Function Documentation

◆ XenBusRegisterWatch()

XENSTORE_STATUS EFIAPI XenBusRegisterWatch ( IN XENBUS_PROTOCOL This,
IN CONST CHAR8 *  Node,
OUT VOID **  Token 
)

Definition at line 1584 of file XenStore.c.

◆ XenBusRegisterWatchBackend()

XENSTORE_STATUS EFIAPI XenBusRegisterWatchBackend ( IN XENBUS_PROTOCOL This,
IN CONST CHAR8 *  Node,
OUT VOID **  Token 
)

Definition at line 1595 of file XenStore.c.

◆ XenBusUnregisterWatch()

VOID EFIAPI XenBusUnregisterWatch ( IN XENBUS_PROTOCOL This,
IN VOID *  Token 
)

Definition at line 1606 of file XenStore.c.

◆ XenBusWaitForWatch()

XENSTORE_STATUS EFIAPI XenBusWaitForWatch ( IN XENBUS_PROTOCOL This,
IN VOID *  Token 
)

Definition at line 1497 of file XenStore.c.

◆ XenBusXenStoreBackendRead()

XENSTORE_STATUS EFIAPI XenBusXenStoreBackendRead ( IN XENBUS_PROTOCOL This,
IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  Node,
OUT VOID **  Value 
)

Definition at line 1519 of file XenStore.c.

◆ XenBusXenStoreRead()

XENSTORE_STATUS EFIAPI XenBusXenStoreRead ( IN XENBUS_PROTOCOL This,
IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  Node,
OUT VOID **  Value 
)

Definition at line 1507 of file XenStore.c.

◆ XenBusXenStoreSPrint()

XENSTORE_STATUS EFIAPI XenBusXenStoreSPrint ( IN XENBUS_PROTOCOL This,
IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node,
IN CONST CHAR8 *  FormatString,
  ... 
)

Definition at line 1563 of file XenStore.c.

◆ XenBusXenStoreTransactionEnd()

XENSTORE_STATUS EFIAPI XenBusXenStoreTransactionEnd ( IN XENBUS_PROTOCOL This,
IN CONST XENSTORE_TRANSACTION Transaction,
IN BOOLEAN  Abort 
)

Definition at line 1552 of file XenStore.c.

◆ XenBusXenStoreTransactionStart()

XENSTORE_STATUS EFIAPI XenBusXenStoreTransactionStart ( IN XENBUS_PROTOCOL This,
OUT XENSTORE_TRANSACTION Transaction 
)

Definition at line 1542 of file XenStore.c.

◆ XenStoreDeinit()

VOID XenStoreDeinit ( IN XENBUS_DEVICE Dev)

Deinitialize the XenStore states and rings.

Parameters
DevA pointer to a XENBUS_DEVICE instance.

Definition at line 1124 of file XenStore.c.

◆ XenStoreInit()

EFI_STATUS XenStoreInit ( XENBUS_DEVICE Dev)

Initialize the XenStore states and rings.

Parameters
DevA pointer to a XENBUS_DEVICE instance.
Returns
EFI_SUCCESS if everything went smoothly.

Initialize XenStore.

Parameters
DevA XENBUS_DEVICE instance.
Return values
EFI_SUCCESSif everything went well.

The HVM guest pseudo-physical frame number. This is Xen's mapping of the true machine frame number into our "physical address space".

Definition at line 1085 of file XenStore.c.

◆ XenStoreJoin()

CHAR8 * XenStoreJoin ( IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node 
)

Allocate and return the XenStore path string <DirectoryPath>/<Node>. If name is the NUL string, the returned value contains the path string <DirectoryPath>.

Parameters
DirectoryPathThe NUL terminated directory prefix for new path.
NodeThe NUL terminated basename for the new path.
Returns
A buffer containing the joined path.

Definition at line 285 of file XenStore.c.

◆ XenStoreListDirectory()

XENSTORE_STATUS XenStoreListDirectory ( IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node,
OUT UINT32 *  DirectoryCountPtr,
OUT CONST CHAR8 ***  DirectoryListPtr 
)

Fetch the contents of a directory in the XenStore.

Parameters
TransactionThe XenStore transaction covering this request.
DirectoryPathThe dirname of the path to read.
NodeThe basename of the path to read.
DirectoryCountPtrThe returned number of directory entries.
DirectoryListPtrAn array of directory entry strings.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.
Note
The results buffer is alloced and should be free'd by the caller.

Definition at line 1204 of file XenStore.c.

◆ XenStorePathExists()

BOOLEAN XenStorePathExists ( IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  Directory,
IN CONST CHAR8 *  Node 
)

Determine if a path exists in the XenStore.

Parameters
TransactionThe XenStore transaction covering this request.
DirectoryThe dirname of the path to read.
NodeThe basename of the path to read.
Return values
TRUEThe path exists.
FALSEThe path does not exist or an error occurred attempting to make that determination.

Definition at line 1236 of file XenStore.c.

◆ XenStoreRead()

XENSTORE_STATUS XenStoreRead ( IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node,
OUT UINT32 *LenPtr  OPTIONAL,
OUT VOID **  Result 
)

Get the contents of a single "file". Returns the contents in *Result which should be freed after use. The length of the value in bytes is returned in LenPtr.

Parameters
TransactionThe XenStore transaction covering this request.
DirectoryPathThe dirname of the file to read.
NodeThe basename of the file to read.
LenPtrThe amount of data read.
ResultThe returned contents from this file.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.
Note
The results buffer is malloced and should be free'd by the caller.

Definition at line 1262 of file XenStore.c.

◆ XenStoreRegisterWatch()

XENSTORE_STATUS XenStoreRegisterWatch ( IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node,
OUT XENSTORE_WATCH **  WatchPtr 
)

Register a XenStore watch.

XenStore watches allow a client to be notified via a callback (embedded within the watch object) of changes to an object in the XenStore.

Parameters
DirectoryPathThe dirname of the path to watch.
NodeThe basename of the path to watch.
WatchPtrA returned XENSTORE_WATCH pointer.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of write failure. EEXIST errors from the XenStore are suppressed, allowing multiple, physically different, xenbus_watch objects, to watch the same path in the XenStore.

Definition at line 1411 of file XenStore.c.

◆ XenStoreRemove()

XENSTORE_STATUS XenStoreRemove ( IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node 
)

Remove a file or directory (directories must be empty).

Parameters
TransactionThe XenStore transaction covering this request.
DirectoryPathThe dirname of the directory to remove.
NodeThe basename of the directory to remove.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 1311 of file XenStore.c.

◆ XenStoreSPrint()

XENSTORE_STATUS EFIAPI XenStoreSPrint ( IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node,
IN CONST CHAR8 *  FormatString,
  ... 
)

Printf formatted write to a XenStore file.

Parameters
TransactionThe XenStore transaction covering this request.
DirectoryPathThe dirname of the path to read.
NodeThe basename of the path to read.
FormatStringAsciiSPrint format string followed by a variable number of arguments.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of write failure.

Definition at line 1392 of file XenStore.c.

◆ XenStoreTransactionEnd()

XENSTORE_STATUS XenStoreTransactionEnd ( IN CONST XENSTORE_TRANSACTION Transaction,
IN BOOLEAN  Abort 
)

End a transaction.

Parameters
TransactionThe transaction to end/commit.
AbortIf TRUE, the transaction is discarded instead of committed.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 1351 of file XenStore.c.

◆ XenStoreTransactionStart()

XENSTORE_STATUS XenStoreTransactionStart ( OUT XENSTORE_TRANSACTION Transaction)

Start a transaction.

Changes by others will not be seen during the lifetime of this transaction, and changes will not be visible to others until it is committed (XenStoreTransactionEnd).

Parameters
TransactionThe returned transaction.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 1328 of file XenStore.c.

◆ XenStoreUnregisterWatch()

VOID XenStoreUnregisterWatch ( IN XENSTORE_WATCH Watch)

Unregister a XenStore watch.

Parameters
WatchAn XENSTORE_WATCH object previously returned by a successful call to XenStoreRegisterWatch ().

Definition at line 1452 of file XenStore.c.

◆ XenStoreVSPrint()

XENSTORE_STATUS EFIAPI XenStoreVSPrint ( IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node,
IN CONST CHAR8 *  FormatString,
IN VA_LIST  Marker 
)

VA_LIST version of XenStoreSPrint().

Parameters
TransactionThe XenStore transaction covering this request.
DirectoryPathThe dirname of the path to read.
NodeThe basename of the path to read.
FormatStringPrintf format string.
MarkerVA_LIST of printf arguments.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of write failure.

Definition at line 1366 of file XenStore.c.

◆ XenStoreWrite()

XENSTORE_STATUS XenStoreWrite ( IN CONST XENSTORE_TRANSACTION Transaction,
IN CONST CHAR8 *  DirectoryPath,
IN CONST CHAR8 *  Node,
IN CONST CHAR8 *  Str 
)

Write to a single file.

Parameters
TransactionThe XenStore transaction covering this request.
DirectoryPathThe dirname of the file to write.
NodeThe basename of the file to write.
StrThe NUL terminated string of data to write.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 1286 of file XenStore.c.