Richard Henderson <richard.hender...@linaro.org> writes:
> On 5/23/19 6:25 AM, Alex Bennée wrote: >> int qemu_semihosting_log_out(const char *s, int len) >> { >> - return write(STDERR_FILENO, s, len); >> + Chardev *chardev = semihosting_get_chardev(); >> + if (chardev) { >> + return qemu_chr_write_all(chardev, (uint8_t *) s, len); >> + } else { >> + return write(STDERR_FILENO, s, len); >> + } >> } > > Can we not create a default chardev that outputs to stderr, so that the > conditional is not required? Or does that somehow interfere with how this > connects up for linux-user/? The one linux-user case does it's own thing which uses the same API but has a dumb implementation without a chardev. I'm unsure how you go about creating a plain chardev backend programatically although I'll probably want to do that for the plugins as well so I'll look into it. I'll merge this as is for now though. -- Alex Bennée