All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Tang Chen <tangchen@cn.fujitsu.com>
Cc: zhugh.fnst@cn.fujitsu.com, mst@redhat.com, hutao@cn.fujitsu.com,
	qemu-devel@nongnu.org, isimatu.yasuaki@jp.fujitsu.com,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [RESEND PATCH v3 3/8] pc: Add memory hot unplug support for pc machine.
Date: Thu, 4 Sep 2014 15:16:56 +0200	[thread overview]
Message-ID: <20140904151656.4882973d@nial.usersys.redhat.com> (raw)
In-Reply-To: <20140904144441.6a88b757@nial.usersys.redhat.com>

On Thu, 4 Sep 2014 14:44:41 +0200
Igor Mammedov <imammedo@redhat.com> wrote:

> On Wed, 27 Aug 2014 16:08:34 +0800
> Tang Chen <tangchen@cn.fujitsu.com> wrote:
> 
> > From: Hu Tao <hutao@cn.fujitsu.com>
> > 
> > Implement device unplug callback for PCMachine. And it now only support
> > pc-dimm hot-remove. The callback will call piix4 or ich9 callbacks introduced
> > in previous patches.
> > 
> > Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> > Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
> > ---
> >  hw/i386/pc.c | 32 ++++++++++++++++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index 8fa8d2f..8bafe7c 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -61,6 +61,8 @@
> >  #include "hw/mem/pc-dimm.h"
> >  #include "trace.h"
> >  #include "qapi/visitor.h"
> > +#include "hw/acpi/piix4.h"
> > +#include "hw/i386/ich9.h"
> >  
> >  /* debug PC/ISA interrupts */
> >  //#define DEBUG_IRQ
> > @@ -1607,6 +1609,27 @@ out:
> >      error_propagate(errp, local_err);
> >  }
> >  
> > +static void pc_dimm_unplug(HotplugHandler *hotplug_dev,
> > +                           DeviceState *dev, Error **errp)
> > +{
> > +    Object *acpi_dev;
> > +    HotplugHandlerClass *hhc;
> > +    Error *local_err = NULL;
> > +
> > +    acpi_dev = (acpi_dev = piix4_pm_find()) ? acpi_dev : ich9_lpc_find();
> > +    if (!acpi_dev) {
> > +        error_setg(&local_err,
> > +                   "memory hotplug is not enabled: missing acpi device");
> > +        error_propagate(errp, local_err);
> > +        return;
> > +    }
> drop/replace above block, see: "if (!pcms->acpi_dev) {" for reference
> 
> > +
> > +    hhc = HOTPLUG_HANDLER_GET_CLASS(acpi_dev);
> > +    hhc->unplug(HOTPLUG_HANDLER(acpi_dev), dev, &local_err);
> 
> you should take care about dev's vmstate here, that was registered in pc_dimm_plug()
I'm wrong here, vmstate_unregister should take place at pc_dimm unrealize time,

hhc->unplug handler is more like unplug_request handler,
perhaps we need to give some thought to renaming it to unplug_request to avoid confusion
and have an optional unplug callback that could do tear-down with HotplugHandler if needed
before device is unrealized.

  reply	other threads:[~2014-09-04 13:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27  8:08 [Qemu-devel] [RESEND PATCH v3 0/8] QEmu memory hot unplug support Tang Chen
2014-08-27  8:08 ` [Qemu-devel] [RESEND PATCH v3 1/8] acpi, piix4: Add memory hot unplug support for piix4 Tang Chen
2014-09-04 12:15   ` Igor Mammedov
2014-09-16  3:17     ` Tang Chen
2014-08-27  8:08 ` [Qemu-devel] [RESEND PATCH v3 2/8] acpi, ich9: Add memory hot unplug support for ich9 Tang Chen
2014-09-04 12:25   ` Igor Mammedov
2014-09-16  3:18     ` Tang Chen
2014-08-27  8:08 ` [Qemu-devel] [RESEND PATCH v3 3/8] pc: Add memory hot unplug support for pc machine Tang Chen
2014-09-04 12:44   ` Igor Mammedov
2014-09-04 13:16     ` Igor Mammedov [this message]
2014-08-27  8:08 ` [Qemu-devel] [RESEND PATCH v3 4/8] qdev: Add memory hot unplug support for bus-less devices Tang Chen
2014-09-04 13:22   ` Igor Mammedov
2014-09-16  8:42     ` Tang Chen
2014-08-27  8:08 ` [Qemu-devel] [RESEND PATCH v3 5/8] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support Tang Chen
2014-09-04 13:28   ` Igor Mammedov
2014-09-12  5:30     ` zhanghailiang
2014-09-12 13:17       ` Igor Mammedov
2014-09-24  7:02         ` Tang Chen
2014-08-27  8:08 ` [Qemu-devel] [RESEND PATCH v3 6/8] acpi: Add hardware implementation for memory hot unplug Tang Chen
2014-09-04 14:20   ` Igor Mammedov
2014-09-16 10:12     ` Tang Chen
2014-09-16 11:34       ` Igor Mammedov
2014-08-27  8:08 ` [Qemu-devel] [RESEND PATCH v3 7/8] pc, acpi bios: Add memory hot unplug interface Tang Chen
2014-09-04 13:53   ` Igor Mammedov
2014-08-27  8:08 ` [Qemu-devel] [RESEND PATCH v3 8/8] monitor: Add memory hot unplug support for device_del command Tang Chen
2014-09-04 14:02   ` 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=20140904151656.4882973d@nial.usersys.redhat.com \
    --to=imammedo@redhat.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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 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.