Revision fa5efccb

b/console.c
1130 1130
        if (len > sizeof(buf))
1131 1131
            len = sizeof(buf);
1132 1132
        qemu_fifo_read(&s->out_fifo, buf, len);
1133
        qemu_chr_read(s->chr, buf, len);
1133
        qemu_chr_be_write(s->chr, buf, len);
1134 1134
    }
1135 1135
    /* characters are pending: we send them a bit later (XXX:
1136 1136
       horrible, should change char device API) */
b/gdbstub.c
2194 2194
            hextomem(mem_buf, p + 5, len);
2195 2195
            len = len / 2;
2196 2196
            mem_buf[len++] = 0;
2197
            qemu_chr_read(s->mon_chr, mem_buf, len);
2197
            qemu_chr_be_write(s->mon_chr, mem_buf, len);
2198 2198
            put_packet(s, "OK");
2199 2199
            break;
2200 2200
        }
b/hw/baum.c
231 231

  
232 232
    first = BUF_SIZE - baum->out_buf_ptr;
233 233
    if (room > first) {
234
        qemu_chr_read(chr, baum->out_buf + baum->out_buf_ptr, first);
234
        qemu_chr_be_write(chr, baum->out_buf + baum->out_buf_ptr, first);
235 235
        baum->out_buf_ptr = 0;
236 236
        baum->out_buf_used -= first;
237 237
        room -= first;
238 238
    }
239
    qemu_chr_read(chr, baum->out_buf + baum->out_buf_ptr, room);
239
    qemu_chr_be_write(chr, baum->out_buf + baum->out_buf_ptr, room);
240 240
    baum->out_buf_ptr += room;
241 241
    baum->out_buf_used -= room;
242 242
}
......
254 254
    len = cur - io_buf;
255 255
    if (len <= room) {
256 256
        /* Fits */
257
        qemu_chr_read(baum->chr, io_buf, len);
257
        qemu_chr_be_write(baum->chr, io_buf, len);
258 258
    } else {
259 259
        int first;
260 260
        uint8_t out;
261 261
        /* Can't fit all, send what can be, and store the rest. */
262
        qemu_chr_read(baum->chr, io_buf, room);
262
        qemu_chr_be_write(baum->chr, io_buf, room);
263 263
        len -= room;
264 264
        cur = io_buf + room;
265 265
        if (len > BUF_SIZE - baum->out_buf_used) {
b/hw/msmouse.c
50 50
    /* We always send the packet of, so that we do not have to keep track
51 51
       of previous state of the middle button. This can potentially confuse
52 52
       some very old drivers for two button mice though. */
53
    qemu_chr_read(chr, bytes, 4);
53
    qemu_chr_be_write(chr, bytes, 4);
54 54
}
55 55

  
56 56
static int msmouse_chr_write (struct CharDriverState *s, const uint8_t *buf, int len)
b/qemu-char.c
158 158
    return s->chr_can_read(s->handler_opaque);
159 159
}
160 160

  
161
void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len)
161
void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
162 162
{
163 163
    s->chr_read(s->handler_opaque, buf, len);
164 164
}
......
589 589
        return;
590 590
    }
591 591
    if (size > 0) {
592
        qemu_chr_read(chr, buf, size);
592
        qemu_chr_be_write(chr, buf, size);
593 593
    }
594 594
}
595 595

  
......
700 700

  
701 701
    /* try to flush the queue if needed */
702 702
    if (term_fifo_size != 0 && qemu_chr_can_read(chr) > 0) {
703
        qemu_chr_read(chr, term_fifo, 1);
703
        qemu_chr_be_write(chr, term_fifo, 1);
704 704
        term_fifo_size = 0;
705 705
    }
706 706
    /* see if we can absorb more chars */
......
725 725
    }
726 726
    if (size > 0) {
727 727
        if (qemu_chr_can_read(chr) > 0) {
728
            qemu_chr_read(chr, buf, 1);
728
            qemu_chr_be_write(chr, buf, 1);
729 729
        } else if (term_fifo_size == 0) {
730 730
            term_fifo[term_fifo_size++] = buf[0];
731 731
        }
......
914 914
    }
915 915
    if (size > 0) {
916 916
        pty_chr_state(chr, 1);
917
        qemu_chr_read(chr, buf, size);
917
        qemu_chr_be_write(chr, buf, size);
918 918
    }
919 919
}
920 920

  
......
1624 1624
    }
1625 1625

  
1626 1626
    if (size > 0) {
1627
        qemu_chr_read(chr, buf, size);
1627
        qemu_chr_be_write(chr, buf, size);
1628 1628
    }
1629 1629
}
1630 1630

  
......
1846 1846
     * first
1847 1847
     */
1848 1848
    while (s->max_size > 0 && s->bufptr < s->bufcnt) {
1849
        qemu_chr_read(chr, &s->buf[s->bufptr], 1);
1849
        qemu_chr_be_write(chr, &s->buf[s->bufptr], 1);
1850 1850
        s->bufptr++;
1851 1851
        s->max_size = qemu_chr_can_read(chr);
1852 1852
    }
......
1867 1867

  
1868 1868
    s->bufptr = 0;
1869 1869
    while (s->max_size > 0 && s->bufptr < s->bufcnt) {
1870
        qemu_chr_read(chr, &s->buf[s->bufptr], 1);
1870
        qemu_chr_be_write(chr, &s->buf[s->bufptr], 1);
1871 1871
        s->bufptr++;
1872 1872
        s->max_size = qemu_chr_can_read(chr);
1873 1873
    }
......
2109 2109
        if (s->do_telnetopt)
2110 2110
            tcp_chr_process_IAC_bytes(chr, s, buf, &size);
2111 2111
        if (size > 0)
2112
            qemu_chr_read(chr, buf, size);
2112
            qemu_chr_be_write(chr, buf, size);
2113 2113
    }
2114 2114
}
2115 2115

  
b/qemu-char.h
97 97
int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg);
98 98
void qemu_chr_generic_open(CharDriverState *s);
99 99
int qemu_chr_can_read(CharDriverState *s);
100
void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len);
100
void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len);
101 101
int qemu_chr_get_msgfd(CharDriverState *s);
102 102
void qemu_chr_accept_input(CharDriverState *s);
103 103
int qemu_chr_add_client(CharDriverState *s, int fd);
b/spice-qemu-char.c
39 39
        if (qemu_chr_can_read(scd->chr) < last_out) {
40 40
            break;
41 41
        }
42
        qemu_chr_read(scd->chr, p, last_out);
42
        qemu_chr_be_write(scd->chr, p, last_out);
43 43
        out += last_out;
44 44
        len -= last_out;
45 45
        p += last_out;

Also available in: Unified diff