Received: from eggs.gnu.org ([140.186.70.92]:34045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RL3Zm-0008S0-If for qemu-devel@nongnu.org; Mon, 31 Oct 2011 21:55:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RL3Zl-0006zB-52 for qemu-devel@nongnu.org; Mon, 31 Oct 2011 21:55:42 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:39862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RL3Zk-0006uV-IG for qemu-devel@nongnu.org; Mon, 31 Oct 2011 21:55:41 -0400 Received: from /spool/local by e23smtp08.au.ibm.com with XMail ESMTP for from ; Tue, 1 Nov 2011 01:54:13 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA11qdFh2179276 for ; Tue, 1 Nov 2011 12:52:43 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA11tS4T004641 for ; Tue, 1 Nov 2011 12:55:28 +1100 Date: Tue, 1 Nov 2011 09:54:31 +0800 From: Zhi Yong Wu Message-ID: <20111101015431.GC20321@f15.cn.ibm.com> References: <1320030109-20476-1-git-send-email-wuzhy@linux.vnet.ibm.com> <4EAE57DF.9080602@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] qed: adjust the way to get nb_sectors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Zhi Yong Wu , qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com On Mon, Oct 31, 2011 at 02:11:00PM +0000, Stefan Hajnoczi wrote: >From: Stefan Hajnoczi >To: Zhi Yong Wu >Cc: Kevin Wolf , Zhi Yong Wu , > qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com >Content-Type: text/plain; charset=ISO-8859-1 >x-cbid: 11103114-6148-0000-0000-000000CC1760 >X-IBM-ISS-SpamDetectors: Score=0; BY=0; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; > SC=0; ST=0; TS=0; UL=0; ISC= >X-IBM-ISS-DetailInfo: BY=3.00000227; HX=3.00000175; KW=3.00000007; > PH=3.00000001; SC=3.00000001; SDB=6.00083535; UDB=6.00022970; > UTC=2011-10-31 14:11:03 >X-Xagent-From: stefanha@gmail.com >X-Xagent-To: wuzhy@linux.vnet.ibm.com >X-Xagent-Gateway: vmsdvma.vnet.ibm.com (XAGENTU6 at VMSDVMA) > >On Mon, Oct 31, 2011 at 8:25 AM, Zhi Yong Wu wrote: >> On Mon, Oct 31, 2011 at 4:10 PM, Kevin Wolf wrote: >>> Am 31.10.2011 04:01, schrieb Zhi Yong Wu: >>>> It is better to use qiov.size in qed-table.c to get nb_sectors than iov.iov_len. >>>> >>>> Signed-off-by: Zhi Yong Wu >>> >>> The commit message should probably say why it's better. Not saying >>> otherwise, but I can't see the different at the first sight. >> They are equal, but if the number of iov isn't ONE, they will be not >> equal. qiov.size contains the sum of all iov's size while iov.iov_len >> is only the size of one iov. Although in current scenario, they are >> equal, but i think that it is better if qiov.size is used. > >I see your reasoning. Especially in qed_read_table_cb() it's nice to >use qiov->size because that function doesn't obviously use a single >struct iovec. > >If you want to change it I agree but please send a patch with a proper >explanation that mentions that this is purely a refactoring (does not >change behavior) and why. OK. > >Stefan >