From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGDJ-00010U-L5 for qemu-devel@nongnu.org; Mon, 03 Nov 2014 06:54:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlGDD-0001CT-GP for qemu-devel@nongnu.org; Mon, 03 Nov 2014 06:54:25 -0500 Message-ID: <54576CD8.8070104@huawei.com> Date: Mon, 3 Nov 2014 19:54:00 +0800 From: zhanghailiang MIME-Version: 1.0 References: <1413535838-11000-1-git-send-email-zhang.zhanghailiang@huawei.com> <5440DB35.9020507@huawei.com> <54484C88.3070305@huawei.com> <544E12FB.6070904@huawei.com> <20141027084659.13cbdf8a@redhat.com> <5451F52A.7050305@huawei.com> <5455D735.2030202@msgid.tls.msk.ru> In-Reply-To: <5455D735.2030202@msgid.tls.msk.ru> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH v6] numa: make 'info numa' take into account hotplugged memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: qemu-trivial@nongnu.org, luonengjun@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com, Gonglei , pbonzini@redhat.com, imammedo@redhat.com, Luiz Capitulino On 2014/11/2 15:03, Michael Tokarev wrote: > 30.10.2014 11:22, zhanghailiang wrote: >> Hi Michael, >> >> Can you help applying this patch to -trivial branch? >> It has been reviewed, and it mainly fix bug for hmp command of 'info numa'. >> Which i don't know if it should go qemu-stable, for this is not a blocker. >> >> Maybe go trivial branch is a better choice. > > And the original patch description is: > >>>>>>> When do memory hotplug, if there is numa node, we should add >>>>>>> the memory size to the corresponding node memory size. >>>>>>> >>>>>>> For now, it mainly affects the result of hmp command "info numa". > > What does the "for now" means in this context? Is the patch > incpmplete somehow and we should expect more code in this > area/theme? > Hmm, yes, it not exact, i should remove the confused context. > In the patch we have: > > +void query_numa_node_mem(uint64_t *node_mem) > +{ > + int i; > + > + if (nb_numa_nodes <= 0) { > + return; > + } > + > + numa_stat_memory_devices(node_mem); > + for (i = 0; i < nb_numa_nodes; i++) { > + node_mem[i] += numa_info[i].node_mem; > + } > +} > > Please note that while the node_mem is a pointer, it is used as > an array. In C, pointers and arrays in this context is the same > thing, but I think it is better to make the fact that it is an > array explicit in the function prototype, to be like this: > > +void query_numa_node_mem(uint64_t node_mem[]) > Good idea;), it is more clear. > (But I don't know how various tools like coverity et al will react > to this. Gcc and any other C compiler should be fine). > I will look into this. > The same stands for other function prototype. > > I'm not sure this qualifies as -trivial really. Yes the change > does not affect anything but the `info' command, and is rather > simple, but... I'm not sure. > Hmm, this a tangled thing.:(