From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAI13-0007X1-7v for qemu-devel@nongnu.org; Thu, 14 Apr 2011 04:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAI12-0005TM-6s for qemu-devel@nongnu.org; Thu, 14 Apr 2011 04:35:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAI11-0005TB-Si for qemu-devel@nongnu.org; Thu, 14 Apr 2011 04:35:04 -0400 Message-ID: <4DA6B246.4080302@redhat.com> Date: Thu, 14 Apr 2011 10:37:26 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <20110411083304.GB22987@stefanha-thinkpad.localdomain> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Question about total_sectors in block/vpc.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lyu Mitnick Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, Christoph Hellwig Am 13.04.2011 22:59, schrieb Lyu Mitnick: > Hello Stefan, > > I have a question about get_option_parameter(). I am wondering whether > get_option_parameter is suitable to use instead of doing the search by > myself > in the case like following: > > /* Read out options */ > while (options && options->name) { > if (!strcmp(options->name, BLOCK_OPT_SIZE)) { > // do something > } else if (!strcmp(options->name, BLOCK_OPT_CLUSTER_SIZE)) { > // do something > } > options++; > } Yes, I think it is, though you need to check whether the option has been set in order to allow use default values. Kevin