

@classmethod
def create(cls, xml, host):
    'Create a new Guest\n\n        :param xml: XML definition of the domain to create\n        :param host: host.Host connection to define the guest on\n\n        :returns guest.Guest: Guest ready to be launched\n        '
    try:
        domain = host.write_instance_config(xml)
    except Exception:
        with excutils.save_and_reraise_exception():
            LOG.error(_LE('Error defining a domain with XML: %s'), encodeutils.safe_decode(xml))
    return cls(domain)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/libvirt/guest.py Guest.create/original