'Undefines a domain from hypervisor.'

def delete_configuration(self, support_uefi=False):

    try:
        flags = libvirt.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE
        if support_uefi:
            flags |= libvirt.VIR_DOMAIN_UNDEFINE_NVRAM
        self._domain.undefineFlags(flags)
    except libvirt.libvirtError:
        LOG.debug('Error    from    libvirt    during    undefineFlags.    %dRetrying    with    undefine', self.id)
        self._domain.undefine()
    except AttributeError:
        try:
            if self._domain.hasManagedSaveImage(0):
                self._domain.managedSaveRemove(0)
        except AttributeError:
            pass
        self._domain.undefine()
