qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Wei Yang <richardw.yang@linux.intel.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, imammedo@redhat.com, xiaoguangrong.eric@gmail.com
Subject: Re: [Qemu-devel] [PATCH v2 2/3] mem/nvdimm: remove nvdimm_realize
Date: Wed, 20 Feb 2019 02:21:35 +0100	[thread overview]
Message-ID: <41b3ffb8-cdca-28d6-db1f-264fce9096f1@redhat.com> (raw)
In-Reply-To: <20190220005124.24224-3-richardw.yang@linux.intel.com>

On 2/20/19 1:51 AM, Wei Yang wrote:
> nvdimm_realize is used to prepare its memory region, while this is done
> in pre_plug stage.

Via the device parent:

pc_dimm_pre_plug()
 -> memory_device_pre_plug()
     -> MemoryDeviceClass::get_memory_region()
        nvdimm_md_get_memory_region()

> 
> This is time to remove it.
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> 
> ---
> v2: split nvdimm part here
> ---
>  hw/mem/nvdimm.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
> index bf2adf5e16..8f69576926 100644
> --- a/hw/mem/nvdimm.c
> +++ b/hw/mem/nvdimm.c
> @@ -136,15 +136,6 @@ static MemoryRegion *nvdimm_md_get_memory_region(MemoryDeviceState *md,
>      return nvdimm->nvdimm_mr;
>  }
>  
> -static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
> -{
> -    NVDIMMDevice *nvdimm = NVDIMM(dimm);
> -
> -    if (!nvdimm->nvdimm_mr) {
> -        nvdimm_prepare_memory_region(nvdimm, errp);
> -    }
> -}
> -
>  /*
>   * the caller should check the input parameters before calling
>   * label read/write functions.
> @@ -192,12 +183,10 @@ static Property nvdimm_properties[] = {
>  
>  static void nvdimm_class_init(ObjectClass *oc, void *data)
>  {
> -    PCDIMMDeviceClass *ddc = PC_DIMM_CLASS(oc);
>      MemoryDeviceClass *mdc = MEMORY_DEVICE_CLASS(oc);
>      NVDIMMClass *nvc = NVDIMM_CLASS(oc);
>      DeviceClass *dc = DEVICE_CLASS(oc);
>  
> -    ddc->realize = nvdimm_realize;
>      mdc->get_memory_region = nvdimm_md_get_memory_region;
>      dc->props = nvdimm_properties;
>  
> 

  reply	other threads:[~2019-02-20  1:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20  0:51 [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup Wei Yang
2019-02-20  0:51 ` [Qemu-devel] [PATCH v2 1/3] pc-dimm: remove check on pc-dimm hotpluggable Wei Yang
2019-02-20  1:13   ` Philippe Mathieu-Daudé
2019-02-20  0:51 ` [Qemu-devel] [PATCH v2 2/3] mem/nvdimm: remove nvdimm_realize Wei Yang
2019-02-20  1:21   ` Philippe Mathieu-Daudé [this message]
2019-02-20  0:51 ` [Qemu-devel] [PATCH v2 3/3] pc-dimm: revert "introduce realize callback" Wei Yang
2019-02-20  1:26   ` Philippe Mathieu-Daudé
2019-02-20  1:39     ` Wei Yang
2019-02-21  6:03 ` [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup Xiao Guangrong
2019-02-21  6:13   ` Wei Yang
2019-02-21 14:50 ` Igor Mammedov
2019-02-23  0:02   ` Wei Yang
2019-02-25  8:05     ` Igor Mammedov
2019-02-25 12:47       ` Wei Yang
2019-02-27 13:12         ` Igor Mammedov
2019-02-27 13:59           ` Wei Yang
2019-02-27 17:27             ` Igor Mammedov
2019-02-27 21:25               ` Wei Yang
2019-02-28  0:46               ` Wei Yang
2019-02-28 13:57                 ` Igor Mammedov
2019-03-01  1:23                   ` Wei Yang
2019-02-21 16:58 ` 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=41b3ffb8-cdca-28d6-db1f-264fce9096f1@redhat.com \
    --to=philmd@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richardw.yang@linux.intel.com \
    --cc=xiaoguangrong.eric@gmail.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).