From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNQop-0002ZC-HI for qemu-devel@nongnu.org; Tue, 11 Mar 2014 13:50:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNQod-0005Y4-Hu for qemu-devel@nongnu.org; Tue, 11 Mar 2014 13:50:23 -0400 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:33575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNQod-0005Xo-Ax for qemu-devel@nongnu.org; Tue, 11 Mar 2014 13:50:11 -0400 Received: by mail-ea0-f176.google.com with SMTP id o10so4460852eaj.7 for ; Tue, 11 Mar 2014 10:50:10 -0700 (PDT) Date: Tue, 11 Mar 2014 18:50:07 +0100 From: Stefan Hajnoczi Message-ID: <20140311175007.GT7761@stefanha-thinkpad.redhat.com> References: <1394436721-21812-1-git-send-email-cyliu@suse.com> <1394436721-21812-21-git-send-email-cyliu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1394436721-21812-21-git-send-email-cyliu@suse.com> Subject: Re: [Qemu-devel] [PATCH v22 20/25] vdi.c: replace QEMUOptionParameter with QemuOpts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu Cc: kwolf@redhat.com, Dong Xu Wang , qemu-devel@nongnu.org, stefanha@redhat.com On Mon, Mar 10, 2014 at 03:31:56PM +0800, Chunyan Liu wrote: > @@ -669,25 +668,17 @@ static int vdi_create(const char *filename, QEMUOptionParameter *options, > logout("\n"); > > /* Read out options. */ > - while (options && options->name) { > - if (!strcmp(options->name, BLOCK_OPT_SIZE)) { > - bytes = options->value.n; > + bytes = qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0); > #if defined(CONFIG_VDI_BLOCK_SIZE) > - } else if (!strcmp(options->name, BLOCK_OPT_CLUSTER_SIZE)) { > - if (options->value.n) { > - /* TODO: Additional checks (SECTOR_SIZE * 2^n, ...). */ > - block_size = options->value.n; > - } > + block_size = qemu_opt_get_size_del(opts, > + BLOCK_OPT_CLUSTER_SIZE, > + DEFAULT_CLUSTER_SIZE); Please keep the TODO.