aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2025-06-10 13:37:08 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2025-06-12 13:40:16 -0400
commit751b0e79f1e0e7f88fad2fe2f22595ad03d78859 (patch)
tree3cc387fec61b6c488af59c8717aa015af9c7f475
parent7708e298180550eac262c1fd742e6e80c711a5d8 (diff)
downloadqemu-751b0e79f1e0e7f88fad2fe2f22595ad03d78859.zip
qemu-751b0e79f1e0e7f88fad2fe2f22595ad03d78859.tar.gz
qemu-751b0e79f1e0e7f88fad2fe2f22595ad03d78859.tar.bz2
net/socket: skip automatic zero-init of large array
The 'net_socket_send' method has a 68k byte array used for copying data between guest and host. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path. The 'buf1' array will be fully initialized when reading data off the network socket. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Message-id: 20250610123709.835102-31-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--net/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c
index 8e3702e..784dda6 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -157,7 +157,7 @@ static void net_socket_send(void *opaque)
NetSocketState *s = opaque;
int size;
int ret;
- uint8_t buf1[NET_BUFSIZE];
+ QEMU_UNINITIALIZED uint8_t buf1[NET_BUFSIZE];
const uint8_t *buf;
size = recv(s->fd, buf1, sizeof(buf1), 0);