]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
loader: implement map-vdisk and unmap-vdisk commands
authortsoome <tsoome@FreeBSD.org>
Fri, 26 Apr 2019 17:58:44 +0000 (17:58 +0000)
committertsoome <tsoome@FreeBSD.org>
Fri, 26 Apr 2019 17:58:44 +0000 (17:58 +0000)
commit2de304e78c863805c6e01be9290979ffc7bdb22c
tree02b9446798f475906e73847c2c75ad6e5b714fa3
parentf766b709efbdf7a07a03333a5b477e99b8989702
loader: implement map-vdisk and unmap-vdisk commands

illumos update: https://www.illumos.org/issues/10598

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.

Differential Revision: https://reviews.freebsd.org/D19733
stand/common/help.common
stand/common/vdisk.c [new file with mode: 0644]
stand/efi/loader/conf.c
stand/i386/loader/conf.c
stand/loader.mk