The nova.virt.disk.mount.api Module

Support for mounting virtual image files.

class Mount(image, mount_dir, partition=None, device=None)

Bases: object

Standard mounting operations, that can be overridden by subclasses.

The basic device operations provided are get, map and mount, to be called in that order.

do_mount()

Call the get, map and mnt operations.

do_teardown()

Call the umnt, unmap, and unget operations.

do_umount()

Call the unmnt operation.

flush_dev()
get_dev()

Make the image available as a block device in the file system.

static instance_for_device(image, mountdir, partition, device)

Get a Mount instance for the device type

Parameters:
  • image – instance of nova.virt.image.model.Image
  • mountdir – path to mount the image at
  • partition – partition number to mount
  • device – mounted device path
static instance_for_format(image, mountdir, partition)

Get a Mount instance for the image type

Parameters:
  • image – instance of nova.virt.image.model.Image
  • mountdir – path to mount the image at
  • partition – partition number to mount
map_dev()

Map partitions of the device to the file system namespace.

mnt_dev()

Mount the device into the file system.

mode = None
reset_dev()

Reset device paths to allow unmounting.

unget_dev()

Release the block device from the file system namespace.

unmap_dev()

Remove partitions of the device from the file system namespace.

unmnt_dev()

Unmount the device from the file system.

Previous topic

The nova.virt.disk.api Module

Next topic

The nova.virt.disk.mount.loop Module

Project Source

This Page