nets = [net for net in conn.listAllNetworks() if name is None or net.name() == name]