]> xenbits.xensource.com Git - libvirt.git/commitdiff
virnetdevtap: Don't check for flags in virNetDevTapCreateFlags
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 30 Mar 2012 11:37:13 +0000 (13:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 30 Mar 2012 13:28:59 +0000 (15:28 +0200)
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
src/util/virnetdevtap.c

diff --git a/cfg.mk b/cfg.mk
index ade869086d063d5fcdfeafc24fa6192375791b69..bf7274f01d55767f5a6aa5e4cc1a376d046e5b70 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -747,7 +747,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$$
index 717b6ac6b89dc0069e36c1adee0e294ef6077e6c..0b3ac4618315be2229d2106e1ffffa4aac6fc41b 100644 (file)
@@ -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?"));
@@ -239,9 +237,8 @@ cleanup:
 #else /* ! TUNSETIFF */
 int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED,
                        int *tapfd ATTRIBUTE_UNUSED,
-                       unsigned int flags)
+                       unsigned int flags ATTRIBUTE_UNUSED)
 {
-    virCheckFlags(0, -1);
     virReportSystemError(ENOSYS, "%s",
                          _("Unable to create TAP devices on this platform"));
     return -1;