qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linux shell comes out to qemu-monitor when I enter anything. (I have


From: Peter Maydell
Subject: Re: linux shell comes out to qemu-monitor when I enter anything. (I have two uarts)
Date: Wed, 20 Jul 2022 11:44:02 +0100

On Wed, 20 Jul 2022 at 11:27, Chan Kim <ckim@etri.re.kr> wrote:
>
> Hello qemu experts,
>
> In my virtual machine I have two uart and I want to use the input/output in
> my host machine.
> For that I commented out these lines in qemu_chr_open_stdio function in
> chardev/char-stdio.c. (qemu-6.2.0)
>
> /*
> if (stdio_in_use) {
>         error_setg(errp, "cannot use stdio by multiple character devices");
>         return;
>     }
> */

Don't do that, there is a reason why that guard is there.
If you want multiple chardevs connecting to stdio you need to
multiplex them (otherwise, which one should input from the
terminal go to?).

> And used this option for stdio.
>
> -chardev stdio,mux=on,id=char0 -serial chardev:char0 -serial chardev:char0
>
> And two serial ports are generated and is multiplexed into stdio backend.
> Actually in the software on the virtual machine, the first uart is never
> written and only the second uart is written to. But the dtb contains two
> uarts so I had to generate two frontends anyway.

If you don't care about one of the UARTs, then just don't connect
a chardev to it (or equivalently, connect an instance of the
'null' chardev, which throws away anything sent to it).

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]