Page MenuHomeFreeBSD

loader: implement map-vdisk and unmap-vdisk commands
ClosedPublic

Authored by tsoome on Mar 28 2019, 6:18 AM.
Tags
None
Referenced Files
F171822636: D19733.diff
Sun, Sep 13, 7:49 PM
Unknown Object (File)
Mon, Aug 24, 5:31 AM
Unknown Object (File)
Mon, Aug 24, 3:21 AM
Unknown Object (File)
Sun, Aug 23, 9:44 PM
Unknown Object (File)
Wed, Aug 19, 11:47 PM
Unknown Object (File)
Aug 14 2026, 5:03 PM
Unknown Object (File)
Aug 10 2026, 10:33 AM
Unknown Object (File)
Aug 10 2026, 10:23 AM
Subscribers

Details

Summary

Add map-vdisk and unmap-vdisk commands to create virtual disk interface on top of file. This will allow to use disk image from file system to load and start the kernel.

By mapping file, we create vdiskX device, the device will be listed by lsdev [-v] and can be accessed directly as ls vdisk0p1:/path or can be used as value for currdev variable.

vdisk strategy function does not use bcache as we have bcache used with backing file. vdisk can be unmapped when all consumers have closed the open files.

In first iteration we do not support the zfs images because zfs pools do keep the device open (there is no "zpool export" mechanism). Adding zfs support is relatively simple, we just need to run zfs disk probe after mapping is done.

Test Plan

use map-vdev, lsdev [-v], unmap-vdev commands

illumos review: https://www.illumos.org/rb/r/1583/

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Apr 26 2019, 5:58 PM
This revision was automatically updated to reflect the committed changes.