mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-07 14:59:10 +00:00
s390/sclpconsole: prevent char layer callback during initialization
Starting a qemu with an sclp console and pressing a key very early can result in "qemu-system-s390x: hw/s390x/sclpconsole.c:60: receive_from_chr_layer: Assertion `scon->iov' failed." Lets make sure that the init process is finished, since the iov is allocated after CHR_EVENT_OPENED by also checking for scon->iov. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
7ce4106c21
commit
760794f784
@ -44,12 +44,9 @@ typedef struct SCLPConsole {
|
|||||||
/* Return number of bytes that fit into iov buffer */
|
/* Return number of bytes that fit into iov buffer */
|
||||||
static int chr_can_read(void *opaque)
|
static int chr_can_read(void *opaque)
|
||||||
{
|
{
|
||||||
int can_read;
|
|
||||||
SCLPConsole *scon = opaque;
|
SCLPConsole *scon = opaque;
|
||||||
|
|
||||||
can_read = SIZE_BUFFER_VT220 - scon->iov_data_len;
|
return scon->iov ? SIZE_BUFFER_VT220 - scon->iov_data_len : 0;
|
||||||
|
|
||||||
return can_read;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Receive n bytes from character layer, save in iov buffer,
|
/* Receive n bytes from character layer, save in iov buffer,
|
||||||
|
Loading…
Reference in New Issue
Block a user