From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THCog-0003GZ-PM for qemu-devel@nongnu.org; Thu, 27 Sep 2012 08:03:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THCoZ-0006ri-1g for qemu-devel@nongnu.org; Thu, 27 Sep 2012 08:03:42 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THCoY-0006re-Rp for qemu-devel@nongnu.org; Thu, 27 Sep 2012 08:03:34 -0400 Received: by padfb10 with SMTP id fb10so1296508pad.4 for ; Thu, 27 Sep 2012 05:03:34 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5064408F.3020605@redhat.com> Date: Thu, 27 Sep 2012 14:03:27 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1348722865-20564-1-git-send-email-wdongxu@linux.vnet.ibm.com> <1348722865-20564-8-git-send-email-wdongxu@linux.vnet.ibm.com> In-Reply-To: <1348722865-20564-8-git-send-email-wdongxu@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2 7/7] remove QEMUOptionParameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dong Xu Wang Cc: kwolf@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com Il 27/09/2012 07:14, Dong Xu Wang ha scritto: > remove QEMUOptionParameter, and use QemuOpts and QemuOptsList. > > Signed-off-by: Dong Xu Wang > --- > block.c | 88 ++++++------ > block.h | 5 +- > block/Makefile.objs | 9 +- > block/qcow2.c | 175 ++++++++++++----------- > block/raw-posix.c | 68 ++++----- > block/raw.c | 31 +++-- > block_int.h | 6 +- > qemu-config.c | 3 + > qemu-img.c | 58 ++++---- > qemu-option.c | 408 +++++++++++++++------------------------------------ > qemu-option.h | 45 +----- > 11 files changed, 347 insertions(+), 549 deletions(-) The patch is already quite big, so please move the qemu-option.c changes to separate patches. For example, patch 7 could add def_value and use it in qemu_opts_print. Patch 8 should add append_opts_list, free_opts_list, print_opts_list. Patch 9 should touch only the block layer. Patch 10 should remove the now-unuse QEMUOptionParameter code. (Regarding def_value, it is quite unintuitive that you need to specify the value again when calling qemu_opt_get_*. Perhaps, qemu_opts_validate could instead walk through descriptors that are not present but have a default value, and add new options with the default value to the QemuOpts object). Paolo