def _async_migrate(self, asyncjob,
                       origvm, origdconn, migrate_uri, rate, live,
                       secure, max_downtime):
        meter = asyncjob.get_meter()

        srcconn = util.dup_conn(origvm.conn)
        dstconn = util.dup_conn(origdconn)

        vminst = srcconn.vmm.lookupByName(origvm.get_name())
        vm = vmmDomain(srcconn, vminst, vminst.UUID())

        logging.debug("Migrating vm=%s from %s to %s", vm.get_name(),
                      srcconn.get_uri(), dstconn.get_uri())

        timer = None
        if max_downtime != 0:
            # 0 means that the spin box migrate-max-downtime does not
            # be enabled.
            current_thread = threading.currentThread()
            timer = self.timeout_add(100, self._async_set_max_downtime,
                                     vm, max_downtime, current_thread)

        vm.migrate(dstconn, migrate_uri, rate, live, secure, meter=meter)
        if timer:
            self.idle_add(gobject.source_remove, timer)
示例#2
0
    def _async_migrate(self, asyncjob,
                       origvm, origdconn, migrate_uri, rate, live,
                       secure, max_downtime):
        meter = asyncjob.get_meter()

        srcconn = util.dup_conn(origvm.conn)
        dstconn = util.dup_conn(origdconn)

        vminst = srcconn.vmm.lookupByName(origvm.get_name())
        vm = vmmDomain(srcconn, vminst, vminst.UUID())

        logging.debug("Migrating vm=%s from %s to %s", vm.get_name(),
                      srcconn.get_uri(), dstconn.get_uri())

        timer = None
        if max_downtime != 0:
            # 0 means that the spin box migrate-max-downtime does not
            # be enabled.
            current_thread = threading.currentThread()
            timer = self.timeout_add(100, self._async_set_max_downtime,
                                     vm, max_downtime, current_thread)

        vm.migrate(dstconn, migrate_uri, rate, live, secure, meter=meter)
        if timer:
            self.idle_add(GLib.source_remove, timer)
示例#3
0
        def check_new(rawvm, uuid):
            if uuid in origlist:
                vm = origlist[uuid]
                del (origlist[uuid])
            else:
                vm = vmmDomain(self, rawvm, uuid)
                new.append(uuid)

            current[uuid] = vm
示例#4
0
        def check_new(rawvm, uuid):
            if uuid in origlist:
                vm = origlist[uuid]
                del(origlist[uuid])
            else:
                vm = vmmDomain(self, rawvm, uuid)
                new.append(uuid)

            current[uuid] = vm
示例#5
0
 def _update_vms(self, dopoll):
     if not dopoll:
         return {}, {}, self.vms
     return pollhelpers.fetch_vms(self._backend, self.vms.copy(),
                 (lambda obj, key: vmmDomain(self, obj, key)))