qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Lei Li <lilei@linux.vnet.ibm.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH] scsi: Remove SCSI_BUS macro
Date: Tue, 27 Nov 2012 09:24:26 +0100	[thread overview]
Message-ID: <50B478BA.1020105@redhat.com> (raw)
In-Reply-To: <1353994672-20714-1-git-send-email-lilei@linux.vnet.ibm.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

      reply	other threads:[~2012-11-27  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27  5:37 [Qemu-devel] [PATCH] scsi: Remove SCSI_BUS macro Lei Li
2012-11-27  8:24 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B478BA.1020105@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=lilei@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).