Skip to content

Commit

Permalink
net/tap: Replace tap-haiku.c and tap-aix.c by a generic tap-stub.c
Browse files Browse the repository at this point in the history
The files tap-haiku.c and tap-aix.c are identical (except one line
of error message). We should avoid such code duplication, so replace
these by a generic tap-stub.c file instead.

Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
  • Loading branch information
huth authored and jasowang committed May 23, 2017
1 parent 5682155 commit 4348300
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 96 deletions.
15 changes: 8 additions & 7 deletions net/Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ common-obj-y += socket.o
common-obj-y += dump.o
common-obj-y += eth.o
common-obj-$(CONFIG_L2TPV3) += l2tpv3.o
common-obj-$(CONFIG_POSIX) += tap.o vhost-user.o
common-obj-$(CONFIG_LINUX) += tap-linux.o
common-obj-$(CONFIG_WIN32) += tap-win32.o
common-obj-$(CONFIG_BSD) += tap-bsd.o
common-obj-$(CONFIG_SOLARIS) += tap-solaris.o
common-obj-$(CONFIG_AIX) += tap-aix.o
common-obj-$(CONFIG_HAIKU) += tap-haiku.o
common-obj-$(CONFIG_POSIX) += vhost-user.o
common-obj-$(CONFIG_SLIRP) += slirp.o
common-obj-$(CONFIG_VDE) += vde.o
common-obj-$(CONFIG_NETMAP) += netmap.o
Expand All @@ -20,3 +14,10 @@ common-obj-y += colo-compare.o
common-obj-y += colo.o
common-obj-y += filter-rewriter.o
common-obj-y += filter-replay.o

tap-obj-$(CONFIG_LINUX) = tap-linux.o
tap-obj-$(CONFIG_BSD) = tap-bsd.o
tap-obj-$(CONFIG_SOLARIS) = tap-solaris.o
tap-obj-y ?= tap-stub.o
common-obj-$(CONFIG_POSIX) += tap.o $(tap-obj-y)
common-obj-$(CONFIG_WIN32) += tap-win32.o
87 changes: 0 additions & 87 deletions net/tap-haiku.c

This file was deleted.

3 changes: 1 addition & 2 deletions net/tap-aix.c → net/tap-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
int vnet_hdr_required, int mq_required, Error **errp)
{
error_setg(errp, "no tap on AIX");
error_setg(errp, "tap is not supported in this build");
return -1;
}

Expand Down Expand Up @@ -85,4 +85,3 @@ int tap_fd_get_ifname(int fd, char *ifname)
{
return -1;
}

0 comments on commit 4348300

Please sign in to comment.