util: fix Linux build when libnl-devel isn't available

There was one stray bit of code in virnetdev.c that required libnl to
build, but wasn't qualified by defined(WITH_LIBNL). Adding that, plus
putting a similar check around a static function only used by that
aforementioned code, makes libvirt build properly without libnl3-devel
installed.

How useful it is in that state is a separate issue :-)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Laine Stump 2020-09-30 16:36:52 -04:00
parent 7556ab139f
commit 717615856c

View File

@ -1058,6 +1058,9 @@ virNetDevSysfsDeviceFile(char **pf_sysfs_device_link, const char *ifname,
return 0;
}
# if defined(WITH_LIBNL)
/**
* Determine if the device path specified in devpath is a PCI Device
* by resolving the 'subsystem'-link in devpath and looking for
@ -1091,6 +1094,7 @@ virNetDevIsPCIDevice(const char *devpath)
return STRPREFIX(subsys, "pci");
}
static virPCIDevicePtr
virNetDevGetPCIDevice(const char *devName)
{
@ -1110,6 +1114,7 @@ virNetDevGetPCIDevice(const char *devName)
return virPCIDeviceNew(vfPCIAddr->domain, vfPCIAddr->bus,
vfPCIAddr->slot, vfPCIAddr->function);
}
# endif
/**
@ -2958,7 +2963,7 @@ virNetDevGetEthtoolFeatures(const char *ifname,
}
# if WITH_DECL_DEVLINK_CMD_ESWITCH_GET
# if defined(WITH_LIBNL) && WITH_DECL_DEVLINK_CMD_ESWITCH_GET
/**
* virNetDevGetFamilyId: