From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbwTw-0006L9-W6 for qemu-devel@nongnu.org; Fri, 23 Nov 2012 11:52:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbwTt-00016z-1T for qemu-devel@nongnu.org; Fri, 23 Nov 2012 11:52:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbwTs-00016p-QK for qemu-devel@nongnu.org; Fri, 23 Nov 2012 11:51:56 -0500 Message-ID: <50AFA9A9.9050609@redhat.com> Date: Fri, 23 Nov 2012 17:51:53 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1353686178-27520-1-git-send-email-pbonzini@redhat.com> <1353686178-27520-2-git-send-email-pbonzini@redhat.com> <50AFA158.4020502@suse.de> <50AFA36D.7030502@redhat.com> <50AFA4A0.1070903@suse.de> In-Reply-To: <50AFA4A0.1070903@suse.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1.3 1/2] qom: dynamic_cast of NULL is always NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: aliguori@us.ibm.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com Il 23/11/2012 17:30, Andreas F=E4rber ha scritto: > If having SCSI_BUS() return NULL was your intent you would not have > needed to switch to object_dynamic_cast in your second patch. :) In the second patch I needed object_dynamic_cast in case the bus was not a SCSI bus at all. For example: $ qemu-system-x86_64 -S -monitor stdio -device piix3-usb-uhci (qemu) drive_add 4 if=3Dscsi Object 0x7f2dcdcfe380 is not an instance of type SCSI Aborted Paolo