summaryrefslogtreecommitdiffstats
path: root/chardev
diff options
context:
space:
mode:
authorMarc-André Lureau2018-06-14 17:51:41 +0200
committerMarc-André Lureau2018-10-03 12:45:04 +0200
commit43182856c5a576f5db5f40768972a19f187a789e (patch)
treea62f957870dabbd5d49125990f97cc11d32c4788 /chardev
parentchardev: avoid crash if no associated address (diff)
downloadqemu-43182856c5a576f5db5f40768972a19f187a789e.tar.gz
qemu-43182856c5a576f5db5f40768972a19f187a789e.tar.xz
qemu-43182856c5a576f5db5f40768972a19f187a789e.zip
chardev: remove qemu_chr_fe_read_all() counter
There is no obvious reason to have a loop counter. This limits from reading several megabytes large buffers in one go, since socket read/write usually have a limit. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'chardev')
-rw-r--r--chardev/char-fe.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index b1f228e8b5..f158f158f8 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -56,7 +56,7 @@ int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len)
int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len)
{
Chardev *s = be->chr;
- int offset = 0, counter = 10;
+ int offset = 0;
int res;
if (!s || !CHARDEV_GET_CLASS(s)->chr_sync_read) {
@@ -88,10 +88,6 @@ int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len)
}
offset += res;
-
- if (!counter--) {
- break;
- }
}
if (qemu_chr_replay(s) && replay_mode == REPLAY_MODE_RECORD) {