VDI mounttab:
$vm_name:$nbd_device:$nbd_partition:$mount_point0
Location for storing VM data
Location for storing HD images
Location for storing ISO images
Default OS type (see vbox_manage list ostypes)
Default SATA controller settings
Default IDE controller settings
Default size of new disk (in MB)
List of registered data types
Initialize data directories
List contents of directory stored in $1
Construct a filename using a directory stored in $1 and
the name from $3 passed through a function named in $2
Returns success if data file exists
vbox_data_rm hd 'disk image' "$@"
Add an entry to the mounttab
Remove an entry from the mounttab
List of NBD devices being used
Find NBD device for given HD image
Find next available NBD device
Starting after the last id, search through the device list
for the first unused device number.
devse array index
next device id
skip devices that are bigger than the next id being considered
skip ids if the devices are in-use
List all partition:path pairs for the image
Find partition mount point
if we need to mount the image, remember we did it
run fdisk on image device
if we mounted it, umount it
Internal helper for mounting HD image devices
Internal helper for umounting an HD image device
Mount an image partition
Unmount an image partition, unmounting
the image if no other partitions are using it.
check the device number again
no partitions remain mounted, unmount the image