def __init__(self, ddxml_path, fs_sk): """Initialize ploop disk hauler Initialize ploop disk hauler with specified path to DiskDescriptor.xml file and socket. """ logging.info("Initilized ploop hauler (%s)", ddxml_path) self.__ploopcopy = libploop.ploopcopy(ddxml_path, fs_sk.fileno())
def __init__(self, deltas, ct_priv): """Initialize ploop disks hauler For each disk create libploop.ploopcopy object using path to disk descriptor file and corresponding socket. """ # Create libploop.ploopcopy objects, one per active ploop delta self.__log_init_hauler(deltas) self.__ct_priv = ct_priv self.__shared_ploops = [] self.__ploop_copies = [] for delta_path, delta_fd in deltas: ddxml_path = get_ddxml_path(delta_path) self.__check_ddxml(ddxml_path) self.__ploop_copies.append( libploop.ploopcopy(ddxml_path, delta_fd))
def __init__(self, deltas, ct_priv): """Initialize ploop disks hauler For each disk create libploop.ploopcopy object using path to disk descriptor file and corresponding socket. """ # Create libploop.ploopcopy objects, one per active ploop delta self.__log_init_hauler(deltas) self.__ct_priv = ct_priv self.__shared_ploops = [] self.__ploop_copies = [] for delta_path, delta_fd in deltas: ddxml_path = get_ddxml_path(delta_path) self.__check_ddxml(ddxml_path) self.__ploop_copies.append(libploop.ploopcopy( ddxml_path, delta_fd))
def do_ploop_copy(ddxml, fd): print "do_ploop_copy" ploop_mount(ddxml) pc = libploop.ploopcopy(ddxml, fd) pid = start_image_filller() print "Start copy" pc.copy_start() for n in range(0, 10): print "Iter:", n transferred = pc.copy_next_iteration() print "transferred:", transferred time.sleep(sleep_sec) print "Wait filler %d" % pid os.kill(pid, 15) os.waitpid(pid, 0) print "Stop sopy" pc.copy_stop() ploop_umount(ddxml)
def do_ploop_copy(ddxml, fd): print "do_ploop_copy" ploop_mount(ddxml) pc = libploop.ploopcopy(ddxml, fd); pid = start_image_filller() print "Start copy" pc.copy_start() for n in range(0, 10): print "Iter:", n transferred = pc.copy_next_iteration() print "transferred:", transferred time.sleep(sleep_sec) print "Wait filler %d" % pid os.kill(pid, 15) os.waitpid(pid, 0) print "Stop sopy" pc.copy_stop() ploop_umount(ddxml)