Ejemplo n.º 1
0
	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())
Ejemplo n.º 2
0
	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))
Ejemplo n.º 3
0
    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))
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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)