From: Paolo Bonzini <pbonzini@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: peter.maydell@linaro.org, ehabkost@redhat.com, mst@redhat.com,
marcel.a@redhat.com, qemu-devel@nongnu.org, blauwirbel@gmail.com,
alex.williamson@redhat.com, anthony@codemonkey.ws,
afaerber@suse.de
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 [thread overview]
Message-ID: <52A20A0B.3010203@redhat.com> (raw)
In-Reply-To: <1386349395-5710-1-git-send-email-imammedo@redhat.com>
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
next prev parent reply other threads:[~2013-12-06 17:32 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 17:03 [Qemu-devel] [PATCH 0/7] Refactor PCI/SHPC/PCIE hotplug to use a more generic hotplug API Igor Mammedov
2013-12-06 17:03 ` [Qemu-devel] [PATCH 1/7] define hotplug interface Igor Mammedov
2013-12-06 17:26 ` Paolo Bonzini
2013-12-09 12:42 ` Igor Mammedov
2013-12-09 13:15 ` Paolo Bonzini
2013-12-09 5:40 ` Li Guang
2013-12-09 9:11 ` Marcel Apfelbaum
2013-12-09 12:44 ` Igor Mammedov
2013-12-09 8:58 ` Marcel Apfelbaum
2013-12-09 12:52 ` Igor Mammedov
2013-12-06 17:03 ` [Qemu-devel] [PATCH 2/7] qdev: add to BusState "hotplug-device" link Igor Mammedov
2013-12-06 17:03 ` [Qemu-devel] [PATCH 3/7] hw/acpi: move typeinfo to the file end Igor Mammedov
2013-12-06 17:03 ` [Qemu-devel] [PATCH 4/7] acpi/piix4pm: convert ACPI PCI hotplug to use hotplug-device interface Igor Mammedov
2013-12-09 9:02 ` Marcel Apfelbaum
2013-12-09 13:24 ` Igor Mammedov
2013-12-06 17:03 ` [Qemu-devel] [PATCH 5/7] pci/shpc: convert SHPC " Igor Mammedov
2013-12-06 17:03 ` [Qemu-devel] [PATCH 6/7] pci/pcie: convert PCIE " Igor Mammedov
2013-12-06 17:03 ` [Qemu-devel] [PATCH 7/7] hw/pci: convert PCI bus to use "hotplug-device" interface Igor Mammedov
2013-12-06 17:29 ` Paolo Bonzini
2013-12-09 13:41 ` Igor Mammedov
2013-12-09 13:47 ` Paolo Bonzini
2013-12-09 14:14 ` Igor Mammedov
2013-12-09 14:36 ` Paolo Bonzini
2013-12-09 15:08 ` Igor Mammedov
2013-12-09 15:16 ` Paolo Bonzini
2013-12-09 16:48 ` Igor Mammedov
2013-12-09 17:18 ` Paolo Bonzini
2013-12-09 21:15 ` Igor Mammedov
2013-12-09 22:28 ` Paolo Bonzini
2013-12-09 9:09 ` Marcel Apfelbaum
2013-12-09 13:55 ` Igor Mammedov
2013-12-09 14:01 ` Marcel Apfelbaum
2013-12-06 17:31 ` Paolo Bonzini [this message]
2013-12-09 14:15 ` [Qemu-devel] [PATCH 0/7] Refactor PCI/SHPC/PCIE hotplug to use a more generic hotplug API Igor Mammedov
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=52A20A0B.3010203@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=alex.williamson@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=blauwirbel@gmail.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcel.a@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--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).