From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [Qemu-devel] [PATCH v8 1/4] block: add the block queue support Date: Mon, 17 Oct 2011 12:17:54 +0200 Message-ID: <4E9C00D2.1040004@redhat.com> References: <1315476668-19812-1-git-send-email-wuzhy@linux.vnet.ibm.com> <1315476668-19812-2-git-send-email-wuzhy@linux.vnet.ibm.com> <4E7CA6A6.10500@redhat.com> <4E9C00CB.8080003@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org To: kvm@vger.kernel.org Return-path: Received: from lo.gmane.org ([80.91.229.12]:36651 "EHLO lo.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755269Ab1JQKSL (ORCPT ); Mon, 17 Oct 2011 06:18:11 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RFkGo-0004ZV-AB for kvm@vger.kernel.org; Mon, 17 Oct 2011 12:18:10 +0200 Received: from 93-34-218-143.ip51.fastwebnet.it ([93.34.218.143]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Oct 2011 12:18:10 +0200 Received: from pbonzini by 93-34-218-143.ip51.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Oct 2011 12:18:10 +0200 In-Reply-To: <4E9C00CB.8080003@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/17/2011 12:17 PM, Kevin Wolf wrote: > > > > + > > > > +static int qemu_block_queue_handler(BlockQueueAIOCB *request) > > > > +{ > > > > + int ret; > > > > + BlockDriverAIOCB *res; > > > > + > > > > + res = request->handler(request->common.bs, request->sector_num, > > > > + request->qiov, request->nb_sectors, > > > > + qemu_block_queue_callback, request); > > > > + if (res) { > > > > + request->real_acb = res; > > > > + } > > > > + > > > > + ret = (res == NULL) ? 0 : 1; > > > > + > > > > + return ret; > > > > > > You mean return (res != NULL); and want to have bool as the return value > > > of this function. > > > > Yeah, thanks. i will modify as below: > > ret = (res == NULL) ? false : true; > > ret = (res != NULL) is really more readable. "return (res != NULL);" is even nicer! :) Paolo