Esempio n. 1
0
    def restore_(self, config):
        """Create a domain as part of the restore process.  This is called
        only from {@link XendCheckpoint}.

        A restore request comes into XendDomain through {@link
        #domain_restore} or {@link #domain_restore_fd}.  That request is
        forwarded immediately to XendCheckpoint which, when it is ready, will
        call this method.  It is necessary to come through here rather than go
        directly to {@link XendDomainInfo.restore} because we need to
        serialise the domain creation process, but cannot lock
        domain_restore_fd as a whole, otherwise we will deadlock waiting for
        the old domain to die.
        """
        self.domains_lock.acquire()
        try:
            dominfo = XendDomainInfo.restore(config)
            self._add_domain(dominfo)
            return dominfo
        finally:
            self.domains_lock.release()