From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdGT1-0003X4-SA for qemu-devel@nongnu.org; Tue, 27 Nov 2012 03:24:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdGT0-0003bF-M2 for qemu-devel@nongnu.org; Tue, 27 Nov 2012 03:24:31 -0500 Received: from mail-wi0-f171.google.com ([209.85.212.171]:56109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdGT0-0003b8-FS for qemu-devel@nongnu.org; Tue, 27 Nov 2012 03:24:30 -0500 Received: by mail-wi0-f171.google.com with SMTP id hn14so3258848wib.10 for ; Tue, 27 Nov 2012 00:24:29 -0800 (PST) Sender: Paolo Bonzini Message-ID: <50B478BA.1020105@redhat.com> Date: Tue, 27 Nov 2012 09:24:26 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1353994672-20714-1-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1353994672-20714-1-git-send-email-lilei@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] scsi: Remove SCSI_BUS macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com Il 27/11/2012 06:37, Lei Li ha scritto: > As step behind Paolo's fix for RHBZ#879657 and according to the current > fix in Commit b5007bc (hmp: do not crash on invalid SCSI hotplug), the > macro SCSI_BUS has already been replaced to object_dynamic_cast which > has been improved when try to cast to NULL value and it is also what > DO_UPCAST macro does. And due to the potential Segmentation risk of > SCSI_BUS, remove this macro. The SCSI_BUS macro has a different purpose than object_dynamic_cast. The NULL pointer change will also work with SCSI_BUS; the assertion causes the bug in this particular case, but it is still useful in general. Whenever the assertion is fine, SCSI_BUS should be used instead of DO_UPCAST. Paolo