return s->chr_ioctl(s, cmd, arg);
}
-int qemu_chr_can_read(CharDriverState *s)
+int qemu_chr_be_can_write(CharDriverState *s)
{
if (!s->chr_can_read)
return 0;
CharDriverState *chr = opaque;
FDCharDriver *s = chr->opaque;
- s->max_size = qemu_chr_can_read(chr);
+ s->max_size = qemu_chr_be_can_write(chr);
return s->max_size;
}
CharDriverState *chr = opaque;
/* try to flush the queue if needed */
- if (term_fifo_size != 0 && qemu_chr_can_read(chr) > 0) {
+ if (term_fifo_size != 0 && qemu_chr_be_can_write(chr) > 0) {
qemu_chr_be_write(chr, term_fifo, 1);
term_fifo_size = 0;
}
return;
}
if (size > 0) {
- if (qemu_chr_can_read(chr) > 0) {
+ if (qemu_chr_be_can_write(chr) > 0) {
qemu_chr_be_write(chr, buf, 1);
} else if (term_fifo_size == 0) {
term_fifo[term_fifo_size++] = buf[0];
CharDriverState *chr = opaque;
PtyCharDriver *s = chr->opaque;
- s->read_bytes = qemu_chr_can_read(chr);
+ s->read_bytes = qemu_chr_be_can_write(chr);
return s->read_bytes;
}
{
WinCharState *s = chr->opaque;
- s->max_size = qemu_chr_can_read(chr);
+ s->max_size = qemu_chr_be_can_write(chr);
return s->max_size;
}
CharDriverState *chr = opaque;
NetCharDriver *s = chr->opaque;
- s->max_size = qemu_chr_can_read(chr);
+ s->max_size = qemu_chr_be_can_write(chr);
/* If there were any stray characters in the queue process them
* first
while (s->max_size > 0 && s->bufptr < s->bufcnt) {
qemu_chr_be_write(chr, &s->buf[s->bufptr], 1);
s->bufptr++;
- s->max_size = qemu_chr_can_read(chr);
+ s->max_size = qemu_chr_be_can_write(chr);
}
return s->max_size;
}
while (s->max_size > 0 && s->bufptr < s->bufcnt) {
qemu_chr_be_write(chr, &s->buf[s->bufptr], 1);
s->bufptr++;
- s->max_size = qemu_chr_can_read(chr);
+ s->max_size = qemu_chr_be_can_write(chr);
}
}
TCPCharDriver *s = chr->opaque;
if (!s->connected)
return 0;
- s->max_size = qemu_chr_can_read(chr);
+ s->max_size = qemu_chr_be_can_write(chr);
return s->max_size;
}
void *opaque);
int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg);
void qemu_chr_generic_open(CharDriverState *s);
-int qemu_chr_can_read(CharDriverState *s);
+int qemu_chr_be_can_write(CharDriverState *s);
void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len);
int qemu_chr_get_msgfd(CharDriverState *s);
void qemu_chr_accept_input(CharDriverState *s);