From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk9o4-0001wM-FQ for qemu-devel@nongnu.org; Tue, 22 Aug 2017 10:05:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dk9ny-0000s5-Os for qemu-devel@nongnu.org; Tue, 22 Aug 2017 10:05:24 -0400 References: <1503407712-9894-1-git-send-email-thuth@redhat.com> From: Thomas Huth Message-ID: <8fb75274-09a6-dbd3-5dba-1069d790b689@redhat.com> Date: Tue, 22 Aug 2017 16:05:02 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/arm/digic: Mark device with user_creatable = false List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-arm , QEMU Developers , Antony Pavlov On 22.08.2017 15:52, Peter Maydell wrote: > On 22 August 2017 at 14:15, Thomas Huth wrote: >> QEMU currently hangs completely when the user is trying to do a >> "device_add digic" on an unrelated ARM machine like integratorcp. >> Looks like this device is not meant to be hot-pluggable at all, so >> let's simply mark it with "user_creatable = false" to avoid the hang. >> >> Signed-off-by: Thomas Huth >> --- >> hw/arm/digic.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/hw/arm/digic.c b/hw/arm/digic.c >> index 94f3263..208dfb3 100644 >> --- a/hw/arm/digic.c >> +++ b/hw/arm/digic.c >> @@ -101,6 +101,8 @@ static void digic_class_init(ObjectClass *oc, void *data) >> DeviceClass *dc = DEVICE_CLASS(oc); >> >> dc->realize = digic_realize; >> + /* Reason: Hangs QEMU when trying to device_add this directly */ >> + dc->user_creatable = false; >> } > > Maybe "uses serial_hds[]" is a better reason, or does it hang for > some other reason? When I kill the hanging QEMU, the stack trace looks like this: #0 0x00007ffff13afaff in ppoll () at /lib64/libc.so.6 #1 0x0000555555bb3179 in qemu_poll_ns (__ss=0x0, __timeout=0x7fffffffda60, __nfds=, __fds=) at /usr/include/bits/poll2.h:77 #2 0x0000555555bb3179 in qemu_poll_ns (fds=, nfds=, timeout=timeout@entry=1000000000) at /home/thuth/devel/qemu/util/qemu-timer.c:334 #3 0x0000555555bb3f88 in main_loop_wait (timeout=1000000000) at /home/thuth/devel/qemu/util/main-loop.c:255 #4 0x0000555555bb3f88 in main_loop_wait (nonblocking=nonblocking@entry=0) at /home/thuth/devel/qemu/util/main-loop.c:515 #5 0x000055555578d927 in main () at /home/thuth/devel/qemu/vl.c:1917 #6 0x000055555578d927 in main (argc=, argv=, envp=) at /home/thuth/devel/qemu/vl.c:4791 I haven't investigated any further, but the usage of serial_hds in the realize function could certainly be the reason. At least it certainly is a reason that this device should not be creatable by the user - so let me send a v2 with the comment changed accordingly. Thomas