Needs an explicit memset to ensure allocation is done before DMA read --- rumpdisk/block-rump.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c index 80cdc350..f51c1adb 100644 --- a/rumpdisk/block-rump.c +++ b/rumpdisk/block-rump.c @@ -86,12 +86,12 @@ search_bd (char *name) return NULL; } -/* BSD name of whole disk device is /dev/wdXd +/* BSD name of whole disk device is /dev/rwdXd * but we will receive wdX as the name */ static void translate_name (char *output, int len, char *name) { - snprintf (output, len - 1, "/dev/%sd", name); + snprintf (output, len - 1, "/dev/r%sd", name); } static boolean_t @@ -324,6 +324,9 @@ rumpdisk_device_read (void *d, mach_port_t reply_port, if (buf == MAP_FAILED) return errno; + /* Ensure alloc */ + memset (buf, 0, npages * pagesize); + err = rump_sys_pread (bd->rump_fd, (void *)buf, (size_t)count, (off_t)bn * bd->block_size); if (err < 0) { -- 2.32.0