From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3aNt-0002OB-EP for qemu-devel@nongnu.org; Thu, 19 May 2016 22:41:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3aNp-0002pE-7X for qemu-devel@nongnu.org; Thu, 19 May 2016 22:41:52 -0400 Received: from m12-17.163.com ([220.181.12.17]:42339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3aNo-0002lv-Kd for qemu-devel@nongnu.org; Thu, 19 May 2016 22:41:49 -0400 References: <1463629417-31330-1-git-send-email-zxq_yx_007@163.com> <67f81dc3-6cd0-fd15-177f-e0f0a8a5d3c1@redhat.com> From: xiaoqiang zhao Message-ID: <573E7948.2020006@163.com> Date: Fri, 20 May 2016 10:41:12 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4 0/4] QOM'ify hw/char devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: michael@walle.cc, Paolo Bonzini Cc: qemu-devel@nongnu.org, edgar.iglesias@gmail.com, agraf@suse.de, peter.maydell@linaro.org, Paolo Bonzini 在 2016年05月19日 21:45, michael@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. > > -michael Hi, michael: 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?