From: Xiao Guangrong <guangrong.xiao@linux.intel.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: pbonzini@redhat.com, imammedo@redhat.com, gleb@kernel.org,
mtosatti@redhat.com, stefanha@redhat.com, mst@redhat.com,
rth@twiddle.net, ehabkost@redhat.com, dan.j.williams@intel.com,
kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 1/3] nvdimm acpi: introduce fit buffer
Date: Thu, 3 Nov 2016 17:58:46 +0800 [thread overview]
Message-ID: <924ef0bb-b320-a05c-486d-d2c281fa34fe@linux.intel.com> (raw)
In-Reply-To: <20161103100015.GB5154@stefanha-x1.localdomain>
On 11/03/2016 06:00 PM, Stefan Hajnoczi wrote:
> On Thu, Nov 03, 2016 at 11:51:28AM +0800, Xiao Guangrong wrote:
>> +static void nvdimm_init_fit_buffer(NvdimmFitBuffer *fit_buf)
>> +{
>> + fit_buf->fit = g_array_new(false, true /* clear */, 1);
>> +}
>> +
>> +static void nvdimm_build_fit_buffer(NvdimmFitBuffer *fit_buf)
>> +{
>> + g_array_free(fit_buf->fit, true);
>> + fit_buf->fit = nvdimm_build_device_structure();
>
> In the previous revision I pointed out that it's messy to inline
> g_array_new(false, true /* clear */, 1) in nvdimm_init_fit_buffer() when
> the data structure is normally created by
> nvdimm_build_device_structure(). You didn't respond.
>
Oh, sorry for that.
> Is it possible to call nvdimm_build_device_structure() in
> nvdimm_init_fit_buffer() so we don't need to duplicate the details of
> how the GArray is created?
>
Actually, i tried your suggestion however i noticed it makes the code
little confuse, as we construct the fit by calling
nvdimm_build_device_structure() whose name shows the fit will be
rebuild but do not set .dirty in the init path.
g_array_new(false, true /* clear */, 1) is a more clear way to
show this is just a empty array.
next prev parent reply other threads:[~2016-11-03 10:07 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 3:51 [Qemu-devel] [PATCH v4 0/3] nvdimm: hotplug support Xiao Guangrong
2016-11-03 3:51 ` [Qemu-devel] [PATCH v4 1/3] nvdimm acpi: introduce fit buffer Xiao Guangrong
2016-11-03 10:00 ` Stefan Hajnoczi
2016-11-03 9:58 ` Xiao Guangrong [this message]
2016-11-03 11:02 ` Igor Mammedov
2016-11-03 11:09 ` Xiao Guangrong
2016-11-03 12:29 ` Igor Mammedov
2016-11-03 3:51 ` [Qemu-devel] [PATCH v4 2/3] nvdimm acpi: introduce _FIT Xiao Guangrong
2016-11-03 9:53 ` Stefan Hajnoczi
2016-11-03 10:08 ` Xiao Guangrong
2016-11-03 12:30 ` Igor Mammedov
2016-11-03 11:58 ` Igor Mammedov
2016-11-03 12:21 ` Xiao Guangrong
2016-11-03 13:00 ` Igor Mammedov
2016-11-03 13:02 ` Xiao Guangrong
2016-11-03 14:49 ` Igor Mammedov
2016-11-03 14:53 ` Xiao Guangrong
2016-11-03 16:13 ` Igor Mammedov
2016-11-03 16:17 ` Xiao Guangrong
2016-11-03 16:49 ` Igor Mammedov
2016-11-03 16:53 ` Xiao Guangrong
2016-11-03 17:29 ` Igor Mammedov
2016-11-03 17:39 ` Xiao Guangrong
2016-11-03 17:54 ` Igor Mammedov
2016-11-03 3:51 ` [Qemu-devel] [PATCH v4 3/3] pc: memhp: enable nvdimm device hotplug Xiao Guangrong
2016-11-03 12:51 ` Igor Mammedov
2016-11-03 12:54 ` Xiao Guangrong
2016-11-03 4:14 ` [Qemu-devel] [PATCH v4 0/3] nvdimm: hotplug support Michael S. Tsirkin
2016-11-03 4:25 ` Xiao Guangrong
2016-11-03 4:51 ` 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=924ef0bb-b320-a05c-486d-d2c281fa34fe@linux.intel.com \
--to=guangrong.xiao@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=ehabkost@redhat.com \
--cc=gleb@kernel.org \
--cc=imammedo@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.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).