From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws6yA-0007OB-8x for qemu-devel@nongnu.org; Wed, 04 Jun 2014 04:54:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ws6y2-0007SZ-GK for qemu-devel@nongnu.org; Wed, 04 Jun 2014 04:54:50 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:55042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws6y2-0007SJ-8n for qemu-devel@nongnu.org; Wed, 04 Jun 2014 04:54:42 -0400 Received: by mail-wi0-f171.google.com with SMTP id cc10so8048554wib.4 for ; Wed, 04 Jun 2014 01:54:41 -0700 (PDT) Date: Wed, 4 Jun 2014 10:54:36 +0200 From: Stefan Hajnoczi Message-ID: <20140604085436.GA26902@stefanha-thinkpad.redhat.com> References: <1399456738-11132-1-git-send-email-cyliu@suse.com> <1399456738-11132-8-git-send-email-cyliu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1399456738-11132-8-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH v27 07/33] QemuOpts: add qemu_opt_get_*_del functions for replace work List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu Cc: qemu-devel@nongnu.org, stefanha@redhat.com, l@dorileo.org On Wed, May 07, 2014 at 05:58:32PM +0800, Chunyan Liu wrote: > diff --git a/util/qemu-option.c b/util/qemu-option.c > index 4d2d4d1..32e1d50 100644 > --- a/util/qemu-option.c > +++ b/util/qemu-option.c > @@ -575,6 +575,19 @@ static void qemu_opt_del(QemuOpt *opt) > g_free(opt); > } > > +/* qemu_opt_set allows many settings for the same option. > + * This function deletes all settings for an option. > + */ > +static void qemu_opt_del_all(QemuOpts *opts, const char *name) > +{ > + QemuOpt *opt, *next_opt; > + > + QTAILQ_FOREACH_SAFE(opt, &opts->head, next, next_opt) { > + if (!strcmp(opt->name, name)) > + qemu_opt_del(opt); QEMU coding style always uses curlies, even when the if body is only one statement. Please use scripts/checkpatch.pl to scan your patches before they are sent. I can fix this up while merging. No need to resend.