From 0a7da7882dcb5154115a59ceec1773c6ce51091b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Fri, 3 Jun 2016 20:01:44 +0200 Subject: [PATCH] Move struct elem out of virNetDevGetFeatures Rename struct elem to virNetDevEthtoolFeatureCmd and move it out of the function to allow reusing it. --- src/util/virnetdev.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 5ad61fe870..04127b5021 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -3239,6 +3239,11 @@ virNetDevSendEthtoolIoctl(const char *ifname, void *cmd) return ret; } +struct virNetDevEthtoolFeatureCmd { + const int cmd; + const virNetDevFeature feat; +}; + /** * virNetDevFeatureAvailable @@ -3303,12 +3308,8 @@ virNetDevGetFeatures(const char *ifname, # if HAVE_DECL_ETHTOOL_GFEATURES struct ethtool_gfeatures *g_cmd; # endif - struct elem{ - const int cmd; - const virNetDevFeature feat; - }; /* legacy ethtool getters */ - struct elem cmds[] = { + struct virNetDevEthtoolFeatureCmd cmds[] = { {ETHTOOL_GRXCSUM, VIR_NET_DEV_FEAT_GRXCSUM}, {ETHTOOL_GTXCSUM, VIR_NET_DEV_FEAT_GTXCSUM}, {ETHTOOL_GSG, VIR_NET_DEV_FEAT_GSG}, @@ -3339,7 +3340,7 @@ virNetDevGetFeatures(const char *ifname, # if HAVE_DECL_ETHTOOL_GFLAGS size_t j = -1; /* ethtool masks */ - struct elem flags[] = { + struct virNetDevEthtoolFeatureCmd flags[] = { # if HAVE_DECL_ETH_FLAG_LRO {ETH_FLAG_LRO, VIR_NET_DEV_FEAT_LRO}, # endif -- 2.39.5