mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Move struct elem out of virNetDevGetFeatures
Rename struct elem to virNetDevEthtoolFeatureCmd and move it out of the function to allow reusing it.
This commit is contained in:
parent
7d097b223d
commit
0a7da7882d
@ -3239,6 +3239,11 @@ virNetDevSendEthtoolIoctl(const char *ifname, void *cmd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct virNetDevEthtoolFeatureCmd {
|
||||||
|
const int cmd;
|
||||||
|
const virNetDevFeature feat;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virNetDevFeatureAvailable
|
* virNetDevFeatureAvailable
|
||||||
@ -3303,12 +3308,8 @@ virNetDevGetFeatures(const char *ifname,
|
|||||||
# if HAVE_DECL_ETHTOOL_GFEATURES
|
# if HAVE_DECL_ETHTOOL_GFEATURES
|
||||||
struct ethtool_gfeatures *g_cmd;
|
struct ethtool_gfeatures *g_cmd;
|
||||||
# endif
|
# endif
|
||||||
struct elem{
|
|
||||||
const int cmd;
|
|
||||||
const virNetDevFeature feat;
|
|
||||||
};
|
|
||||||
/* legacy ethtool getters */
|
/* legacy ethtool getters */
|
||||||
struct elem cmds[] = {
|
struct virNetDevEthtoolFeatureCmd cmds[] = {
|
||||||
{ETHTOOL_GRXCSUM, VIR_NET_DEV_FEAT_GRXCSUM},
|
{ETHTOOL_GRXCSUM, VIR_NET_DEV_FEAT_GRXCSUM},
|
||||||
{ETHTOOL_GTXCSUM, VIR_NET_DEV_FEAT_GTXCSUM},
|
{ETHTOOL_GTXCSUM, VIR_NET_DEV_FEAT_GTXCSUM},
|
||||||
{ETHTOOL_GSG, VIR_NET_DEV_FEAT_GSG},
|
{ETHTOOL_GSG, VIR_NET_DEV_FEAT_GSG},
|
||||||
@ -3339,7 +3340,7 @@ virNetDevGetFeatures(const char *ifname,
|
|||||||
# if HAVE_DECL_ETHTOOL_GFLAGS
|
# if HAVE_DECL_ETHTOOL_GFLAGS
|
||||||
size_t j = -1;
|
size_t j = -1;
|
||||||
/* ethtool masks */
|
/* ethtool masks */
|
||||||
struct elem flags[] = {
|
struct virNetDevEthtoolFeatureCmd flags[] = {
|
||||||
# if HAVE_DECL_ETH_FLAG_LRO
|
# if HAVE_DECL_ETH_FLAG_LRO
|
||||||
{ETH_FLAG_LRO, VIR_NET_DEV_FEAT_LRO},
|
{ETH_FLAG_LRO, VIR_NET_DEV_FEAT_LRO},
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user