mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 02:24:51 +00:00
net/stream: skip automatic zero-init of large array
The 'net_stream_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-32-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 837b87c4c5)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
committed by
Stefan Hajnoczi
parent
645ad4d138
commit
9dfec5c0e6
@@ -148,7 +148,7 @@ static gboolean net_stream_send(QIOChannel *ioc,
|
||||
NetStreamState *s = data;
|
||||
int size;
|
||||
int ret;
|
||||
char buf1[NET_BUFSIZE];
|
||||
QEMU_UNINITIALIZED char buf1[NET_BUFSIZE];
|
||||
const char *buf;
|
||||
|
||||
size = qio_channel_read(s->ioc, buf1, sizeof(buf1), NULL);
|
||||
|
||||
Reference in New Issue
Block a user