diff options
Diffstat (limited to 'chardev/spice.c')
-rw-r--r-- | chardev/spice.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chardev/spice.c b/chardev/spice.c index c2baeb5461..c68e60115b 100644 --- a/chardev/spice.c +++ b/chardev/spice.c @@ -208,6 +208,12 @@ static int spice_chr_write(Chardev *chr, const uint8_t *buf, int len) int read_bytes; assert(s->datalen == 0); + + if (!chr->be_open) { + trace_spice_chr_discard_write(len); + return len; + } + s->datapos = buf; s->datalen = len; spice_server_char_device_wakeup(&s->sin); @@ -300,6 +306,12 @@ static void qemu_chr_open_spice_vmc(Chardev *chr, } *be_opened = false; +#if SPICE_SERVER_VERSION < 0x000e02 + /* Spice < 0.14.2 doesn't explicitly open smartcard chardev */ + if (strcmp(type, "smartcard") == 0) { + *be_opened = true; + } +#endif chr_open(chr, type); } |