Commit b28b3ed7 authored by Antoine Millet's avatar Antoine Millet
Browse files

HotMigrationJob now use asynchronous calls for drbd connect

parent fb7389df
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -576,8 +576,14 @@ class HotMigrationJob(BaseMigrationJob):
        # start connection of drbd:
        self.report(status_msg % 'connect')

        source.proxy.drbd_connect(res_src, res_dst, dest.ip)
        dest.proxy.drbd_connect(res_dst, res_src, source.ip)
        watcher = AsyncWatcher()
        watcher.register(source.conn, 'drbd_connect', res_src, res_dst, dest.ip)
        watcher.register(dest.conn, 'drbd_connect', res_dst, res_src, source.ip)
        msgs = watcher.wait(timeout=30)
        for msg in msgs:
            if 'error' in msg:
                msg = 'error while drbd_connect: %s' % msg['error']['message']
                raise JobCancelError(msg)

        # setup topology as primary/secondary:
        source.proxy.drbd_role(res_src, True)