| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.fshost; |
| |
| using fuchsia.io; |
| using zx; |
| |
| /// Manages filesystems which wish to be globally exposed under the filesystem host. |
| [Discoverable, ForDeprecatedCBindings] |
| protocol Registry { |
| /// Registers the output directory of a filesystem. These filesystems are |
| /// exported from the fuchsia.fshost.Filesystems service, where they are |
| /// be identified by an instance number (of the form "000", "001", etc). |
| /// |
| /// This directory is automatically de-registered from fuchsia.fshost.Filesystems |
| /// if the server end of the connection is closed. |
| RegisterFilesystem(fuchsia.io.Directory public_export) -> (zx.status s); |
| }; |
| |
| /// A collection of all registered filesystems. |
| [Discoverable, ForDeprecatedCBindings] |
| protocol Filesystems { |
| compose fuchsia.io.Directory; |
| }; |
| |
| /// Manages the block watcher. |
| [Discoverable] |
| protocol BlockWatcher { |
| /// Pauses the block watcher. This causes the block watcher to drop all |
| /// new block device events. |
| /// Returns ZX_ERR_UNAVAILABLE if the watcher has been paused too many times. |
| Pause() -> (zx.status status); |
| |
| /// Resumes the block watcher. The block watcher won't resume until every |
| /// Pause() call has had a corresponding Resume(). |
| /// Returns ZX_ERR_BAD_STATE if the watcher isn't paused. |
| Resume() -> (zx.status status); |
| }; |
| |
| /// Manages fshost lifecycle |
| [Discoverable] |
| protocol Admin { |
| /// Causes fshost to unmount all filesystems and exit. Fshost has |
| /// successfully unmounted all filesystems when this function returns, and |
| /// exits immediately after writing the response to this function. |
| // TODO(43186): replace with the component manager shutdown API once it |
| // becomes available. |
| Shutdown() -> (); |
| }; |