On 20/05/2016 16:52, Markus Armbruster wrote: > xiaoqiang zhao <zxq_yx_...@163.com> writes: > >> 在 2016年05月19日 21:45, mich...@walle.cc 写道: >>> Am 2016-05-19 13:32, schrieb Paolo Bonzini: >>>> Michael, can you test patches 3 and 4? >>> >>> Doesn't work for me: >>> $ qemu-system-lm32 -kernel serial.bin -serial vc -serial vc >>> Unexpected error in parse_chr() at >>> /home/mwalle/repos/qemu/hw/core/qdev-properties-system.c:149: >>> qemu-system-lm32: Property 'lm32-uart.chardev' can't take value >>> 'serial0', it's in use >>> >>> serial0 seems already be claimed. Please note that even >>> $ qemu-system-lm32 -kernel serial.bin >>> and >>> $ qemu-system-lm32 >>> does not work. >>> >>> "-serial .. -serial --" should still work, shouldn't it? >>> >>> I've uploaded a small test binary to >>> http://milkymist.walle.cc/tests/ which should prints 'A' and 'U' >>> characters on the UARTs. >> >> It seems that qemu_char_get_next_serial() call the qemu_chr_fe_claim, >> which is also called by >> qdev_prop_set_chr ! This cause chr->avail_connectinos less than 1. as >> the error message said: >> "it's in use". >> A stright fix is to call the qemu_chr_fe_release after >> qemu_char_get_next_serial and the call the >> qdev_prop_set_chr, the error is gone! I have test with your test cases >> and it works. >> >> Or another way, can we modify qemu_char_get_next_serial and just skip >> the call of qemu_chr_fe_claim? > > Uh, how come qemu_char_get_next_serial() gets called? > QOMified/qdevified devices should never call it.
It's called by the board. Paolo