summaryrefslogtreecommitdiffstats
path: root/sys/xen/xenbus/xenbusvar.h
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2012-02-15 06:45:49 +0000
committergibbs <gibbs@FreeBSD.org>2012-02-15 06:45:49 +0000
commit62950d55174ec7def76492b414234e7c18cfc8b0 (patch)
tree31eb73b39bf796c06500fc06a64caf6dcc2e267c /sys/xen/xenbus/xenbusvar.h
parent5485b3317afb6512a9895e1b616d46e684913c24 (diff)
downloadFreeBSD-src-62950d55174ec7def76492b414234e7c18cfc8b0.zip
FreeBSD-src-62950d55174ec7def76492b414234e7c18cfc8b0.tar.gz
Enhance documentation, improve interoperability, and fix defects in
FreeBSD's front and back Xen blkif interface drivers. sys/dev/xen/blkfront/block.h: sys/dev/xen/blkfront/blkfront.c: sys/dev/xen/blkback/blkback.c: Replace FreeBSD specific multi-page ring impelementation with support for both the Citrix and Amazon/RedHat versions of this extension. sys/dev/xen/blkfront/blkfront.c: o Add a per-instance sysctl tree that exposes all negotiated transport parameters (ring pages, max number of requests, max request size, max number of segments). o In blkfront_vdevice_to_unit() add a missing return statement so that we properly identify the unit number for high numbered xvd devices. sys/dev/xen/blkback/blkback.c: o Add static dtrace probes for several events in this driver. o Defer connection shutdown processing until the front-end enters the closed state. This avoids prematurely tearing down the connection when buggy front-ends transition to the closing state, even though the device is open and they veto the close request from the tool stack. o Add nodes for maximum request size and the number of active ring pages to the exising, per-instance, sysctl tree. o Miscelaneous style cleanup. sys/xen/interface/io/blkif.h: o Add extensive documentation of the XenStore nodes used to implement the blkif interface. o Document the startup sequence between a front and back driver. o Add structures and documenatation for the "discard" feature (AKA Trim). o Cleanup some definitions related to FreeBSD's request number/size/segment-limit extension. sys/dev/xen/blkfront/blkfront.c: sys/dev/xen/blkback/blkback.c: sys/xen/xenbus/xenbusvar.h: Add the convenience function xenbus_get_otherend_state() and use it to simplify some logic in both block-front and block-back. MFC after: 1 day
Diffstat (limited to 'sys/xen/xenbus/xenbusvar.h')
-rw-r--r--sys/xen/xenbus/xenbusvar.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/xen/xenbus/xenbusvar.h b/sys/xen/xenbus/xenbusvar.h
index bf2a342..1c730fb 100644
--- a/sys/xen/xenbus/xenbusvar.h
+++ b/sys/xen/xenbus/xenbusvar.h
@@ -104,6 +104,20 @@ XENBUS_ACCESSOR(otherend_path, OTHEREND_PATH, const char *)
XenbusState xenbus_read_driver_state(const char *path);
/**
+ * Return the state of the "other end" (peer) of a XenBus device.
+ *
+ * \param dev The XenBus device whose peer to query.
+ *
+ * \return The current state of the peer device or XenbusStateClosed if no
+ * state can be read.
+ */
+static inline XenbusState
+xenbus_get_otherend_state(device_t dev)
+{
+ return (xenbus_read_driver_state(xenbus_get_otherend_path(dev)));
+}
+
+/**
* Initialize and register a watch on the given path (client suplied storage).
*
* \param dev The XenBus device requesting the watch service.
OpenPOWER on IntegriCloud