[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/65] slirp: remove the disabled readv()/writev() co
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 18/65] slirp: remove the disabled readv()/writev() code path |
Date: |
Mon, 14 Jan 2019 23:52:19 +0100 |
From: Marc-André Lureau <address@hidden>
The soread() function may be used on datagram sockets, and would
provide different behaviour if HAVE_READV was set, on empty datagrams.
This looks like a minor optimization, that never has been a strong
goal for slirp.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
slirp/slirp_config.h | 3 ---
slirp/socket.c | 15 ---------------
2 files changed, 18 deletions(-)
diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h
index f0cc1c781b..3ce64e088e 100644
--- a/slirp/slirp_config.h
+++ b/slirp/slirp_config.h
@@ -29,9 +29,6 @@
/* Define if the machine is big endian */
//#undef HOST_WORDS_BIGENDIAN
-/* Define if you have readv */
-#undef HAVE_READV
-
/* Define if iovec needs to be declared */
#undef DECLARE_IOVEC
#ifdef _WIN32
diff --git a/slirp/socket.c b/slirp/socket.c
index 041ec5061a..7012c7c07d 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -187,12 +187,7 @@ soread(struct socket *so)
*/
sopreprbuf(so, iov, &n);
-#ifdef HAVE_READV
- nn = readv(so->s, (struct iovec *)iov, n);
- DEBUG_MISC((dfd, " ... read nn = %d bytes\n", nn));
-#else
nn = qemu_recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
-#endif
if (nn <= 0) {
if (nn < 0 && (errno == EINTR || errno == EAGAIN))
return 0;
@@ -226,7 +221,6 @@ soread(struct socket *so)
}
}
-#ifndef HAVE_READV
/*
* If there was no error, try and read the second time round
* We read again if n = 2 (ie, there's another part of the buffer)
@@ -244,7 +238,6 @@ soread(struct socket *so)
}
DEBUG_MISC((dfd, " ... read nn = %d bytes\n", nn));
-#endif
/* Update fields */
sb->sb_cc += nn;
@@ -452,13 +445,7 @@ sowrite(struct socket *so)
}
/* Check if there's urgent data to send, and if so, send it */
-#ifdef HAVE_READV
- nn = writev(so->s, (const struct iovec *)iov, n);
-
- DEBUG_MISC((dfd, " ... wrote nn = %d bytes\n", nn));
-#else
nn = slirp_send(so, iov[0].iov_base, iov[0].iov_len,0);
-#endif
/* This should never happen, but people tell me it does *shrug* */
if (nn < 0 && (errno == EAGAIN || errno == EINTR))
return 0;
@@ -467,7 +454,6 @@ sowrite(struct socket *so)
goto err_disconnected;
}
-#ifndef HAVE_READV
if (n == 2 && nn == iov[0].iov_len) {
int ret;
ret = slirp_send(so, iov[1].iov_base, iov[1].iov_len,0);
@@ -475,7 +461,6 @@ sowrite(struct socket *so)
nn += ret;
}
DEBUG_MISC((dfd, " ... wrote nn = %d bytes\n", nn));
-#endif
/* Update sbuf */
sb->sb_cc -= nn;
--
2.20.1
- [Qemu-devel] [PULL 19/65] slirp: remove HAVE_SYS_SIGNAL_H, (continued)
- [Qemu-devel] [PULL 19/65] slirp: remove HAVE_SYS_SIGNAL_H, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 15/65] slirp: use a callback structure to interface with qemu, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 16/65] slirp: remove PROBE_CONN dead-code, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 03/65] slirp: replace ex_pty with ex_chardev, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 10/65] slirp: replace the poor-man string split with g_strsplit(), Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 11/65] slirp: remove dead declarations, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 07/65] slirp: move internal function declarations, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 21/65] slirp: remove NO_UNIX_SOCKETS, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 22/65] slirp: remove unused HAVE_SYS_STROPTS_H, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 30/65] slirp: replace HOST_WORDS_BIGENDIAN with glib equivalent, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 18/65] slirp: remove the disabled readv()/writev() code path,
Samuel Thibault <=
- [Qemu-devel] [PULL 17/65] slirp: remove FULL_BOLT, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 08/65] slirp: remove Monitor dependency, return a string for info, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 25/65] slirp: remove unused HAVE_SYS_SELECT_H, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 23/65] slirp: remove unused HAVE_ARPA_INET_H, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 28/65] slirp: remove unused DECLARE_IOVEC, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 24/65] slirp: remove unused HAVE_SYS_WAIT_H, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 26/65] slirp: remove HAVE_SYS_IOCTL_H, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 29/65] slirp: remove unused HAVE_INET_ATON, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 27/65] slirp: remove HAVE_SYS_FILIO_H, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 33/65] slirp: remove unused global slirp_instance, Samuel Thibault, 2019/01/14