All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 16/24] qdev hotplug: infrastructure and monitor commands.
Date: Tue, 29 Sep 2009 11:08:02 +0200	[thread overview]
Message-ID: <4AC1CE72.5090601@redhat.com> (raw)
In-Reply-To: <87r5tqdd4c.fsf@pike.pond.sub.org>

>>   /* This is a nasty hack to allow passing a NULL bus to qdev_create.  */
>> +static int qdev_hotplug = 0;
>> +
>
> I see the "nasty hack" part, but I don't see how qdev_create() accepts a
> null bus now:
>
>>   static BusState *main_system_bus;

The (existing) "nasty hack" comment belongs to the main_system_bus 
variable and should stay there of course to avoid confusion ...

>>       /* create device, set properties */
>>       qdev = qdev_create(bus, driver);
> [...]
>
> As far as I can see, all qdev_hotplug does is telling qdev_device_add()
> and qdev_create() that this is a hotplug.

Yes.

> What about something like:
>
> DeviceState *qdev_device_add(QemuOpts *opts, int hotplug)
> {
> [...]
>      if (hotplug&&  !bus->allow_hotplug) {
>          qemu_error("Bus %s does not support hotplugging\n",
>                     bus->name);
>          return NULL;
>      }
>
>      /* create device, set properties */
>      qdev = qdev_create(bus, driver);
>      if (hotplug) {
>          dev->hotplugged = 1;

I started that way.  Doesn't fly.  Not every device creation goes 
through qdev_device_add().  Thus you'll have to do this in 
qdev_create(), which in turn means that you would have to add a hotplug 
parameter to tons of functions just to pass it down to qdev_create ...

cheers,
   Gerd

  reply	other threads:[~2009-09-29  9:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-25 19:42 [Qemu-devel] [PATCH 00/24] qdev: bus management updates Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 01/24] unbreak usb pass-through on linux Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 02/24] allow qdev busses allocations be inplace Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 03/24] switch scsi bus to inplace allocation Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 04/24] switch usb " Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 05/24] switch ide " Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 06/24] inplace allocation for pci, split irq init Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 07/24] convert pci bridge to qdev Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 08/24] piix_pci: kill PIIX3IrqState Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 09/24] qdev: device free fixups Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 10/24] Add exit callback to DeviceInfo Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 11/24] Implement scsi device destruction Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 12/24] pci: use qdev for " Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 13/24] pci: move unregister from PCIDevice to PCIDeviceInfo Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 14/24] usb: hook unplug into qdev, cleanups + fixes Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 15/24] switch qemu-config to qemu_error Gerd Hoffmann
2009-09-28 20:40   ` Markus Armbruster
2009-09-29  8:57     ` Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 16/24] qdev hotplug: infrastructure and monitor commands Gerd Hoffmann
2009-09-28 20:32   ` Markus Armbruster
2009-09-29  9:08     ` Gerd Hoffmann [this message]
2009-09-29 12:25       ` Markus Armbruster
2009-09-29 13:23         ` Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 17/24] usb: hotplug windup Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 18/24] scsi: " Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 19/24] pci: " Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 20/24] pci: windup acpi-based hotplug Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 21/24] drive cleanup fixes Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 22/24] refactor drive_hot_add Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 23/24] allow if=none for drive_add Gerd Hoffmann
2009-09-25 19:42 ` [Qemu-devel] [PATCH 24/24] store a pointer to QemuOpts in DeviceState, release it when zapping a device Gerd Hoffmann
2009-09-25 20:57 ` [Qemu-devel] [PATCH 00/24] qdev: bus management updates Anthony Liguori
2009-09-28 20:40 ` Markus Armbruster

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=4AC1CE72.5090601@redhat.com \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.