提交 e96dfd11 编写于 作者: V Vincenzo Maffione 提交者: Stefan Hajnoczi

net: change vnet-hdr TAP prototypes

The tap_has_vnet_hdr() and tap_has_vnet_hdr_len() functions used
to return int, even though they only return true/false values.
This patch changes the prototypes to return bool.
Signed-off-by: NVincenzo Maffione <v.maffione@gmail.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 6e50d188
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "qapi-types.h" #include "qapi-types.h"
bool tap_has_ufo(NetClientState *nc); bool tap_has_ufo(NetClientState *nc);
int tap_has_vnet_hdr(NetClientState *nc); bool tap_has_vnet_hdr(NetClientState *nc);
int tap_has_vnet_hdr_len(NetClientState *nc, int len); bool tap_has_vnet_hdr_len(NetClientState *nc, int len);
void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr); void tap_using_vnet_hdr(NetClientState *nc, bool using_vnet_hdr);
void tap_set_offload(NetClientState *nc, int csum, int tso4, int tso6, int ecn, int ufo); void tap_set_offload(NetClientState *nc, int csum, int tso4, int tso6, int ecn, int ufo);
void tap_set_vnet_hdr_len(NetClientState *nc, int len); void tap_set_vnet_hdr_len(NetClientState *nc, int len);
......
...@@ -727,9 +727,9 @@ bool tap_has_ufo(NetClientState *nc) ...@@ -727,9 +727,9 @@ bool tap_has_ufo(NetClientState *nc)
return false; return false;
} }
int tap_has_vnet_hdr(NetClientState *nc) bool tap_has_vnet_hdr(NetClientState *nc)
{ {
return 0; return false;
} }
int tap_probe_vnet_hdr_len(int fd, int len) int tap_probe_vnet_hdr_len(int fd, int len)
...@@ -755,9 +755,9 @@ struct vhost_net *tap_get_vhost_net(NetClientState *nc) ...@@ -755,9 +755,9 @@ struct vhost_net *tap_get_vhost_net(NetClientState *nc)
return NULL; return NULL;
} }
int tap_has_vnet_hdr_len(NetClientState *nc, int len) bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
{ {
return 0; return false;
} }
void tap_set_vnet_hdr_len(NetClientState *nc, int len) void tap_set_vnet_hdr_len(NetClientState *nc, int len)
......
...@@ -219,7 +219,7 @@ bool tap_has_ufo(NetClientState *nc) ...@@ -219,7 +219,7 @@ bool tap_has_ufo(NetClientState *nc)
return s->has_ufo; return s->has_ufo;
} }
int tap_has_vnet_hdr(NetClientState *nc) bool tap_has_vnet_hdr(NetClientState *nc)
{ {
TAPState *s = DO_UPCAST(TAPState, nc, nc); TAPState *s = DO_UPCAST(TAPState, nc, nc);
...@@ -228,13 +228,13 @@ int tap_has_vnet_hdr(NetClientState *nc) ...@@ -228,13 +228,13 @@ int tap_has_vnet_hdr(NetClientState *nc)
return !!s->host_vnet_hdr_len; return !!s->host_vnet_hdr_len;
} }
int tap_has_vnet_hdr_len(NetClientState *nc, int len) bool tap_has_vnet_hdr_len(NetClientState *nc, int len)
{ {
TAPState *s = DO_UPCAST(TAPState, nc, nc); TAPState *s = DO_UPCAST(TAPState, nc, nc);
assert(nc->info->type == NET_CLIENT_OPTIONS_KIND_TAP); assert(nc->info->type == NET_CLIENT_OPTIONS_KIND_TAP);
return tap_probe_vnet_hdr_len(s->fd, len); return !!tap_probe_vnet_hdr_len(s->fd, len);
} }
void tap_set_vnet_hdr_len(NetClientState *nc, int len) void tap_set_vnet_hdr_len(NetClientState *nc, int len)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册