FreeBSD xen subsystem code
|
Client-facing interface for the Xenbus driver. More...
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/libkern.h>
#include <sys/sbuf.h>
#include <xen/xen-os.h>
#include <xen/hypervisor.h>
#include <xen/evtchn.h>
#include <xen/gnttab.h>
#include <xen/xenbus/xenbusvar.h>
#include <machine/stdarg.h>
Go to the source code of this file.
Macros | |
#define | DPRINTK(fmt, args...) ((void)0) |
#define | PRINTF_BUFFER_SIZE 4096 |
Functions | |
__FBSDID ("$FreeBSD$") | |
MALLOC_DEFINE (M_XENBUS, "xenbus", "XenBus Support") | |
static char * | error_path (device_t dev) |
Construct the error path corresponding to the given XenBus device. More... | |
const char * | xenbus_strstate (XenbusState state) |
void | xenbus_dev_verror (device_t dev, int err, const char *fmt, va_list ap) |
void | xenbus_dev_error (device_t dev, int err, const char *fmt,...) |
void | xenbus_dev_vfatal (device_t dev, int err, const char *fmt, va_list ap) |
void | xenbus_dev_fatal (device_t dev, int err, const char *fmt,...) |
int | xenbus_grant_ring (device_t dev, unsigned long ring_mfn, grant_ref_t *refp) |
XenbusState | xenbus_read_driver_state (const char *path) |
int | xenbus_dev_is_online (device_t dev) |
void | xenbus_localend_changed (device_t dev, const char *path) |
Client-facing interface for the Xenbus driver.
In other words, the interface between the Xenbus and the device-specific code, be it the frontend or the backend of that driver.
Definition in file xenbus.c.
|
static |
Construct the error path corresponding to the given XenBus device.
dev | The XenBus device for which we are constructing an error path. |
It is the caller's responsibility to free any returned error path node using the M_XENBUS malloc type.
void xenbus_dev_error | ( | device_t | dev, |
int | err, | ||
const char * | fmt, | ||
... | |||
) |
void xenbus_dev_fatal | ( | device_t | dev, |
int | err, | ||
const char * | fmt, | ||
... | |||
) |
int xenbus_dev_is_online | ( | device_t | dev | ) |
Return the value of a XenBus device's "online" node within the XenStore.
dev | The XenBus device to query. |
Definition at line 198 of file xenbus.c.
Referenced by xenbusb_back_localend_changed(), and xenbusb_back_otherend_changed().
void xenbus_dev_verror | ( | device_t | dev, |
int | err, | ||
const char * | fmt, | ||
va_list | ap | ||
) |
void xenbus_dev_vfatal | ( | device_t | dev, |
int | err, | ||
const char * | fmt, | ||
va_list | ap | ||
) |
int xenbus_grant_ring | ( | device_t | dev, |
unsigned long | ring_mfn, | ||
grant_ref_t * | refp | ||
) |
Grant access to the given ring_mfn to the peer of the given device.
dev | The device granting access to the ring page. |
ring_mfn | The guest machine page number of the page to grant peer access rights. |
refp[out] | The grant reference for the page. |
A successful call to xenbus_grant_ring should be paired with a call to gnttab_end_foreign_access() when foregn access to this page is no longer requried.
Definition at line 170 of file xenbus.c.
References xenbus_dev_fatal().
void xenbus_localend_changed | ( | device_t | dev, |
const char * | path | ||
) |
Default callback invoked when a change to the local XenStore sub-tree for a device is modified.
dev | The XenBus device whose tree was modified. |
path | The tree relative sub-path to the modified node. The empty string indicates the root of the tree was destroyed. |
XenbusState xenbus_read_driver_state | ( | const char * | path | ) |
Return the state of a XenBus device.
path | The root XenStore path for the device. |
Definition at line 185 of file xenbus.c.
Referenced by xenbus_get_otherend_state(), xenbusb_add_device(), xenbusb_localend_changed(), and xenbusb_otherend_watch_cb().