def METHOD_NAME(self, name):
    for vm in self._vms:
        if vm.name() == name:
            return vm
    raise fake.Error(libvirt.VIR_ERR_NO_DOMAIN,
                     'virDomainLookupByName() failed')