diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-11-26 21:36:10 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-11-26 21:36:10 +0100 |
commit | ba5fabf334af2ebf6fb07910059517ae0569948e (patch) | |
tree | b3c96821a4d179814295fc79fd0cf699eb55ca07 /rumpdisk | |
parent | 2adb43e792bbd8d2cccf0773672f25bd5f4a0613 (diff) | |
download | hurd-ba5fabf334af2ebf6fb07910059517ae0569948e.tar.gz hurd-ba5fabf334af2ebf6fb07910059517ae0569948e.tar.bz2 hurd-ba5fabf334af2ebf6fb07910059517ae0569948e.zip |
rumpdisk: implement BLKRRPART
This is used by parted to reload the partition table. Since we do not
actually implement partition tables, we can just ignore it.
* rumpdisk/block-rump.c (BLKRRPART): New macro.
(rumpdisk_device_set_status): New function.
(rump_block_emulation_ops): Set device_set_status field to
rumpdisk_device_set_status.
Diffstat (limited to 'rumpdisk')
-rw-r--r-- | rumpdisk/block-rump.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c index 3425d0ad..3ee0773d 100644 --- a/rumpdisk/block-rump.c +++ b/rumpdisk/block-rump.c @@ -41,6 +41,8 @@ #define DIOCGMEDIASIZE _IOR('d', 132, off_t) #define DIOCGSECTORSIZE _IOR('d', 133, unsigned int) +#define BLKRRPART _IO(0x12,95) /* re-read partition table */ + #define DISK_NAME_LEN 32 #define MAX_DISK_DEV 2 @@ -343,6 +345,21 @@ rumpdisk_device_read (void *d, mach_port_t reply_port, } static io_return_t +rumpdisk_device_set_status (void *d, dev_flavor_t flavor, dev_status_t status, + mach_msg_type_number_t status_count) +{ + switch (flavor) + { + case BLKRRPART: + /* Partitions are not implemented here, but in the parted-based + * translators. */ + return D_SUCCESS; + default: + return D_INVALID_OPERATION; + } +} + +static io_return_t rumpdisk_device_get_status (void *d, dev_flavor_t flavor, dev_status_t status, mach_msg_type_number_t * count) { @@ -363,7 +380,6 @@ rumpdisk_device_get_status (void *d, dev_flavor_t flavor, dev_status_t status, break; default: return D_INVALID_OPERATION; - break; } return D_SUCCESS; } @@ -394,7 +410,7 @@ static struct machdev_device_emulation_ops rump_block_emulation_ops = { NULL, rumpdisk_device_read, /* FIXME: make multithreaded */ NULL, - NULL, + rumpdisk_device_set_status, rumpdisk_device_get_status, NULL, NULL, |