diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-15 08:11:11 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-03-27 05:04:31 +0300 |
commit | 1758551ec9526d56303a2b5cf1f58147e66945ed (patch) | |
tree | 8e8b35f4dadae793cd6668d10f958f0337191806 /include/sandboxblockdev.h | |
parent | 803e9c1c94d06cfab43606056c653268e12926d8 (diff) | |
download | u-boot-1758551ec9526d56303a2b5cf1f58147e66945ed.tar.xz |
sandbox: Provide a way to bind fixed/removeable devices
At present when a file is bound to a host device it is always marked as
removeable. Arguably the device is removeable, since it can be unbound at
will. However while it is bound, it is not considered removable by the
user. Also it is useful to be able to model both fixed and removeable
devices for code that distinguishes them.
Add a -r flag to the 'host bind' command and plumb it through to provide
this feature.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/sandboxblockdev.h')
-rw-r--r-- | include/sandboxblockdev.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/sandboxblockdev.h b/include/sandboxblockdev.h index c1f0afb337..4006e942a0 100644 --- a/include/sandboxblockdev.h +++ b/include/sandboxblockdev.h @@ -14,6 +14,13 @@ struct host_block_dev { int fd; }; -int host_dev_bind(int dev, char *filename); +/** + * host_dev_bind() - Bind or unbind a device + * + * @dev: Device number (0=first slot) + * @filename: Host filename to use, or NULL to unbind + * @removable: true if the block device should mark itself as removable + */ +int host_dev_bind(int dev, char *filename, bool removable); #endif |