# Path: virtman/utils/commands.py
# def execute(*cmd, **kwargs):
# def unlink(path):
# def link(src, dst):
# 
# Path: virtman/drivers/dmsetup.py
# class DmExecutor(dmsetup.Dmsetup):
#     def __init__(self):
# def remove_table(name):
# def reload_table(name, table):
# def multipath(name, disks):
# def reload_multipath(name, disks):
# def origin(origin_name, origin_dev):
# def snapshot(origin_path, snapshot_name, snapshot_dev):
# 
# Path: virtman/blockservice.py
# LOG = logging.getLogger(__name__)
# def findloop():
# def try_linkloop(loop_dev):
# def is_looped(loop_dev):
# def linkloop(loop_dev, path):
# def unlinkloop(loop_dev):
# 
# Path: virtman/drivers/connector.py
# class ISCSIExecutor(ISCSIConnector):
#     def __init__(self):
# def connect_volume(connection):
# def disconnect_volume(connection, device_info):
# 
# Path: virtman/drivers/fcg.py
# CONF = cfg.CONF
# class FcgExecutor(FCG):
#     def __init__(self):
# def is_valid():
# def create_group():
# def add_disk(disk):
# def rm_disk(disk):


import os
from oslo.config import cfg
from virtman.utils import commands
from virtman.drivers import dmsetup
from virtman import blockservice
from virtman.drivers import connector
from virtman.drivers import fcg
from virtman.openstack.common import log as logging




snapshot_opts = [
    cfg.BoolOpt('snapshot_with_cache',
                default=False,
                help='Whether snapshot can have cache'),
]
CONF = cfg.CONF
CONF.register_opts(snapshot_opts)

LOG = logging.getLogger(__name__)


class Snapshot(object):

    def __init__(self):
        pass

    def create(self):
        raise NotImplementedError()

    def destroy(self):
        raise NotImplementedError()

    @staticmethod
    def _create_cache(snapshot_dev):

# Path: virtman/utils/commands.py
# def execute(*cmd, **kwargs):
# def unlink(path):
# def link(src, dst):
# 
# Path: virtman/drivers/dmsetup.py
# class DmExecutor(dmsetup.Dmsetup):
#     def __init__(self):
# def remove_table(name):
# def reload_table(name, table):
# def multipath(name, disks):
# def reload_multipath(name, disks):
# def origin(origin_name, origin_dev):
# def snapshot(origin_path, snapshot_name, snapshot_dev):
# 
# Path: virtman/blockservice.py
# LOG = logging.getLogger(__name__)
# def findloop():
# def try_linkloop(loop_dev):
# def is_looped(loop_dev):
# def linkloop(loop_dev, path):
# def unlinkloop(loop_dev):
# 
# Path: virtman/drivers/connector.py
# class ISCSIExecutor(ISCSIConnector):
#     def __init__(self):
# def connect_volume(connection):
# def disconnect_volume(connection, device_info):
# 
# Path: virtman/drivers/fcg.py
# CONF = cfg.CONF
# class FcgExecutor(FCG):
#     def __init__(self):
# def is_valid():
# def create_group():
# def add_disk(disk):
# def rm_disk(disk):


# Path: virtman/snapshot.py
import os
from oslo.config import cfg
from virtman.utils import commands
from virtman.drivers import dmsetup
from virtman import blockservice
from virtman.drivers import connector
from virtman.drivers import fcg
from virtman.openstack.common import log as logging





snapshot_opts = [
    cfg.BoolOpt('snapshot_with_cache',
                default=False,
                help='Whether snapshot can have cache'),
]
CONF = cfg.CONF
CONF.register_opts(snapshot_opts)

LOG = logging.getLogger(__name__)


class Snapshot(object):

    def __init__(self):
        pass

    def create(self):
        raise NotImplementedError()

    def destroy(self):
        raise NotImplementedError()

    @staticmethod
    def _create_cache(snapshot_dev):

        cached_path = fcg.add_disk(snapshot_dev)