aboutsummaryrefslogtreecommitdiff
path: root/rumpdisk/block-rump.c
Commit message (Collapse)AuthorAgeFilesLines
* rumpdisk: automatically prepend /dev/Samuel Thibault2020-11-161-12/+9
| | | | | | | to keep coherent with other storeio translators, grub scripts, etc. * rumpdisk/block-rump.c (translate_name): Prepend /dev/ to disk name. (is_disk_device): Do not match heading /dev/.
* rumpdisk: auto-disable when kernel runs disk driversSamuel Thibault2020-11-151-28/+65
| | | | | | | | | | | | | | | | | | | | By default we do not want rumpdisk to step over the kernel drivers. * rumpdisk/block-rump.c: Include <device/device.h>. (disabled): New variable. (dev_to_port): Rename to rumpdisk_dev_to_port. (device_init): Rename to rumpdisk_init. Exit if the kernel runs SATA drivers. (device_close): Rename to rumpdisk_device_close. (device_dealloc): Rename to rumpdisk_device_dealloc. (device_shutdown): Rename to rumpdisk_device_shutdown. Do not shutdown when disabled. (device_open): Rename to rumpdisk_device_open. Return D_NO_SUCH_DEVICE when disabled. (device_write): Rename to rumpdisk_device_write. (device_read): Rename to rumpdisk_device_read. (device_get_status): Rename to rumpdisk_device_get_status. (rump_block_emulation_ops): Update refs accordingly.
* rumpdisk: Support opening a device several timesSamuel Thibault2020-11-141-55/+58
| | | | | | | | | | * rumpdisk/block-rump.c (struct block_data): Make taken field an integer instead of a boolean. (device_open): When search_bd succeeds, set a new reference and return a new port right. Separate out io_return_t err, int fd, and int ret to avoid confusions. Simplify the error handling path. (device_close): Decrement reference and close rump disk only when reaching zero. Also destroy our port.
* rumpdisk: Comment on thread-safety requirementsSamuel Thibault2020-11-141-0/+3
|
* rumpdisk: Use rump_sys_pread/pwrite instead of lseek+r/w for atomic accessesDamien Zammit2020-11-091-17/+4
| | | | | | TESTED by booting a QEMU passthrough disk via rumpdisk.static Message-Id: <20201109070906.20796-1-damien@zamaudio.com>
* libmachdev: Introduce startup notification for clean rumpdisk shutdownDamien Zammit2020-08-021-1/+15
| | | | Message-Id: <20200801050538.273196-1-damien@zamaudio.com>
* rumpdisk: Use bootstrap resume of fs task in machdevDamien Zammit2020-07-251-8/+31
| | | | Message-Id: <20200725011847.186969-4-damien@zamaudio.com>
* rumpdisk: link the bd on success onlyDamien Zammit2020-07-181-2/+2
| | | | Otherwise we would crash after an unsuccessful device_open call.
* rumpdisk: Simplify codeDamien Zammit2020-07-181-4/+1
| | | | There is no need to store the error only to return it.
* Rumpdisk: fix buffer sizeSamuel Thibault2020-04-111-1/+1
| | | | | * rumpdisk/block-rump.c (device_open): Reduce the dev_name buffer size by one (unused) byte.
* rumpdisk: Use more canonical parameter orderSamuel Thibault2020-04-111-2/+2
| | | | | | | To match snprintf parameter order. * rumpdisk/block-rump.c (translate_name): Make `name' parameter last. (device_open): Fix translate_name call accordingly.
* rumpdisk: Add userspace disk support via librumpDamien Zammit2020-04-111-0/+350