aboutsummaryrefslogtreecommitdiff
path: root/rumpdisk
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.
* libmachdev: Avoid conflating translator name and pathSamuel Thibault2020-11-141-1/+1
| | | | | | | | | | | | bootstrap translators may not wish to appear in the FS, and the name of the translator does not have to match the path where it is getting installed. * libmachdev/machdev.h (machdev_trivfs_init): Add path parameter. * libmachdev/trivfs_server.c (machdev_trivfs_init): Add path parameter, set devnode only if it is not NULL. (trivfs_S_fsys_init): Only call install_as_translator when devnode is not NULL. * /rumpdisk/main.c (main): Add path parameter.
* libmachdev: Support installing translator in the FSDamien Zammit2020-11-141-1/+1
| | | | | | | | | | | | | | | | | */libmachdev/trivfs_server.c (machdev_ctl): Rename to control_port. (trivfs_S_fsys_init): Fix accordingly. (control): New variable. (bootstrapped, underlying, devnode): New variables. (install_as_translator): New function. (trivfs_S_fsys_init): When bootstrapping, call install_as_translator. (machdev_trivfs_init): Create one port of the control class. (trivfs_S_fsys_getpriv): Use ports_get_send_right on the control port instead of creating another one. (resume_bootstrap_server): Use ports_get_send_right on the control port instead of creating another one. (machdev_trivfs_init): When bootstrapping, Use our control port as fsys.
* 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-252-11/+123
| | | | 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-115-0/+527