'Lookup a full LibvirtConfigGuestInterface with
LibvirtConfigGuestInterface generated
by nova.virt.libvirt.vif.get_config.
:param cfg: config object that represents the guest interface.
:type cfg: LibvirtConfigGuestInterface object
:returns: nova.virt.libvirt.config.LibvirtConfigGuestInterface instance
if found, else None'

def get_interface_by_cfg(self, cfg):

    if cfg:
        interfaces = self.get_all_devices(vconfig.LibvirtConfigGuestInterface)
        for interface in interfaces:
            if ((interface.mac_addr == cfg.mac_addr) and (interface.net_type == cfg.net_type) and (interface.source_dev == cfg.source_dev) and (interface.target_dev == cfg.target_dev) and (interface.vhostuser_path == cfg.vhostuser_path)):
                return interface
