qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/7] hw/pci: convert PCI bus to use "hotplug-dev


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 7/7] hw/pci: convert PCI bus to use "hotplug-device" interface.
Date: Mon, 09 Dec 2013 23:28:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 09/12/2013 22:15, Igor Mammedov ha scritto:
>> > Check is idempotent, and can be called before realize makes any change
>> > (it could also be called after the device is added to
>> > /machine/unattached, it's not a big difference).
>> > 
>> > Plug is called after realize.
> PCIE case: "check" before realize will work since code that does check depends
> only on hotplug device (i.e. PCIE slot) and do not access not yet realized
> device at all.
> 
> however 
> SHPC case: check code access pci_slot that is derived from PCIDevice.devfn,
> which in turn could be initialized in realize() (see pci_qdev_init() devfn
> auto allocation). So it's not possible to call check before realize() it
> should be called from realize().
> 
> Perhaps other hotplug buses/devices have similar limitations, where it's not
> fine to access device state from outside before calling it's realize(), so it
> should be some post_realize() hook then to make it generic which leads to the
> following:
>   if ->plug() called after realize() fails, all we need to do is to
>   fail "realize" property setter. That should cause
>   qdev_device_add() -> object_unparent() -> device_unparent() -> unrealize()
>   doing all necessary cleanup.

If you can make it work, that'd be great.

Otherwise, let's do it later, but please make a wiki page with a todo
list.  We already have too many items on the same critical path
(hotplug, memdev, NUMA,...).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]