From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:40181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghBJp-0002e7-1I for qemu-devel@nongnu.org; Wed, 09 Jan 2019 05:42:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghBJn-0001Nl-4D for qemu-devel@nongnu.org; Wed, 09 Jan 2019 05:42:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51962) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghBJl-0001Kx-4d for qemu-devel@nongnu.org; Wed, 09 Jan 2019 05:42:39 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C6A72D7E9 for ; Wed, 9 Jan 2019 10:42:27 +0000 (UTC) Date: Wed, 9 Jan 2019 11:42:20 +0100 From: Cornelia Huck Message-ID: <20190109114220.1e2b4465.cohuck@redhat.com> In-Reply-To: <20190109102311.7635-1-marcandre.lureau@redhat.com> References: <20190109102311.7635-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qdev: fix -device scsi-hd,help regression List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau Cc: qemu-devel@nongnu.org, imammedo@redhat.com, ehabkost@redhat.com On Wed, 9 Jan 2019 14:23:11 +0400 Marc-Andr=C3=A9 Lureau wrote: > Since commit ea9ce8934, device_post_init() applies globals directly > from machines and accelerator classes. >=20 > There are cases, such as -device scsi-hd,help, where the machine is > setup but there in no accelerator. >=20 > Let's skip accelerator globals in this case. >=20 > Fixes SEGV: > #0 0x0000555558ea04ff in object_get_class (obj=3D0x0) at /home/elmarco/= src/qemu/build/../qom/object.c:857 > #1 0x000055555854c797 in object_apply_compat_props (obj=3D0x61600007898= 0) at /home/elmarco/src/qemu/build/../hw/core/qdev.c:978 > #2 0x000055555854c797 in object_apply_compat_props (obj=3D0x61600007898= 0) at /home/elmarco/src/qemu/build/../hw/core/qdev.c:973 > #3 0x000055555854c959 in device_post_init (obj=3D0x616000078980) at /ho= me/elmarco/src/qemu/build/../hw/core/qdev.c:989 > #4 0x0000555558e9e250 in object_post_init_with_type (ti=3D, obj=3D0x616000078980) at /home/elmarco/src/qemu/build/../qom/object.c:3= 65 > #5 0x0000555558e9e250 in object_initialize_with_type (data=3D0x61600007= 8980, size=3D616, type=3D) at /home/elmarco/src/qemu/build/.= ./qom/object.c:425 > #6 0x0000555558e9e571 in object_new_with_type (type=3D0x613000031900) a= t /home/elmarco/src/qemu/build/../qom/object.c:588 > #7 0x000055555830c048 in qmp_device_list_properties (typename=3Dtypenam= e@entry=3D0x60200000c2d0 "scsi-hd", errp=3Derrp@entry=3D0x7fffffffc540) at = /home/elmarco/src/qemu/qmp.c:519 > #8 0x00005555582c4027 in qdev_device_help (opts=3D) at /= home/elmarco/src/qemu/qdev-monitor.c:283 > #9 0x0000555559378fa2 in qemu_opts_foreach (list=3D, fun= c=3Dfunc@entry=3D0x5555582cfca0 , opaque=3Dopaque@entry= =3D0x0, errp=3Derrp@entry=3D0x0) at /home/elmarco/src/qemu/util/qemu-option= .c:1171 >=20 > https://bugzilla.redhat.com/show_bug.cgi?id=3D1664364 >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > hw/core/qdev.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) Reviewed-by: Cornelia Huck