qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
	Ben Warren <ben@skyportsystems.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-3.1 2/2] acpi: Decouple ACPI hotplug callbacks from HotplugHandler
Date: Tue, 24 Jul 2018 09:39:16 -0300	[thread overview]
Message-ID: <20180724123916.GC3896@localhost.localdomain> (raw)
In-Reply-To: <20180724142949.3078da82@redhat.com>

On Tue, Jul 24, 2018 at 02:29:49PM +0200, Igor Mammedov wrote:
> On Mon, 23 Jul 2018 16:31:45 -0300
> Eduardo Habkost <ehabkost@redhat.com> wrote:
> 
> > The ACPI hotplug callbacks get a HotplugHandler object as
> > argument.  This has two problems:
> > 
> > 1) The functions require a TYPE_ACPI_DEVICE_IF object, but the
> >    function prototype doesn't indicate that.  It's possible to
> >    pass an object that would make the function crash.
> > 2) The function does not require the object to implement
> >    TYPE_HOTPLUG_HANDLER at all, but the function prototype
> >    imposes that for no reason.
> > 
> > Change the argument type to AcpiDeviceIf instead of
> > HotplugHandler.
> What is the motivation for this patch,
> do you actually get crashes?

I didn't get crashes, but the idea for the change came when
Michael asked me how to get the HotplugHandler object.  I was
going to suggest current_machine (which is also a hotplug
handler), when I noticed he actually needed an AcpiDeviceIf
object.

The main motivation, however, is to simply make the function
prototypes make sense.  Is there a single reason to make the ACPI
functions get a HotplugHandler argument instead of AcpiDeviceIf?

-- 
Eduardo

  reply	other threads:[~2018-07-24 12:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 19:31 [Qemu-devel] [PATCH for-3.1 0/2] ACPI type safety cleanup Eduardo Habkost
2018-07-23 19:31 ` [Qemu-devel] [PATCH for-3.1 1/2] acpi: Improve acpi_send_event() type safety Eduardo Habkost
2018-07-24 12:27   ` Igor Mammedov
2018-07-23 19:31 ` [Qemu-devel] [PATCH for-3.1 2/2] acpi: Decouple ACPI hotplug callbacks from HotplugHandler Eduardo Habkost
2018-07-24 12:29   ` Igor Mammedov
2018-07-24 12:39     ` Eduardo Habkost [this message]
2018-07-24 15:28       ` Igor Mammedov
2018-07-24 15:48         ` Eduardo Habkost
2018-07-24 18:14         ` Michael S. Tsirkin
2018-07-25  6:57           ` Igor Mammedov
2018-07-25 13:46             ` Michael S. Tsirkin

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=20180724123916.GC3896@localhost.localdomain \
    --to=ehabkost@redhat.com \
    --cc=ben@skyportsystems.com \
    --cc=imammedo@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xiaoguangrong.eric@gmail.com \
    /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).