[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] virnetdevtap: Don't check for flags in virNetDevTapCreateFlags



With latest gnulib we are checking even the lowest level functions
whether they check flags. Moreover, we are shadowing the real error
on system without TUNSETIFF support.
---
 cfg.mk                  |    2 +-
 src/util/virnetdevtap.c |    5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index c3de533..d44c8d2 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -741,7 +741,7 @@ exclude_file_name_regexp--sc_avoid_write = \
 
 exclude_file_name_regexp--sc_bindtextdomain = ^(tests|examples)/
 
-exclude_file_name_regexp--sc_flags_usage = ^docs/
+exclude_file_name_regexp--sc_flags_usage = ^(docs/|src/util/virnetdevtap\.c$$)
 
 exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
   ^src/rpc/gendispatch\.pl$$
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 717b6ac..54f76bd 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -129,14 +129,12 @@ virNetDevProbeVnetHdr(int tapfd)
  */
 int virNetDevTapCreate(char **ifname,
                        int *tapfd,
-                       unsigned int flags)
+                       unsigned int flags ATTRIBUTE_UNUSED)
 {
     int fd;
     struct ifreq ifr;
     int ret = -1;
 
-    virCheckFlags(VIR_NETDEV_TAP_CREATE_VNET_HDR, -1);
-
     if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
         virReportSystemError(errno, "%s",
                              _("Unable to open /dev/net/tun, is tun module loaded?"));
@@ -241,7 +239,6 @@ int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED,
                        int *tapfd ATTRIBUTE_UNUSED,
                        unsigned int flags)
 {
-    virCheckFlags(0, -1);
     virReportSystemError(ENOSYS, "%s",
                          _("Unable to create TAP devices on this platform"));
     return -1;
-- 
1.7.8.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]