qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/7] Refactor PCI/SHPC/PCIE hotplug to use a mor


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 0/7] Refactor PCI/SHPC/PCIE hotplug to use a more generic hotplug API
Date: Fri, 06 Dec 2013 18:31:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 06/12/2013 18:03, Igor Mammedov ha scritto:
> Series is replacement for a more simple attempt to generalize hotplug API
> http://lists.gnu.org/archive/html/qemu-devel/2013-11/msg02529.html
> promted by Paolo in this patch review.
> --
> 
> Refactor PCI specific hotplug API to a more generic/reusable one.
> Model it after SCSI-BUS like hotplug API replacing single hotplug
> callback with hotplug/hot_unplug pair of callbacks as suggested by
> Paolo.
> Difference between SCSI-BUS and this approach is that the former
> is BUS centric while the latter is device centred. Which is evolved
> from the fact that hotplug callbacks used by ACPI/SHPC/PCIE are
> implemented by devices rather than by bus and bus serves only as
> a proxy to forward event to hotplug device.
> Memory hotplug also exposes tha same usage pattern hence an attempt
> to generalize hotplug API.
> 
> Refactoring also simplifies wiring of a hotplug device with a bus,
> all it needs is to set "hotplug-device" link on bus, which
> would potentially allow to do it from configuration file,
> there is not need to setup hotplug device callbacks on bus
> synce it can get them via HOTPLUG_DEVICE API of "hotplug-device"
> target.
> 
> In addition device centred hotplug API may be used by bus-less
> hotplug implementations as well if it's decided to use
> link<foo...> instead of bus.
> 
> Patches 4-7 are should be merged as one and are split only for
> simplifying review (they compile fine but PCI hotplug is broken
> until the last patch applyed).
> 
> git tree for testing:
> https://github.com/imammedo/qemu/commits/hotplug_dev_inf_v1
> 
> tested only ACPI hotplug with following HMP commands:
> ==
> netdev_add user,id=n1
> device_add e1000,id=e1,netdev=n1
> device_del e1
> ==
> 
> Igor Mammedov (7):
>   define hotplug interface
>   qdev: add to BusState "hotplug-device" link
>   hw/acpi: move typeinfo to the file end
>   acpi/piix4pm: convert ACPI PCI hotplug to use hotplug-device
>     interface
>   pci/shpc: convert SHPC hotplug to use hotplug-device interface
>   pci/pcie: convert PCIE hotplug to use hotplug-device interface
>   hw/pci: convert PCI bus to use "hotplug-device" interface.
> 
>  hw/acpi/piix4.c                |  143 
> +++++++++++++++++++++-------------------
>  hw/core/Makefile.objs          |    1 +
>  hw/core/hotplug.c              |   25 +++++++
>  hw/core/qdev.c                 |    4 +
>  hw/pci-bridge/pci_bridge_dev.c |    9 +++
>  hw/pci/pci.c                   |   70 ++++++++++++++-----
>  hw/pci/pcie.c                  |   73 +++++++++++++-------
>  hw/pci/pcie_port.c             |    8 ++
>  hw/pci/shpc.c                  |  132 ++++++++++++++++++++++++-------------
>  include/hw/hotplug.h           |   50 ++++++++++++++
>  include/hw/pci/pci.h           |   10 ---
>  include/hw/pci/pci_bus.h       |    2 -
>  include/hw/pci/pcie.h          |    4 +
>  include/hw/pci/shpc.h          |    7 ++
>  include/hw/qdev-core.h         |    4 +
>  15 files changed, 372 insertions(+), 170 deletions(-)
>  create mode 100644 hw/core/hotplug.c
>  create mode 100644 include/hw/hotplug.h
> 

I didn't look closely at patches 4-6, but it looks very nice and
extensible.  I will convert SCSI to use this too when it goes in.

Can you pick up my qom patches for interfaces too ("qom: fix
registration of QOM interfaces")?

Paolo



reply via email to

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