qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Zhu Guihua <zhugh.fnst@cn.fujitsu.com>,
	Juan Quintela <quintela@redhat.com>,
	dgilbert@redhat.com, Tang Chen <tangchen@cn.fujitsu.com>,
	Anthony Liguori <aliguori@amazon.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: [Qemu-devel] [PULL 20/96] acpi, ich9: Add unplug cb for ich9.
Date: Wed, 18 Feb 2015 22:46:04 +0100	[thread overview]
Message-ID: <1424295164-4774-21-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1424295164-4774-1-git-send-email-mst@redhat.com>

From: Tang Chen <tangchen@cn.fujitsu.com>

Memory and CPU hot unplug are both asynchronous procedures.
When the unplug operation happens, unplug request cb is called first.
And when guest OS finished handling unplug, unplug cb will be called
to do the real removal of device.

This patch adds hotunplug cb to ich9, which memory and CPU
hot unplug will use it.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/ich9.h | 2 ++
 hw/acpi/ich9.c         | 7 +++++++
 hw/isa/lpc_ich9.c      | 9 +++++++++
 3 files changed, 18 insertions(+)

diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index eaef0c3..c2d3dba 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -65,6 +65,8 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp);
 void ich9_pm_device_plug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, Error **errp);
 void ich9_pm_device_unplug_request_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
                                       Error **errp);
+void ich9_pm_device_unplug_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
+                              Error **errp);
 
 void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
 #endif /* HW_ACPI_ICH9_H */
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 5fe1eb8..5352e19 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -404,6 +404,13 @@ void ich9_pm_device_unplug_request_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
                " type: %s", object_get_typename(OBJECT(dev)));
 }
 
+void ich9_pm_device_unplug_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
+                              Error **errp)
+{
+    error_setg(errp, "acpi: device unplug for not supported device"
+               " type: %s", object_get_typename(OBJECT(dev)));
+}
+
 void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)
 {
     ICH9LPCState *s = ICH9_LPC_DEVICE(adev);
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index d00b223..16f5a0d 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -615,6 +615,14 @@ static void ich9_device_unplug_request_cb(HotplugHandler *hotplug_dev,
     ich9_pm_device_unplug_request_cb(&lpc->pm, dev, errp);
 }
 
+static void ich9_device_unplug_cb(HotplugHandler *hotplug_dev,
+                                  DeviceState *dev, Error **errp)
+{
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev);
+
+    ich9_pm_device_unplug_cb(&lpc->pm, dev, errp);
+}
+
 static bool ich9_rst_cnt_needed(void *opaque)
 {
     ICH9LPCState *lpc = opaque;
@@ -678,6 +686,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data)
     dc->cannot_instantiate_with_device_add_yet = true;
     hc->plug = ich9_device_plug_cb;
     hc->unplug_request = ich9_device_unplug_request_cb;
+    hc->unplug = ich9_device_unplug_cb;
     adevc->ospm_status = ich9_pm_ospm_status;
 }
 
-- 
MST

  parent reply	other threads:[~2015-02-18 21:46 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 21:43 [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 01/96] acpi-build: fix memory leak with bridge hp off Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 02/96] bios linker: validate pointer within table Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 03/96] acpi: move generic aml building helpers into dedictated file Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 04/96] acpi: add build_append_namestring() helper Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 05/96] acpi: drop min-bytes in build_package() Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 06/96] pci: Convert core to realize Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 07/96] pci: Permit incremental conversion of device models " Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 08/96] pci: Trivial device model conversions " Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 09/96] pcnet: pcnet_common_init() always returns 0, change to void Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 10/96] pcnet: Convert to realize Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 11/96] serial-pci: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 12/96] ide/ich: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 13/96] cirrus-vga: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 14/96] qxl: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 15/96] pci-assign: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 16/96] qdev: Don't exit when running into bad -global Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 17/96] acpi, pc: Add hotunplug request cb for pc machine Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 18/96] acpi, ich9: Add hotunplug request cb for ich9 Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 19/96] acpi, pc: Add unplug cb for pc machine Michael S. Tsirkin
2015-02-18 21:46 ` Michael S. Tsirkin [this message]
2015-02-18 21:46 ` [Qemu-devel] [PULL 21/96] acpi, piix4: Add unplug cb for piix4 Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 22/96] vl.c: Fix error messages when parsing maxmem parameters Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 23/96] pc: memory: Validate alignment of maxram_size to page size Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 24/96] acpi: update RSDP on guest access Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 25/96] pc: acpi-build: update linker " Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 26/96] pc: acpi-build: migrate RSDP table Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 27/96] exec: round up size on MR resize Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 28/96] acpi-build: fix ACPI RAM management Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 29/96] acpi: has_immutable_rsdp->!rsdp_in_ram Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 30/96] acpi-build: simplify rsdp management for legacy Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 31/96] scripts/update-linux-headers.sh: pull virtio hdrs Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 32/96] include: import virtio headers from linux 4.0 Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 33/96] virtio: use standard virtio_ring.h Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 34/96] virtio: use standard-headers Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 35/96] virtio-balloon: use standard headers Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 36/96] virtio-9p: " Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 37/96] virtio-blk: switch to standard-headers Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 38/96] virtio-net,tap: use standard-headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 39/96] virtio-rng: " Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 40/96] virtio-scsi: " Michael S. Tsirkin
2015-03-11  7:14   ` Fam Zheng
2015-03-11  8:31     ` Michael S. Tsirkin
2015-03-11  9:48       ` Paolo Bonzini
2015-03-11 12:25         ` Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 41/96] virtio-serial: switch to standard-headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 42/96] update-linux-headers: use standard-headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 43/96] linux-headers: " Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-02-18 22:03   ` Michael S. Tsirkin
2015-02-19  7:58     ` Michael S. Tsirkin
2015-02-19  8:23     ` Peter Maydell
2015-02-18 21:48 ` [Qemu-devel] [PULL 44/96] virtio-pci: use standard headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 45/96] scripts: add arch specific standard-headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 46/96] standard-headers: add s390 virtio headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 47/96] s390: use standard headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 48/96] virtio: cull virtio_bus_set_vdev_features Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 49/96] virtio: feature bit manipulation helpers Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 50/96] virtio: add feature checking helpers Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 51/96] acpi-build: skip hotplugged bridges Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 52/96] pc: acpi: use local var for accessing ACPI tables blob in acpi_build() Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 53/96] update-linux-headers.sh: s/__inline__/inline/ Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 54/96] virtio-serial-bus.c: drop virtio_ids.h Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 55/96] standard-headers: include stdint.h Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 56/96] virtio_ring.h: s/__inline__/inline/ Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 57/96] acpi: introduce AML composer aml_append() Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 58/96] acpi: add aml_scope() term Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 59/96] pc: acpi-build: use aml_scope() for \_SB scope Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 60/96] acpi: add aml_device() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 61/96] acpi: add aml_method() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 62/96] acpi: add aml_if() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 63/96] acpi: add aml_name() & aml_name_decl() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 64/96] acpi: add aml_int() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 65/96] acpi: add aml_return() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 66/96] acpi: add aml_arg() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 67/96] acpi: add aml_store() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 68/96] acpi: add aml_and() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 69/96] acpi: add aml_notify() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 70/96] acpi: add aml_call1(), aml_call2(), aml_call3(), aml_call4() helpers Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 71/96] acpi: add aml_package() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 72/96] pc: acpi-build: generate _S[345] packages dynamically Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 73/96] acpi: add aml_buffer() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 74/96] acpi: add aml_resource_template() helper Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 75/96] acpi: add aml_io() helper Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 76/96] acpi: include PkgLength size only when requested Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 77/96] acpi: add aml_operation_region() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 78/96] acpi: add aml_field() & aml_named_field() terms Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 79/96] acpi: add aml_local() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 80/96] acpi: add aml_string() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 81/96] pc: acpi-build: generate pvpanic device description dynamically Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 82/96] acpi: add aml_varpackage() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 83/96] acpi: add aml_equal() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 84/96] acpi: add aml_processor() term Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 85/96] acpi: add aml_eisaid() term Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 86/96] pc: acpi-build: drop template patching and CPU hotplug objects dynamically Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 87/96] pc: acpi-build: create CPU hotplug IO region dynamically Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 88/96] acpi: add aml_reserved_field() term Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 89/96] pc: acpi-build: drop template patching and memory hotplug objects dynamically Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 90/96] pc: acpi-build: create memory hotplug IO region dynamically Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 91/96] acpi: add aml_word_bus_number(), aml_word_io(), aml_dword_memory(), aml_qword_memory() terms Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 92/96] pc: pcihp: expose MMIO base and len as properties Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 93/96] pc: acpi-build: reserve PCIHP MMIO resources Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 94/96] acpi: update generated hex files Michael S. Tsirkin
2015-02-18 21:53 ` [Qemu-devel] [PULL 95/96] acpi: drop unused generated files Michael S. Tsirkin
2015-02-18 21:53 ` [Qemu-devel] [PULL 96/96] acpi-test: update expected files Michael S. Tsirkin
2015-02-24 16:47 ` [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-02-26 11:17 ` Peter Maydell
2015-02-26 11:41   ` Michael S. Tsirkin
2015-02-26 11:59     ` Peter Maydell
2015-02-26 12:06       ` Michael S. Tsirkin
2015-02-26 11:53   ` 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=1424295164-4774-21-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=dgilbert@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=tangchen@cn.fujitsu.com \
    --cc=zhugh.fnst@cn.fujitsu.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).