'Get a Mount instance for the device type
:param image: instance of nova.virt.image.model.Image
:param mountdir: path to mount the image at
:param partition: partition number to mount
:param device: mounted device path'

@staticmethod
def instance_for_device(image, mountdir, partition, device):

    LOG.debug('Instance    for    device    image=%(image)s    mountdir=%(mountdir)s    partition=%(partition)s    device=%(device)s', {'image': image, 'mountdir': mountdir, 'partition': partition, 'device': device})
    if ('loop' in device):
        LOG.debug('Using    LoopMount')
        return importutils.import_object('nova.virt.disk.mount.loop.LoopMount', image, mountdir, partition, device)
    elif ('nbd' in device):
        LOG.debug('Using    NbdMount')
        return importutils.import_object('nova.virt.disk.mount.nbd.NbdMount', image, mountdir, partition, device)
    else:
        LOG.debug('Using    BlockMount')
        return importutils.import_object('nova.virt.disk.mount.block.BlockMount', image, mountdir, partition, device)
