Revision 9bd7854e qemu-char.c

b/qemu-char.c
97 97

  
98 98
#include "qemu_socket.h"
99 99

  
100
#define READ_BUF_LEN 4096
101

  
100 102
/***********************************************************/
101 103
/* character device */
102 104

  
......
172 174

  
173 175
void qemu_chr_printf(CharDriverState *s, const char *fmt, ...)
174 176
{
175
    char buf[4096];
177
    char buf[READ_BUF_LEN];
176 178
    va_list ap;
177 179
    va_start(ap, fmt);
178 180
    vsnprintf(buf, sizeof(buf), fmt, ap);
......
555 557
    CharDriverState *chr = opaque;
556 558
    FDCharDriver *s = chr->opaque;
557 559
    int size, len;
558
    uint8_t buf[1024];
560
    uint8_t buf[READ_BUF_LEN];
559 561

  
560 562
    len = sizeof(buf);
561 563
    if (len > s->max_size)
......
866 868
    CharDriverState *chr = opaque;
867 869
    PtyCharDriver *s = chr->opaque;
868 870
    int size, len;
869
    uint8_t buf[1024];
871
    uint8_t buf[READ_BUF_LEN];
870 872

  
871 873
    len = sizeof(buf);
872 874
    if (len > s->read_bytes)
......
1554 1556
{
1555 1557
    WinCharState *s = chr->opaque;
1556 1558
    int ret, err;
1557
    uint8_t buf[1024];
1559
    uint8_t buf[READ_BUF_LEN];
1558 1560
    DWORD size;
1559 1561

  
1560 1562
    ZeroMemory(&s->orecv, sizeof(s->orecv));
......
1760 1762

  
1761 1763
typedef struct {
1762 1764
    int fd;
1763
    uint8_t buf[1024];
1765
    uint8_t buf[READ_BUF_LEN];
1764 1766
    int bufcnt;
1765 1767
    int bufptr;
1766 1768
    int max_size;
......
2020 2022
{
2021 2023
    CharDriverState *chr = opaque;
2022 2024
    TCPCharDriver *s = chr->opaque;
2023
    uint8_t buf[1024];
2025
    uint8_t buf[READ_BUF_LEN];
2024 2026
    int len, size;
2025 2027

  
2026 2028
    if (!s->connected || s->max_size <= 0)

Also available in: Unified diff