mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 09:04:07 +02:00
OvmfPkg/XenBusDxe: Add XenStore client implementation
XenStore is a key/value database, which is running on another virtual machine. It can be accessed through shared memory. This is a client implementation. Change in V3: - moving xs_wire.h from patch #1 to this patch - fix return value of XenStoreListDirectory - Use a timeout to print a debug message if the other side of the xenstore ring does not notify through the event channel. This is done with the new XenStoreWaitForEvent function. - Have XenStoreReadReply check status of XenStoreProcessMessage and return an error if needed. - Have XenStoreTalkv return the status of XenStoreReadReply. - Have a loop to check for the quiescent of the response ring in the XenStoreInitComms function. (with a timeout of 5 seconds) - use the recently introduced XenStore 'closing' feature. Change in V2: - Change comment style, from freebsd to ovmf - Fix type of EventChannel - Fix debug print, no more cast - Implement XenStoreDeinit. - Clean up comments - Fix few codding style issue - Add FAIL xenstore status value. Origin: FreeBSD 10.0 License: This patch adds several files under the MIT licence. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16267 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6342f1fea8
commit
a9090a94bb
149
OvmfPkg/Include/IndustryStandard/Xen/io/xs_wire.h
Normal file
149
OvmfPkg/Include/IndustryStandard/Xen/io/xs_wire.h
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
/*
|
||||||
|
* Details of the "wire" protocol between Xen Store Daemon and client
|
||||||
|
* library or guest kernel.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
* DEALINGS IN THE SOFTWARE.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005 Rusty Russell IBM Corporation
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _XS_WIRE_H
|
||||||
|
#define _XS_WIRE_H
|
||||||
|
|
||||||
|
enum xsd_sockmsg_type
|
||||||
|
{
|
||||||
|
XS_DEBUG,
|
||||||
|
XS_DIRECTORY,
|
||||||
|
XS_READ,
|
||||||
|
XS_GET_PERMS,
|
||||||
|
XS_WATCH,
|
||||||
|
XS_UNWATCH,
|
||||||
|
XS_TRANSACTION_START,
|
||||||
|
XS_TRANSACTION_END,
|
||||||
|
XS_INTRODUCE,
|
||||||
|
XS_RELEASE,
|
||||||
|
XS_GET_DOMAIN_PATH,
|
||||||
|
XS_WRITE,
|
||||||
|
XS_MKDIR,
|
||||||
|
XS_RM,
|
||||||
|
XS_SET_PERMS,
|
||||||
|
XS_WATCH_EVENT,
|
||||||
|
XS_ERROR,
|
||||||
|
XS_IS_DOMAIN_INTRODUCED,
|
||||||
|
XS_RESUME,
|
||||||
|
XS_SET_TARGET,
|
||||||
|
XS_RESTRICT,
|
||||||
|
XS_RESET_WATCHES,
|
||||||
|
|
||||||
|
XS_INVALID = 0xffff /* Guaranteed to remain an invalid type */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define XS_WRITE_NONE "NONE"
|
||||||
|
#define XS_WRITE_CREATE "CREATE"
|
||||||
|
#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
|
||||||
|
|
||||||
|
/* We hand errors as strings, for portability. */
|
||||||
|
struct xsd_errors
|
||||||
|
{
|
||||||
|
INT32 errnum;
|
||||||
|
const CHAR8 *errstring;
|
||||||
|
};
|
||||||
|
#ifdef EINVAL
|
||||||
|
#define XSD_ERROR(x) { x, #x }
|
||||||
|
/* LINTED: static unused */
|
||||||
|
static struct xsd_errors xsd_errors[]
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
__attribute__((unused))
|
||||||
|
#endif
|
||||||
|
= {
|
||||||
|
XSD_ERROR(EINVAL),
|
||||||
|
XSD_ERROR(EACCES),
|
||||||
|
XSD_ERROR(EEXIST),
|
||||||
|
XSD_ERROR(EISDIR),
|
||||||
|
XSD_ERROR(ENOENT),
|
||||||
|
XSD_ERROR(ENOMEM),
|
||||||
|
XSD_ERROR(ENOSPC),
|
||||||
|
XSD_ERROR(EIO),
|
||||||
|
XSD_ERROR(ENOTEMPTY),
|
||||||
|
XSD_ERROR(ENOSYS),
|
||||||
|
XSD_ERROR(EROFS),
|
||||||
|
XSD_ERROR(EBUSY),
|
||||||
|
XSD_ERROR(EAGAIN),
|
||||||
|
XSD_ERROR(EISCONN),
|
||||||
|
XSD_ERROR(E2BIG)
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct xsd_sockmsg
|
||||||
|
{
|
||||||
|
UINT32 type; /* XS_??? */
|
||||||
|
UINT32 req_id;/* Request identifier, echoed in daemon's response. */
|
||||||
|
UINT32 tx_id; /* Transaction id (0 if not related to a transaction). */
|
||||||
|
UINT32 len; /* Length of data following this. */
|
||||||
|
|
||||||
|
/* Generally followed by nul-terminated string(s). */
|
||||||
|
};
|
||||||
|
|
||||||
|
enum xs_watch_type
|
||||||
|
{
|
||||||
|
XS_WATCH_PATH = 0,
|
||||||
|
XS_WATCH_TOKEN
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* `incontents 150 xenstore_struct XenStore wire protocol.
|
||||||
|
*
|
||||||
|
* Inter-domain shared memory communications. */
|
||||||
|
#define XENSTORE_RING_SIZE 1024
|
||||||
|
typedef UINT32 XENSTORE_RING_IDX;
|
||||||
|
#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
|
||||||
|
struct xenstore_domain_interface {
|
||||||
|
CHAR8 req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
|
||||||
|
CHAR8 rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
|
||||||
|
XENSTORE_RING_IDX req_cons, req_prod;
|
||||||
|
XENSTORE_RING_IDX rsp_cons, rsp_prod;
|
||||||
|
UINT32 server_features; /* Bitmap of features supported by the server */
|
||||||
|
UINT32 connection;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Violating this is very bad. See docs/misc/xenstore.txt. */
|
||||||
|
#define XENSTORE_PAYLOAD_MAX 4096
|
||||||
|
|
||||||
|
/* Violating these just gets you an error back */
|
||||||
|
#define XENSTORE_ABS_PATH_MAX 3072
|
||||||
|
#define XENSTORE_REL_PATH_MAX 2048
|
||||||
|
|
||||||
|
/* The ability to reconnect a ring */
|
||||||
|
#define XENSTORE_SERVER_FEATURE_RECONNECTION 1
|
||||||
|
|
||||||
|
/* Valid values for the connection field */
|
||||||
|
#define XENSTORE_CONNECTED 0 /* the steady-state */
|
||||||
|
#define XENSTORE_RECONNECT 1 /* guest has initiated a reconnect */
|
||||||
|
|
||||||
|
#endif /* _XS_WIRE_H */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* mode: C
|
||||||
|
* c-file-style: "BSD"
|
||||||
|
* c-basic-offset: 4
|
||||||
|
* tab-width: 4
|
||||||
|
* indent-tabs-mode: nil
|
||||||
|
* End:
|
||||||
|
*/
|
@ -32,6 +32,35 @@
|
|||||||
///
|
///
|
||||||
typedef struct _XENBUS_PROTOCOL XENBUS_PROTOCOL;
|
typedef struct _XENBUS_PROTOCOL XENBUS_PROTOCOL;
|
||||||
|
|
||||||
|
typedef enum xenbus_state XenBusState;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
UINT32 Id;
|
||||||
|
} XENSTORE_TRANSACTION;
|
||||||
|
|
||||||
|
#define XST_NIL ((XENSTORE_TRANSACTION) { 0 })
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
XENSTORE_STATUS_SUCCESS = 0,
|
||||||
|
XENSTORE_STATUS_FAIL,
|
||||||
|
XENSTORE_STATUS_EINVAL,
|
||||||
|
XENSTORE_STATUS_EACCES,
|
||||||
|
XENSTORE_STATUS_EEXIST,
|
||||||
|
XENSTORE_STATUS_EISDIR,
|
||||||
|
XENSTORE_STATUS_ENOENT,
|
||||||
|
XENSTORE_STATUS_ENOMEM,
|
||||||
|
XENSTORE_STATUS_ENOSPC,
|
||||||
|
XENSTORE_STATUS_EIO,
|
||||||
|
XENSTORE_STATUS_ENOTEMPTY,
|
||||||
|
XENSTORE_STATUS_ENOSYS,
|
||||||
|
XENSTORE_STATUS_EROFS,
|
||||||
|
XENSTORE_STATUS_EBUSY,
|
||||||
|
XENSTORE_STATUS_EAGAIN,
|
||||||
|
XENSTORE_STATUS_EISCONN,
|
||||||
|
XENSTORE_STATUS_E2BIG
|
||||||
|
} XENSTORE_STATUS;
|
||||||
|
|
||||||
|
|
||||||
#include <IndustryStandard/Xen/grant_table.h>
|
#include <IndustryStandard/Xen/grant_table.h>
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "XenHypercall.h"
|
#include "XenHypercall.h"
|
||||||
#include "GrantTable.h"
|
#include "GrantTable.h"
|
||||||
|
#include "XenStore.h"
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -346,6 +347,9 @@ XenBusDxeDriverBindingStart (
|
|||||||
|
|
||||||
XenGrantTableInit (Dev, MmioAddr);
|
XenGrantTableInit (Dev, MmioAddr);
|
||||||
|
|
||||||
|
Status = XenStoreInit (Dev);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_CALLBACK,
|
Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_CALLBACK,
|
||||||
NotifyExitBoot,
|
NotifyExitBoot,
|
||||||
(VOID*) Dev,
|
(VOID*) Dev,
|
||||||
@ -399,6 +403,7 @@ XenBusDxeDriverBindingStop (
|
|||||||
XENBUS_DEVICE *Dev = mMyDevice;
|
XENBUS_DEVICE *Dev = mMyDevice;
|
||||||
|
|
||||||
gBS->CloseEvent (Dev->ExitBootEvent);
|
gBS->CloseEvent (Dev->ExitBootEvent);
|
||||||
|
XenStoreDeinit (Dev);
|
||||||
XenGrantTableDeinit (Dev);
|
XenGrantTableDeinit (Dev);
|
||||||
|
|
||||||
gBS->CloseProtocol (ControllerHandle, &gEfiPciIoProtocolGuid,
|
gBS->CloseProtocol (ControllerHandle, &gEfiPciIoProtocolGuid,
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
GrantTable.h
|
GrantTable.h
|
||||||
EventChannel.c
|
EventChannel.c
|
||||||
EventChannel.h
|
EventChannel.h
|
||||||
|
XenStore.c
|
||||||
|
XenStore.h
|
||||||
|
|
||||||
[Sources.IA32]
|
[Sources.IA32]
|
||||||
Ia32/hypercall.S
|
Ia32/hypercall.S
|
||||||
|
1386
OvmfPkg/XenBusDxe/XenStore.c
Normal file
1386
OvmfPkg/XenBusDxe/XenStore.c
Normal file
File diff suppressed because it is too large
Load Diff
292
OvmfPkg/XenBusDxe/XenStore.h
Normal file
292
OvmfPkg/XenBusDxe/XenStore.h
Normal file
@ -0,0 +1,292 @@
|
|||||||
|
/** @file
|
||||||
|
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:
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this source file (the "Software"), to deal in the Software without
|
||||||
|
restriction, including without limitation the rights to use, copy, modify,
|
||||||
|
merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
and to permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
IN THE SOFTWARE.
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef _XEN_XENSTORE_XENSTOREVAR_H
|
||||||
|
#define _XEN_XENSTORE_XENSTOREVAR_H
|
||||||
|
|
||||||
|
#include "XenBusDxe.h"
|
||||||
|
|
||||||
|
#include <IndustryStandard/Xen/io/xs_wire.h>
|
||||||
|
|
||||||
|
typedef struct _XENSTORE_WATCH XENSTORE_WATCH;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fetch the contents of a directory in the XenStore.
|
||||||
|
|
||||||
|
@param Transaction The XenStore transaction covering this request.
|
||||||
|
@param DirectoryPath The dirname of the path to read.
|
||||||
|
@param Node The basename of the path to read.
|
||||||
|
@param DirectoryCountPtr The returned number of directory entries.
|
||||||
|
@param DirectoryListPtr An array of directory entry strings.
|
||||||
|
|
||||||
|
@return 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.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
XenStoreListDirectory (
|
||||||
|
IN XENSTORE_TRANSACTION Transaction,
|
||||||
|
IN CONST CHAR8 *DirectoryPath,
|
||||||
|
IN CONST CHAR8 *Node,
|
||||||
|
OUT UINT32 *DirectoryCountPtr,
|
||||||
|
OUT CONST CHAR8 ***DirectoryListPtr
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Determine if a path exists in the XenStore.
|
||||||
|
|
||||||
|
@param Transaction The XenStore transaction covering this request.
|
||||||
|
@param Directory The dirname of the path to read.
|
||||||
|
@param Node The basename of the path to read.
|
||||||
|
|
||||||
|
@retval TRUE The path exists.
|
||||||
|
@retval FALSE The path does not exist or an error occurred attempting
|
||||||
|
to make that determination.
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
XenStorePathExists (
|
||||||
|
IN XENSTORE_TRANSACTION Transaction,
|
||||||
|
IN CONST CHAR8 *Directory,
|
||||||
|
IN CONST CHAR8 *Node
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
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.
|
||||||
|
|
||||||
|
@param Transaction The XenStore transaction covering this request.
|
||||||
|
@param DirectoryPath The dirname of the file to read.
|
||||||
|
@param Node The basename of the file to read.
|
||||||
|
@param LenPtr The amount of data read.
|
||||||
|
@param Result The returned contents from this file.
|
||||||
|
|
||||||
|
@return 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.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
XenStoreRead (
|
||||||
|
IN XENSTORE_TRANSACTION Transaction,
|
||||||
|
IN CONST CHAR8 *DirectoryPath,
|
||||||
|
IN CONST CHAR8 *Node,
|
||||||
|
OUT UINT32 *LenPtr OPTIONAL,
|
||||||
|
OUT VOID **Result
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Write to a single file.
|
||||||
|
|
||||||
|
@param Transaction The XenStore transaction covering this request.
|
||||||
|
@param DirectoryPath The dirname of the file to write.
|
||||||
|
@param Node The basename of the file to write.
|
||||||
|
@param Str The NUL terminated string of data to write.
|
||||||
|
|
||||||
|
@return On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value
|
||||||
|
indicating the type of failure.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
XenStoreWrite (
|
||||||
|
IN XENSTORE_TRANSACTION Transaction,
|
||||||
|
IN CONST CHAR8 *DirectoryPath,
|
||||||
|
IN CONST CHAR8 *Node,
|
||||||
|
IN CONST CHAR8 *Str
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Remove a file or directory (directories must be empty).
|
||||||
|
|
||||||
|
@param Transaction The XenStore transaction covering this request.
|
||||||
|
@param DirectoryPath The dirname of the directory to remove.
|
||||||
|
@param Node The basename of the directory to remove.
|
||||||
|
|
||||||
|
@return On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value
|
||||||
|
indicating the type of failure.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
XenStoreRemove (
|
||||||
|
IN XENSTORE_TRANSACTION Transaction,
|
||||||
|
IN CONST CHAR8 *DirectoryPath,
|
||||||
|
IN CONST CHAR8 *Node
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
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).
|
||||||
|
|
||||||
|
@param Transaction The returned transaction.
|
||||||
|
|
||||||
|
@return On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value
|
||||||
|
indicating the type of failure.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
XenStoreTransactionStart (
|
||||||
|
OUT XENSTORE_TRANSACTION *Transaction
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
End a transaction.
|
||||||
|
|
||||||
|
@param Transaction The transaction to end/commit.
|
||||||
|
@param Abort If TRUE, the transaction is discarded
|
||||||
|
instead of committed.
|
||||||
|
|
||||||
|
@return On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value
|
||||||
|
indicating the type of failure.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
XenStoreTransactionEnd (
|
||||||
|
IN XENSTORE_TRANSACTION Transaction,
|
||||||
|
IN BOOLEAN Abort
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Printf formatted write to a XenStore file.
|
||||||
|
|
||||||
|
@param Transaction The XenStore transaction covering this request.
|
||||||
|
@param DirectoryPath The dirname of the path to read.
|
||||||
|
@param Node The basename of the path to read.
|
||||||
|
@param FormatString AsciiSPrint format string followed by a variable number
|
||||||
|
of arguments.
|
||||||
|
|
||||||
|
@return On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value
|
||||||
|
indicating the type of write failure.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
EFIAPI
|
||||||
|
XenStoreSPrint (
|
||||||
|
IN XENSTORE_TRANSACTION Transaction,
|
||||||
|
IN CONST CHAR8 *DirectoryPath,
|
||||||
|
IN CONST CHAR8 *Node,
|
||||||
|
IN CONST CHAR8 *FormatString,
|
||||||
|
...
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
VA_LIST version of XenStoreSPrint().
|
||||||
|
|
||||||
|
@param Transaction The XenStore transaction covering this request.
|
||||||
|
@param DirectoryPath The dirname of the path to read.
|
||||||
|
@param Node The basename of the path to read.
|
||||||
|
@param FormatString Printf format string.
|
||||||
|
@param Marker VA_LIST of printf arguments.
|
||||||
|
|
||||||
|
@return On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value
|
||||||
|
indicating the type of write failure.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
XenStoreVSPrint (
|
||||||
|
IN XENSTORE_TRANSACTION Transaction,
|
||||||
|
IN CONST CHAR8 *DirectoryPath,
|
||||||
|
IN CONST CHAR8 *Node,
|
||||||
|
IN CONST CHAR8 *FormatString,
|
||||||
|
IN VA_LIST Marker
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
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.
|
||||||
|
|
||||||
|
@param DirectoryPath The dirname of the path to watch.
|
||||||
|
@param Node The basename of the path to watch.
|
||||||
|
@param WatchPtr A returned XENSTORE_WATCH pointer.
|
||||||
|
|
||||||
|
@return On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value
|
||||||
|
indicating the type of write failure. EEXIST errors from the
|
||||||
|
XenStore are supressed, allowing multiple, physically different,
|
||||||
|
xenbus_watch objects, to watch the same path in the XenStore.
|
||||||
|
**/
|
||||||
|
XENSTORE_STATUS
|
||||||
|
XenStoreRegisterWatch (
|
||||||
|
IN CONST CHAR8 *DirectoryPath,
|
||||||
|
IN CONST CHAR8 *Node,
|
||||||
|
OUT XENSTORE_WATCH **WatchPtr
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Unregister a XenStore watch.
|
||||||
|
|
||||||
|
@param Watch An XENSTORE_WATCH object previously returned by a successful
|
||||||
|
call to XenStoreRegisterWatch ().
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
XenStoreUnregisterWatch (
|
||||||
|
IN XENSTORE_WATCH *Watch
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Allocate and return the XenStore path string <DirectoryPath>/<Node>. If name
|
||||||
|
is the NUL string, the returned value contains the path string
|
||||||
|
<DirectoryPath>.
|
||||||
|
|
||||||
|
@param DirectoryPath The NUL terminated directory prefix for new path.
|
||||||
|
@param Node The NUL terminated basename for the new path.
|
||||||
|
|
||||||
|
@return A buffer containing the joined path.
|
||||||
|
*/
|
||||||
|
CHAR8 *
|
||||||
|
XenStoreJoin (
|
||||||
|
IN CONST CHAR8 *DirectoryPath,
|
||||||
|
IN CONST CHAR8 *Node
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initialize the XenStore states and rings.
|
||||||
|
|
||||||
|
@param Dev A pointer to a XENBUS_DEVICE instance.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS if everything went smoothly.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
XenStoreInit (
|
||||||
|
XENBUS_DEVICE *Dev
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Deinitialize the XenStore states and rings.
|
||||||
|
|
||||||
|
@param Dev A pointer to a XENBUS_DEVICE instance.
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
XenStoreDeinit (
|
||||||
|
IN XENBUS_DEVICE *Dev
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif /* _XEN_XENSTORE_XENSTOREVAR_H */
|
Loading…
x
Reference in New Issue
Block a user