mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
Drop qemu_foo() socket API wrapper
The socket API wrappers were initially introduced in commit00aa0040
("Wrap recv to avoid warnings"), but made redundant with commita2d96af4
("osdep: add wrappers for socket functions") which fixes the win32 declarations and thus removed the earlier warnings. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
8ef2513d87
commit
e7b7942822
15 changed files with 45 additions and 64 deletions
24
net/socket.c
24
net/socket.c
|
@ -120,9 +120,9 @@ static ssize_t net_socket_receive_dgram(NetClientState *nc, const uint8_t *buf,
|
|||
|
||||
do {
|
||||
if (s->dgram_dst.sin_family != AF_UNIX) {
|
||||
ret = qemu_sendto(s->fd, buf, size, 0,
|
||||
(struct sockaddr *)&s->dgram_dst,
|
||||
sizeof(s->dgram_dst));
|
||||
ret = sendto(s->fd, buf, size, 0,
|
||||
(struct sockaddr *)&s->dgram_dst,
|
||||
sizeof(s->dgram_dst));
|
||||
} else {
|
||||
ret = send(s->fd, buf, size, 0);
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ static void net_socket_send(void *opaque)
|
|||
uint8_t buf1[NET_BUFSIZE];
|
||||
const uint8_t *buf;
|
||||
|
||||
size = qemu_recv(s->fd, buf1, sizeof(buf1), 0);
|
||||
size = recv(s->fd, buf1, sizeof(buf1), 0);
|
||||
if (size < 0) {
|
||||
if (errno != EWOULDBLOCK)
|
||||
goto eoc;
|
||||
|
@ -198,7 +198,7 @@ static void net_socket_send_dgram(void *opaque)
|
|||
NetSocketState *s = opaque;
|
||||
int size;
|
||||
|
||||
size = qemu_recv(s->fd, s->rs.buf, sizeof(s->rs.buf), 0);
|
||||
size = recv(s->fd, s->rs.buf, sizeof(s->rs.buf), 0);
|
||||
if (size < 0)
|
||||
return;
|
||||
if (size == 0) {
|
||||
|
@ -246,7 +246,7 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr,
|
|||
* only on posix systems.
|
||||
*/
|
||||
val = 1;
|
||||
ret = qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val));
|
||||
ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val));
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, errno,
|
||||
"can't set socket option SO_REUSEADDR");
|
||||
|
@ -268,8 +268,8 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr,
|
|||
imr.imr_interface.s_addr = htonl(INADDR_ANY);
|
||||
}
|
||||
|
||||
ret = qemu_setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
||||
&imr, sizeof(struct ip_mreq));
|
||||
ret = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
||||
&imr, sizeof(struct ip_mreq));
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, errno,
|
||||
"can't add socket to multicast group %s",
|
||||
|
@ -279,8 +279,8 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr,
|
|||
|
||||
/* Force mcast msgs to loopback (eg. several QEMUs in same host */
|
||||
loop = 1;
|
||||
ret = qemu_setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
|
||||
&loop, sizeof(loop));
|
||||
ret = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
|
||||
&loop, sizeof(loop));
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, errno,
|
||||
"can't force multicast message to loopback");
|
||||
|
@ -289,8 +289,8 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr,
|
|||
|
||||
/* If a bind address is given, only send packets from that address */
|
||||
if (localaddr != NULL) {
|
||||
ret = qemu_setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
|
||||
localaddr, sizeof(*localaddr));
|
||||
ret = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
|
||||
localaddr, sizeof(*localaddr));
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, errno,
|
||||
"can't set the default network send interface");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue