All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug.
@ 2015-01-07  6:49 Tang Chen
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 1/5] acpi, pc: Add hotunplug request cb for pc machine Tang Chen
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Tang Chen @ 2015-01-07  6:49 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, pbonzini
  Cc: guz.fnst, hutao, isimatu.yasuaki, zhugh.fnst, tangchen

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

They both need pc-machine, piix4 and ich9 unplug and unplug request cb.
So this patch set introduces these commom functions as part1, and memory
and CPU hot-unplug will come soon as part 2 and 3.

This patch-set is based on QEmu 2.2

Tang Chen (5):
  acpi, pc: Add hotunplug request cb for pc machine.
  acpi, ich9: Add hotunplug request cb for ich9.
  acpi, pc: Add unplug cb for pc machine.
  acpi, ich9: Add unplug cb for ich9.
  acpi, piix4: Add unplug cb for piix4.

 hw/acpi/ich9.c         | 14 ++++++++++++++
 hw/acpi/piix4.c        |  8 ++++++++
 hw/i386/pc.c           | 16 ++++++++++++++++
 hw/isa/lpc_ich9.c      | 14 ++++++++++++--
 include/hw/acpi/ich9.h |  4 ++++
 5 files changed, 54 insertions(+), 2 deletions(-)

-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Qemu-devel] [RESEND PATCH v1 1/5] acpi, pc: Add hotunplug request cb for pc machine.
  2015-01-07  6:49 [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Tang Chen
@ 2015-01-07  6:49 ` Tang Chen
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 2/5] acpi, ich9: Add hotunplug request cb for ich9 Tang Chen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Tang Chen @ 2015-01-07  6:49 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, pbonzini
  Cc: guz.fnst, hutao, isimatu.yasuaki, zhugh.fnst, tangchen

Memory and CPU hot unplug are both asynchronous procedures.
They both need unplug request callback to initiate unplug operation.

Add unplug handler to pc machine that will be used by following
CPU and memory unplug patches.
---
 hw/i386/pc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index e07f1fa..312f8cf 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1710,6 +1710,13 @@ static void pc_machine_device_plug_cb(HotplugHandler *hotplug_dev,
     }
 }
 
+static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev,
+                                                DeviceState *dev, Error **errp)
+{
+    error_setg(errp, "acpi: device unplug request for not supported device"
+               " type: %s", object_get_typename(OBJECT(dev)));
+}
+
 static HotplugHandler *pc_get_hotpug_handler(MachineState *machine,
                                              DeviceState *dev)
 {
@@ -1839,6 +1846,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
     pcmc->get_hotplug_handler = mc->get_hotplug_handler;
     mc->get_hotplug_handler = pc_get_hotpug_handler;
     hc->plug = pc_machine_device_plug_cb;
+    hc->unplug_request = pc_machine_device_unplug_request_cb;
 }
 
 static const TypeInfo pc_machine_info = {
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [RESEND PATCH v1 2/5] acpi, ich9: Add hotunplug request cb for ich9.
  2015-01-07  6:49 [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Tang Chen
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 1/5] acpi, pc: Add hotunplug request cb for pc machine Tang Chen
@ 2015-01-07  6:49 ` Tang Chen
  2015-01-19 17:26   ` Igor Mammedov
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 3/5] acpi, pc: Add unplug cb for pc machine Tang Chen
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Tang Chen @ 2015-01-07  6:49 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, pbonzini
  Cc: guz.fnst, hutao, isimatu.yasuaki, zhugh.fnst, tangchen

Memory and CPU hot unplug are both asynchronize procedures.
They both need unplug request cb when the unplug operation happens.

This patch adds hotunplug request cb for ich9, and memory and CPU
hot unplug will base on it.
---
 hw/acpi/ich9.c         | 7 +++++++
 hw/isa/lpc_ich9.c      | 5 +++--
 include/hw/acpi/ich9.h | 2 ++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index ea991a3..5ce3aaf 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -301,6 +301,13 @@ 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)
+{
+    error_setg(errp, "acpi: device unplug request 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 530b074..d00b223 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -610,8 +610,9 @@ static void ich9_device_plug_cb(HotplugHandler *hotplug_dev,
 static void ich9_device_unplug_request_cb(HotplugHandler *hotplug_dev,
                                           DeviceState *dev, Error **errp)
 {
-    error_setg(errp, "acpi: device unplug request for not supported device"
-               " type: %s", object_get_typename(OBJECT(dev)));
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev);
+
+    ich9_pm_device_unplug_request_cb(&lpc->pm, dev, errp);
 }
 
 static bool ich9_rst_cnt_needed(void *opaque)
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index fe975e6..86853c3 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -59,6 +59,8 @@ extern const VMStateDescription vmstate_ich9_pm;
 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_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
 #endif /* HW_ACPI_ICH9_H */
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [RESEND PATCH v1 3/5] acpi, pc: Add unplug cb for pc machine.
  2015-01-07  6:49 [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Tang Chen
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 1/5] acpi, pc: Add hotunplug request cb for pc machine Tang Chen
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 2/5] acpi, ich9: Add hotunplug request cb for ich9 Tang Chen
@ 2015-01-07  6:49 ` Tang Chen
  2015-01-19 17:29   ` Igor Mammedov
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 4/5] acpi, ich9: Add unplug cb for ich9 Tang Chen
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Tang Chen @ 2015-01-07  6:49 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, pbonzini
  Cc: guz.fnst, hutao, isimatu.yasuaki, zhugh.fnst, tangchen

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

This patch adds hotunplug cb for pc machine, and memory and CPU
hot unplug will base on it.
---
 hw/i386/pc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 312f8cf..0f3b1e0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1717,6 +1717,13 @@ static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev,
                " type: %s", object_get_typename(OBJECT(dev)));
 }
 
+static void pc_machine_device_unplug_cb(HotplugHandler *hotplug_dev,
+                                        DeviceState *dev, Error **errp)
+{
+    error_setg(errp, "acpi: device unplug for not supported device"
+               " type: %s", object_get_typename(OBJECT(dev)));
+}
+
 static HotplugHandler *pc_get_hotpug_handler(MachineState *machine,
                                              DeviceState *dev)
 {
@@ -1847,6 +1854,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
     mc->get_hotplug_handler = pc_get_hotpug_handler;
     hc->plug = pc_machine_device_plug_cb;
     hc->unplug_request = pc_machine_device_unplug_request_cb;
+    hc->unplug = pc_machine_device_unplug_cb;
 }
 
 static const TypeInfo pc_machine_info = {
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [RESEND PATCH v1 4/5] acpi, ich9: Add unplug cb for ich9.
  2015-01-07  6:49 [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Tang Chen
                   ` (2 preceding siblings ...)
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 3/5] acpi, pc: Add unplug cb for pc machine Tang Chen
@ 2015-01-07  6:49 ` Tang Chen
  2015-01-19 17:34   ` Igor Mammedov
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 5/5] acpi, piix4: Add unplug cb for piix4 Tang Chen
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Tang Chen @ 2015-01-07  6:49 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, pbonzini
  Cc: guz.fnst, hutao, isimatu.yasuaki, zhugh.fnst, tangchen

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

This patch adds hotunplug cb for ich9, and memory and CPU
hot unplug will base on it.
---
 hw/acpi/ich9.c         | 7 +++++++
 hw/isa/lpc_ich9.c      | 9 +++++++++
 include/hw/acpi/ich9.h | 2 ++
 3 files changed, 18 insertions(+)

diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 5ce3aaf..c48d176 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -308,6 +308,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;
 }
 
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index 86853c3..fc87dad 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -61,6 +61,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 */
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [RESEND PATCH v1 5/5] acpi, piix4: Add unplug cb for piix4.
  2015-01-07  6:49 [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Tang Chen
                   ` (3 preceding siblings ...)
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 4/5] acpi, ich9: Add unplug cb for ich9 Tang Chen
@ 2015-01-07  6:49 ` Tang Chen
  2015-01-19 17:37   ` Igor Mammedov
  2015-01-19 17:40 ` [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Igor Mammedov
  2015-01-19 21:29 ` Michael S. Tsirkin
  6 siblings, 1 reply; 14+ messages in thread
From: Tang Chen @ 2015-01-07  6:49 UTC (permalink / raw)
  To: qemu-devel, imammedo, mst, pbonzini
  Cc: guz.fnst, hutao, isimatu.yasuaki, zhugh.fnst, tangchen

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

This patch adds hotunplug cb for piix4, and memory and CPU
hot unplug will base on it.
---
 hw/acpi/piix4.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 481a16c..4407388 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -370,6 +370,13 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,
     }
 }
 
+static void piix4_device_unplug_cb(HotplugHandler *hotplug_dev,
+                                   DeviceState *dev, Error **errp)
+{
+    error_setg(errp, "acpi: device unplug for not supported device"
+               " type: %s", object_get_typename(OBJECT(dev)));
+}
+
 static void piix4_update_bus_hotplug(PCIBus *pci_bus, void *opaque)
 {
     PIIX4PMState *s = opaque;
@@ -610,6 +617,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
     dc->hotpluggable = false;
     hc->plug = piix4_device_plug_cb;
     hc->unplug_request = piix4_device_unplug_request_cb;
+    hc->unplug = piix4_device_unplug_cb;
     adevc->ospm_status = piix4_ospm_status;
 }
 
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH v1 2/5] acpi, ich9: Add hotunplug request cb for ich9.
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 2/5] acpi, ich9: Add hotunplug request cb for ich9 Tang Chen
@ 2015-01-19 17:26   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2015-01-19 17:26 UTC (permalink / raw)
  To: Tang Chen
  Cc: zhugh.fnst, mst, hutao, qemu-devel, isimatu.yasuaki, guz.fnst, pbonzini

On Wed, 7 Jan 2015 14:49:42 +0800
Tang Chen <tangchen@cn.fujitsu.com> wrote:

> Memory and CPU hot unplug are both asynchronize procedures.
s/asynchronize/asynchronous/

> They both need unplug request cb when the unplug operation happens.
> 
> This patch adds hotunplug request cb for ich9, and memory and CPU
> hot unplug will base on it.
s/base on it/share it/

> ---
>  hw/acpi/ich9.c         | 7 +++++++
>  hw/isa/lpc_ich9.c      | 5 +++--
>  include/hw/acpi/ich9.h | 2 ++
>  3 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
> index ea991a3..5ce3aaf 100644
> --- a/hw/acpi/ich9.c
> +++ b/hw/acpi/ich9.c
> @@ -301,6 +301,13 @@ 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)
> +{
> +    error_setg(errp, "acpi: device unplug request 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 530b074..d00b223 100644
> --- a/hw/isa/lpc_ich9.c
> +++ b/hw/isa/lpc_ich9.c
> @@ -610,8 +610,9 @@ static void ich9_device_plug_cb(HotplugHandler *hotplug_dev,
>  static void ich9_device_unplug_request_cb(HotplugHandler *hotplug_dev,
>                                            DeviceState *dev, Error **errp)
>  {
> -    error_setg(errp, "acpi: device unplug request for not supported device"
> -               " type: %s", object_get_typename(OBJECT(dev)));
> +    ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev);
> +
> +    ich9_pm_device_unplug_request_cb(&lpc->pm, dev, errp);
>  }
>  
>  static bool ich9_rst_cnt_needed(void *opaque)
> diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
> index fe975e6..86853c3 100644
> --- a/include/hw/acpi/ich9.h
> +++ b/include/hw/acpi/ich9.h
> @@ -59,6 +59,8 @@ extern const VMStateDescription vmstate_ich9_pm;
>  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_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
>  #endif /* HW_ACPI_ICH9_H */

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH v1 3/5] acpi, pc: Add unplug cb for pc machine.
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 3/5] acpi, pc: Add unplug cb for pc machine Tang Chen
@ 2015-01-19 17:29   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2015-01-19 17:29 UTC (permalink / raw)
  To: Tang Chen
  Cc: zhugh.fnst, mst, hutao, qemu-devel, isimatu.yasuaki, guz.fnst, pbonzini

On Wed, 7 Jan 2015 14:49:43 +0800
Tang Chen <tangchen@cn.fujitsu.com> wrote:

> Memory and CPU hot unplug are both asynchronize procedures.
s/asynchronize/asynchronous/

> When the unplug operation happens, unplug request cb is called first.
> And when ghest OS finished handling unplug, unplug cb will be called
s/ghest/guest/
> to do the real removal of device.
> 
> This patch adds hotunplug cb for pc machine, and memory and CPU
s/for/to/
s/and memory/which memory/
> hot unplug will base on it.
s/base on it/use/

> ---
>  hw/i386/pc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 312f8cf..0f3b1e0 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1717,6 +1717,13 @@ static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev,
>                 " type: %s", object_get_typename(OBJECT(dev)));
>  }
>  
> +static void pc_machine_device_unplug_cb(HotplugHandler *hotplug_dev,
> +                                        DeviceState *dev, Error **errp)
> +{
> +    error_setg(errp, "acpi: device unplug for not supported device"
> +               " type: %s", object_get_typename(OBJECT(dev)));
> +}
> +
>  static HotplugHandler *pc_get_hotpug_handler(MachineState *machine,
>                                               DeviceState *dev)
>  {
> @@ -1847,6 +1854,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
>      mc->get_hotplug_handler = pc_get_hotpug_handler;
>      hc->plug = pc_machine_device_plug_cb;
>      hc->unplug_request = pc_machine_device_unplug_request_cb;
> +    hc->unplug = pc_machine_device_unplug_cb;
>  }
>  
>  static const TypeInfo pc_machine_info = {

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH v1 4/5] acpi, ich9: Add unplug cb for ich9.
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 4/5] acpi, ich9: Add unplug cb for ich9 Tang Chen
@ 2015-01-19 17:34   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2015-01-19 17:34 UTC (permalink / raw)
  To: Tang Chen
  Cc: zhugh.fnst, mst, hutao, qemu-devel, isimatu.yasuaki, guz.fnst, pbonzini

On Wed, 7 Jan 2015 14:49:44 +0800
Tang Chen <tangchen@cn.fujitsu.com> wrote:

> Memory and CPU hot unplug are both asynchronize procedures.
s/asynchronize/asynchronous/

> When the unplug operation happens, unplug request cb is called first.
> And when ghest OS finished handling unplug, unplug cb will be called
s/ghest/guest/

> to do the real removal of device.
> 
> This patch adds hotunplug cb for ich9, and memory and CPU
s/for/to/
s/and memory/which memory/
> hot unplug will base on it.
s/base on it/use/

> ---
>  hw/acpi/ich9.c         | 7 +++++++
>  hw/isa/lpc_ich9.c      | 9 +++++++++
>  include/hw/acpi/ich9.h | 2 ++
>  3 files changed, 18 insertions(+)
> 
> diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
> index 5ce3aaf..c48d176 100644
> --- a/hw/acpi/ich9.c
> +++ b/hw/acpi/ich9.c
> @@ -308,6 +308,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;
>  }
>  
> diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
> index 86853c3..fc87dad 100644
> --- a/include/hw/acpi/ich9.h
> +++ b/include/hw/acpi/ich9.h
> @@ -61,6 +61,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 */

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH v1 5/5] acpi, piix4: Add unplug cb for piix4.
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 5/5] acpi, piix4: Add unplug cb for piix4 Tang Chen
@ 2015-01-19 17:37   ` Igor Mammedov
  0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2015-01-19 17:37 UTC (permalink / raw)
  To: Tang Chen
  Cc: zhugh.fnst, mst, hutao, qemu-devel, isimatu.yasuaki, guz.fnst, pbonzini

On Wed, 7 Jan 2015 14:49:45 +0800
Tang Chen <tangchen@cn.fujitsu.com> wrote:

> Memory and CPU hot unplug are both asynchronize procedures.
s/asynchronize/asynchronous/
> When the unplug operation happens, unplug request cb is called first.
> And when ghest OS finished handling unplug, unplug cb will be called
s/ghest/guest/

> to do the real removal of device.
> 
> This patch adds hotunplug cb for piix4, and memory and CPU
s/for/to/
s/and memory/which memory/

> hot unplug will base on it.
s/base on it/use/

> ---
>  hw/acpi/piix4.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index 481a16c..4407388 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -370,6 +370,13 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,
>      }
>  }
>  
> +static void piix4_device_unplug_cb(HotplugHandler *hotplug_dev,
> +                                   DeviceState *dev, Error **errp)
> +{
> +    error_setg(errp, "acpi: device unplug for not supported device"
> +               " type: %s", object_get_typename(OBJECT(dev)));
> +}
> +
>  static void piix4_update_bus_hotplug(PCIBus *pci_bus, void *opaque)
>  {
>      PIIX4PMState *s = opaque;
> @@ -610,6 +617,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
>      dc->hotpluggable = false;
>      hc->plug = piix4_device_plug_cb;
>      hc->unplug_request = piix4_device_unplug_request_cb;
> +    hc->unplug = piix4_device_unplug_cb;
>      adevc->ospm_status = piix4_ospm_status;
>  }
>  

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug.
  2015-01-07  6:49 [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Tang Chen
                   ` (4 preceding siblings ...)
  2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 5/5] acpi, piix4: Add unplug cb for piix4 Tang Chen
@ 2015-01-19 17:40 ` Igor Mammedov
  2015-01-19 21:29 ` Michael S. Tsirkin
  6 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2015-01-19 17:40 UTC (permalink / raw)
  To: Tang Chen
  Cc: zhugh.fnst, mst, hutao, qemu-devel, isimatu.yasuaki, guz.fnst, pbonzini

On Wed, 7 Jan 2015 14:49:40 +0800
Tang Chen <tangchen@cn.fujitsu.com> wrote:

> Memory and CPU hot unplug are both asynchronize procedures.
> When the unplug operation happens, unplug request cb is called first.
> And when ghest OS finished handling unplug, unplug cb will be called
> to do the real removal of device.
> 
> They both need pc-machine, piix4 and ich9 unplug and unplug request cb.
> So this patch set introduces these commom functions as part1, and memory
> and CPU hot-unplug will come soon as part 2 and 3.
> 
> This patch-set is based on QEmu 2.2
Please add SoB to all patches and respin with fixed commit messages.

I've tested it a bit, seem to work as expected.
On respining, You can use my 
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> 
> Tang Chen (5):
>   acpi, pc: Add hotunplug request cb for pc machine.
>   acpi, ich9: Add hotunplug request cb for ich9.
>   acpi, pc: Add unplug cb for pc machine.
>   acpi, ich9: Add unplug cb for ich9.
>   acpi, piix4: Add unplug cb for piix4.
> 
>  hw/acpi/ich9.c         | 14 ++++++++++++++
>  hw/acpi/piix4.c        |  8 ++++++++
>  hw/i386/pc.c           | 16 ++++++++++++++++
>  hw/isa/lpc_ich9.c      | 14 ++++++++++++--
>  include/hw/acpi/ich9.h |  4 ++++
>  5 files changed, 54 insertions(+), 2 deletions(-)
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug.
  2015-01-07  6:49 [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Tang Chen
                   ` (5 preceding siblings ...)
  2015-01-19 17:40 ` [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Igor Mammedov
@ 2015-01-19 21:29 ` Michael S. Tsirkin
  2015-01-20 10:03   ` Igor Mammedov
  6 siblings, 1 reply; 14+ messages in thread
From: Michael S. Tsirkin @ 2015-01-19 21:29 UTC (permalink / raw)
  To: Tang Chen
  Cc: zhugh.fnst, hutao, qemu-devel, isimatu.yasuaki, pbonzini,
	guz.fnst, imammedo

On Wed, Jan 07, 2015 at 02:49:40PM +0800, Tang Chen wrote:
> Memory and CPU hot unplug are both asynchronize procedures.
> When the unplug operation happens, unplug request cb is called first.
> And when ghest OS finished handling unplug, unplug cb will be called
> to do the real removal of device.
> 
> They both need pc-machine, piix4 and ich9 unplug and unplug request cb.
> So this patch set introduces these commom functions as part1, and memory
> and CPU hot-unplug will come soon as part 2 and 3.
> 
> This patch-set is based on QEmu 2.2

OK, Igor - you only have comments for the commit log?
I take this as implicit ack of the patches?
If so pls let me know.

> Tang Chen (5):
>   acpi, pc: Add hotunplug request cb for pc machine.
>   acpi, ich9: Add hotunplug request cb for ich9.
>   acpi, pc: Add unplug cb for pc machine.
>   acpi, ich9: Add unplug cb for ich9.
>   acpi, piix4: Add unplug cb for piix4.
> 
>  hw/acpi/ich9.c         | 14 ++++++++++++++
>  hw/acpi/piix4.c        |  8 ++++++++
>  hw/i386/pc.c           | 16 ++++++++++++++++
>  hw/isa/lpc_ich9.c      | 14 ++++++++++++--
>  include/hw/acpi/ich9.h |  4 ++++
>  5 files changed, 54 insertions(+), 2 deletions(-)
> 
> -- 
> 1.8.4.2

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug.
  2015-01-19 21:29 ` Michael S. Tsirkin
@ 2015-01-20 10:03   ` Igor Mammedov
  2015-01-20 10:40     ` Michael S. Tsirkin
  0 siblings, 1 reply; 14+ messages in thread
From: Igor Mammedov @ 2015-01-20 10:03 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: zhugh.fnst, hutao, qemu-devel, Tang Chen, isimatu.yasuaki,
	guz.fnst, pbonzini

On Mon, 19 Jan 2015 23:29:37 +0200
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Wed, Jan 07, 2015 at 02:49:40PM +0800, Tang Chen wrote:
> > Memory and CPU hot unplug are both asynchronize procedures.
> > When the unplug operation happens, unplug request cb is called first.
> > And when ghest OS finished handling unplug, unplug cb will be called
> > to do the real removal of device.
> > 
> > They both need pc-machine, piix4 and ich9 unplug and unplug request cb.
> > So this patch set introduces these commom functions as part1, and memory
> > and CPU hot-unplug will come soon as part 2 and 3.
> > 
> > This patch-set is based on QEmu 2.2
> 
> OK, Igor - you only have comments for the commit log?
> I take this as implicit ack of the patches?
> If so pls let me know.
Yes, patches themselves are good.
Can fixup commit messages and add author SoBs to them, before
applying or should we wait for respin?


> > Tang Chen (5):
> >   acpi, pc: Add hotunplug request cb for pc machine.
> >   acpi, ich9: Add hotunplug request cb for ich9.
> >   acpi, pc: Add unplug cb for pc machine.
> >   acpi, ich9: Add unplug cb for ich9.
> >   acpi, piix4: Add unplug cb for piix4.
> > 
> >  hw/acpi/ich9.c         | 14 ++++++++++++++
> >  hw/acpi/piix4.c        |  8 ++++++++
> >  hw/i386/pc.c           | 16 ++++++++++++++++
> >  hw/isa/lpc_ich9.c      | 14 ++++++++++++--
> >  include/hw/acpi/ich9.h |  4 ++++
> >  5 files changed, 54 insertions(+), 2 deletions(-)
> > 
> > -- 
> > 1.8.4.2

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug.
  2015-01-20 10:03   ` Igor Mammedov
@ 2015-01-20 10:40     ` Michael S. Tsirkin
  0 siblings, 0 replies; 14+ messages in thread
From: Michael S. Tsirkin @ 2015-01-20 10:40 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: zhugh.fnst, hutao, qemu-devel, Tang Chen, isimatu.yasuaki,
	guz.fnst, pbonzini

On Tue, Jan 20, 2015 at 11:03:02AM +0100, Igor Mammedov wrote:
> On Mon, 19 Jan 2015 23:29:37 +0200
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
> 
> > On Wed, Jan 07, 2015 at 02:49:40PM +0800, Tang Chen wrote:
> > > Memory and CPU hot unplug are both asynchronize procedures.
> > > When the unplug operation happens, unplug request cb is called first.
> > > And when ghest OS finished handling unplug, unplug cb will be called
> > > to do the real removal of device.
> > > 
> > > They both need pc-machine, piix4 and ich9 unplug and unplug request cb.
> > > So this patch set introduces these commom functions as part1, and memory
> > > and CPU hot-unplug will come soon as part 2 and 3.
> > > 
> > > This patch-set is based on QEmu 2.2
> > 
> > OK, Igor - you only have comments for the commit log?
> > I take this as implicit ack of the patches?
> > If so pls let me know.
> Yes, patches themselves are good.
> Can fixup commit messages and add author SoBs to them, before
> applying or should we wait for respin?

I didn't notice signatures were missing.
This is required for inclusion.

Tang Chen, please rebase on top of my pci branch, but also,
we don't include code of uncertain origin.
So - if you can certify the below:

        Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or

        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or

        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.

        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

then you add a line at the end of each commit message saying

        Signed-off-by: Random J Developer <random@developer.example.org>

for each developer who participated in writing this code.


> 
> > > Tang Chen (5):
> > >   acpi, pc: Add hotunplug request cb for pc machine.
> > >   acpi, ich9: Add hotunplug request cb for ich9.
> > >   acpi, pc: Add unplug cb for pc machine.
> > >   acpi, ich9: Add unplug cb for ich9.
> > >   acpi, piix4: Add unplug cb for piix4.
> > > 
> > >  hw/acpi/ich9.c         | 14 ++++++++++++++
> > >  hw/acpi/piix4.c        |  8 ++++++++
> > >  hw/i386/pc.c           | 16 ++++++++++++++++
> > >  hw/isa/lpc_ich9.c      | 14 ++++++++++++--
> > >  include/hw/acpi/ich9.h |  4 ++++
> > >  5 files changed, 54 insertions(+), 2 deletions(-)
> > > 
> > > -- 
> > > 1.8.4.2

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-01-20 10:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-07  6:49 [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Tang Chen
2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 1/5] acpi, pc: Add hotunplug request cb for pc machine Tang Chen
2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 2/5] acpi, ich9: Add hotunplug request cb for ich9 Tang Chen
2015-01-19 17:26   ` Igor Mammedov
2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 3/5] acpi, pc: Add unplug cb for pc machine Tang Chen
2015-01-19 17:29   ` Igor Mammedov
2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 4/5] acpi, ich9: Add unplug cb for ich9 Tang Chen
2015-01-19 17:34   ` Igor Mammedov
2015-01-07  6:49 ` [Qemu-devel] [RESEND PATCH v1 5/5] acpi, piix4: Add unplug cb for piix4 Tang Chen
2015-01-19 17:37   ` Igor Mammedov
2015-01-19 17:40 ` [Qemu-devel] [RESEND PATCH v1 0/5] Common unplug and unplug request cb for memory and CPU hot-unplug Igor Mammedov
2015-01-19 21:29 ` Michael S. Tsirkin
2015-01-20 10:03   ` Igor Mammedov
2015-01-20 10:40     ` Michael S. Tsirkin

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.