[libvirt] [PATCH] util: virPCIGetNetName(): use first netdev name when phys_port_id isn't matched

Andrea Bolognani abologna at redhat.com
Fri Sep 15 17:58:21 UTC 2017


On Fri, 2017-09-15 at 11:49 -0400, Laine Stump wrote:
> @@ -2902,6 +2903,15 @@ virPCIGetNetName(const char *device_link_sysfs_path,
>              /* if this one doesn't match, keep looking */
>              if (STRNEQ_NULLABLE(physPortID, thisPhysPortID)) {
>                  VIR_FREE(thisPhysPortID);
> +                /* save the first entry we find to use as a failsafe
> +                 * in case we don't match the phys_port_id. This is
> +                 * needed because some NIC drivers (e.g. i40e)
> +                 * implement phys_port_id for PFs, but not for VFs
> +                 */
> +                if (!firstEntryName &&
> +                    VIR_STRDUP(firstEntryName, entry->d_name) < 0)
> +                    goto cleanup;

You need curly braces around the body here.

Looks sane otherwise. ACK

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list