From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYm1C-00036P-V0 for qemu-devel@nongnu.org; Sun, 06 Sep 2015 22:18:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYm1C-0007gk-4u for qemu-devel@nongnu.org; Sun, 06 Sep 2015 22:18:50 -0400 References: <1441183880-26993-1-git-send-email-wency@cn.fujitsu.com> <1441183880-26993-6-git-send-email-wency@cn.fujitsu.com> <55E74780.4040804@redhat.com> From: Wen Congyang Message-ID: <55ECF3E7.7090001@cn.fujitsu.com> Date: Mon, 7 Sep 2015 10:18:15 +0800 MIME-Version: 1.0 In-Reply-To: <55E74780.4040804@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/16] introduce a new API qemu_opts_absorb_qdict_by_index() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu devel , Fam Zheng , Max Reitz , Paolo Bonzini , Stefan Hajnoczi Cc: Kevin Wolf , zhanghailiang , qemu block , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , "Michael R. Hines" , Gonglei , Yang Hongyang On 09/03/2015 03:01 AM, Eric Blake wrote: > On 09/02/2015 02:51 AM, Wen Congyang wrote: >> Signed-off-by: Wen Congyang >> Signed-off-by: zhanghailiang >> Signed-off-by: Gonglei > > Commit message is a bit sparse. > >> --- >> include/qemu/option.h | 2 ++ >> util/qemu-option.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 46 insertions(+) >> > > Missing testsuite exposure of the new function. Do you mean: update tests/test-qemu-opts.c? > >> /* >> + * Adds all QDict entries to the QemuOpts that can be added and removes them >> + * from the QDict. The key starts with "%index." in the %qdict. When this > > "%index." reads awkwardly (I thought it was a printf-style format). But > I'm not sure if "starts with %index followed by '.'" is any better. The other comments use '@'. I will update it in the next version. > >> + * function returns, the QDict contains only those entries that couldn't be >> + * added to the QemuOpts. >> + */ >> +void qemu_opts_absorb_qdict_by_index(QemuOpts *opts, QDict *qdict, >> + const char *index, Error **errp) >> +{ > > I didn't review the algorithm closely, but here's a superficial comment: > >> + const QDictEntry *entry, *next; >> + const char *key; >> + int len = strlen(index); > > size_t OK, will fix it in the next version. Thanks Wen Congyang >