VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
ssize_t ret;
+ if (!vcon->chr) {
+ /* If there's no backend, we can just say we consumed all data. */
+ return len;
+ }
+
ret = qemu_chr_fe_write(vcon->chr, buf, len);
trace_virtio_console_flush_buf(port->id, len, ret);
{
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
+ if (!vcon->chr) {
+ return;
+ }
qemu_chr_fe_open(vcon->chr);
}
{
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
+ if (!vcon->chr) {
+ return;
+ }
qemu_chr_fe_close(vcon->chr);
}