From patchwork Tue Mar 11 03:07:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunyan Liu X-Patchwork-Id: 328906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F0A1E2C00AB for ; Tue, 11 Mar 2014 14:08:09 +1100 (EST) Received: from localhost ([::1]:52096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WND2z-00085O-1L for incoming@patchwork.ozlabs.org; Mon, 10 Mar 2014 23:08:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WND2h-00085I-Hh for qemu-devel@nongnu.org; Mon, 10 Mar 2014 23:07:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WND2f-00081U-IA for qemu-devel@nongnu.org; Mon, 10 Mar 2014 23:07:47 -0400 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]:39845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WND2f-000816-6c for qemu-devel@nongnu.org; Mon, 10 Mar 2014 23:07:45 -0400 Received: by mail-wg0-f49.google.com with SMTP id a1so5291157wgh.20 for ; Mon, 10 Mar 2014 20:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=PryL+3UXSBOIhB6ulY0p/q6UDon24lU+BmHyksCuiJk=; b=e6fDYDfOzr+zrNZwe6Cp2H5+jEV7I/G+8L91yFiicP2u3O+tTCNoHSAQyBjkcvZtyN 8bYUHMcdMKMcix9Wn+zvprREGh3QsLAsfLEC/oDalzHeu4jixhqv6JOvpsPUz8rfVry8 dmf2HyJdlRHlDhKpPo1RSjEzeH50INqItbppJZUxjAdVrrxdMGqE8iW3+JIP0MSb9B5W oK8oEeNL6+Zg/mSG3opHIwsHpTwFjrKDdd1B3jDF7L0xkRmEYzmYGqtPbejrKNHGh/nx ee72K+OGay3lAc72FsjOYBA0/5mbuX4kizBebnWLFjnO0MlvTZDfgBjKPJVDU4s+MMxD mr8w== MIME-Version: 1.0 X-Received: by 10.180.101.230 with SMTP id fj6mr1053483wib.27.1394507263569; Mon, 10 Mar 2014 20:07:43 -0700 (PDT) Received: by 10.217.132.65 with HTTP; Mon, 10 Mar 2014 20:07:43 -0700 (PDT) In-Reply-To: <20140310202231.GA16613@stefanha-thinkpad.redhat.com> References: <1394436721-21812-1-git-send-email-cyliu@suse.com> <20140310202231.GA16613@stefanha-thinkpad.redhat.com> Date: Tue, 11 Mar 2014 11:07:43 +0800 X-Google-Sender-Auth: jUrbvtF3woFsSVowiP2ga1VFgfU Message-ID: From: Chunyan Liu To: Stefan Hajnoczi X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::231 Cc: Kevin Wolf , qemu-devel@nongnu.org, stefanha@redhat.com Subject: Re: [Qemu-devel] [PATCH v22 00/25] replace QEMUOptionParameter with QemuOpts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 2014-03-11 4:22 GMT+08:00 Stefan Hajnoczi : > On Mon, Mar 10, 2014 at 03:31:36PM +0800, Chunyan Liu wrote: > > This patch series is to replace QEMUOptionParameter with QemuOpts, so > that only > > one Qemu Option structure is kept in QEMU code. > > > > --- > > Changes to v21: > > * update verison info in patch 2/25 > > * others are not changed except for rebase > > > > Chunyan Liu (25): > > add def_value_str to QemuOptDesc > > qapi: output def_value_str when query command line options > > improve some functions in qemu-option.c > > improve assertion in qemu_opt_get functions > > add some QemuOpts functions for replace work > > add convert functions between QEMUOptionParameter to QemuOpts > > change block layer to support both QemuOpts and QEMUOptionParamter > > cow.c: replace QEMUOptionParameter with QemuOpts > > gluster.c: replace QEMUOptionParameter with QemuOpts > > iscsi.c: replace QEMUOptionParameter with QemuOpts > > qcow.c: replace QEMUOptionParameter with QemuOpts > > qcow2.c: replace QEMUOptionParameter with QemuOpts > > qed.c: replace QEMUOptionParameter with QemuOpts > > raw-posix.c: replace QEMUOptionParameter with QemuOpts > > raw-win32.c: replace QEMUOptionParameter with QemuOpts > > raw_bsd.c: replace QEMUOptionParameter with QemuOpts > > rbd.c: replace QEMUOptionParameter with QemuOpts > > sheepdog.c: replace QEMUOptionParameter with QemuOpts > > ssh.c: replace QEMUOptionParameter with QemuOpts > > vdi.c: replace QEMUOptionParameter with QemuOpts > > vmdk.c: replace QEMUOptionParameter with QemuOpts > > vpc.c: replace QEMUOptionParameter with QemuOpts > > vhdx.c: replace QEMUOptionParameter with QemuOpts > > vvfat.c: replace QEMUOptionParameter with QemuOpts > > cleanup QEMUOptionParameter > > > > block.c | 96 ++++---- > > block/cow.c | 52 ++--- > > block/gluster.c | 73 +++--- > > block/iscsi.c | 29 ++- > > block/qcow.c | 72 +++--- > > block/qcow2.c | 325 +++++++++++++------------- > > block/qed.c | 112 ++++----- > > block/qed.h | 3 +- > > block/raw-posix.c | 55 ++--- > > block/raw-win32.c | 38 +-- > > block/raw_bsd.c | 25 +- > > block/rbd.c | 61 +++-- > > block/sheepdog.c | 102 ++++---- > > block/ssh.c | 30 ++- > > block/vdi.c | 70 +++--- > > block/vhdx.c | 97 ++++---- > > block/vhdx.h | 1 + > > block/vmdk.c | 121 +++++----- > > block/vpc.c | 60 ++--- > > block/vvfat.c | 10 +- > > include/block/block.h | 7 +- > > include/block/block_int.h | 9 +- > > include/qemu/option.h | 56 +---- > > include/qemu/option_int.h | 4 +- > > qapi-schema.json | 6 +- > > qemu-img.c | 89 ++++--- > > qmp-commands.hx | 2 + > > util/qemu-config.c | 4 + > > util/qemu-option.c | 576 > ++++++++++++++++++++++------------------------ > > 29 files changed, 1060 insertions(+), 1125 deletions(-) > > Looks like this needs to be rebased onto qemu.git/master: > > qapi/string-input-visitor.c: In function ‘parse_type_size’: > qapi/string-input-visitor.c:53:9: error: implicit declaration of function > ‘parse_option_size’ [-Werror=implicit-function-declaration] > parse_option_size(name, siv->string, &val, &err); > ^ > I've updated the patch series in github: https://github.com/chunyanliu/qemu/commits/QemuOpts updated 25/25. > qapi/string-input-visitor.c:53:9: error: nested extern declaration of > ‘parse_option_size’ [-Werror=nested-externs] > cc1: all warnings being treated as errors > make: *** [qapi/string-input-visitor.o] Error 1 > make: *** Waiting for unfinished jobs.... > qapi/opts-visitor.c: In function ‘opts_start_struct’: > qapi/opts-visitor.c:146:31: error: assignment discards ‘const’ qualifier > from pointer target type [-Werror] > ov->fake_id_opt->name = "id"; > ^ > following patch squashed to 03/25: --- qapi/opts-visitor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) } @@ -177,6 +177,8 @@ opts_end_struct(Visitor *v, Error **errp) } g_hash_table_destroy(ov->unprocessed_opts); ov->unprocessed_opts = NULL; + g_free(ov->fake_id_opt->name); + g_free(ov->fake_id_opt->str); g_free(ov->fake_id_opt); ov->fake_id_opt = NULL; } diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 5d830a2..e6a295a 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -143,8 +143,8 @@ opts_start_struct(Visitor *v, void **obj, const char *kind, if (ov->opts_root->id != NULL) { ov->fake_id_opt = g_malloc0(sizeof *ov->fake_id_opt); - ov->fake_id_opt->name = "id"; - ov->fake_id_opt->str = ov->opts_root->id; + ov->fake_id_opt->name = g_strdup("id"); + ov->fake_id_opt->str = g_strdup(ov->opts_root->id); opts_visitor_insert(ov->unprocessed_opts, ov->fake_id_opt); }