From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGTOg-0002Rq-QL for qemu-devel@nongnu.org; Fri, 04 Dec 2009 03:20:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGTOb-0002Jg-KL for qemu-devel@nongnu.org; Fri, 04 Dec 2009 03:20:13 -0500 Received: from [199.232.76.173] (port=33723 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGTOb-0002Ja-HK for qemu-devel@nongnu.org; Fri, 04 Dec 2009 03:20:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11509) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGTOb-0004RU-1Q for qemu-devel@nongnu.org; Fri, 04 Dec 2009 03:20:09 -0500 Message-ID: <4B18C5F2.50100@redhat.com> Date: Fri, 04 Dec 2009 09:18:58 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/4] Rename DriveInfo.onerror to on_write_error References: <1259324739-6805-1-git-send-email-kwolf@redhat.com> <1259324739-6805-2-git-send-email-kwolf@redhat.com> <20091129104654.GB30150@redhat.com> <4B1817C7.3000804@codemonkey.ws> In-Reply-To: <4B1817C7.3000804@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Gleb Natapov Am 03.12.2009 20:55, schrieb Anthony Liguori: > Gleb Natapov wrote: >> On Fri, Nov 27, 2009 at 01:25:36PM +0100, Kevin Wolf wrote: >> >>> Either rename variables and functions to refer to write errors (which is what >>> they actually do) or introduce a parameter to distinguish reads and writes. >>> >>> >> I prefer either to use two different functions or hide 0/1 parameter behind >> a macro: >> #define drive_get_on_write_error(a) drive_get_on_error(a, 0); >> > > Or a static inline. But honestly, having three globally scoped > functions shouldn't be a problem. Well, in the end, the callers already have some kind of is_read and just pass it on. Would we really gain anything if they needed to put a five-line if block there instead of a one-line function call (or maybe two lines if they need to extract the is_read flag from somewhere)? So, I'm happy to add your static inline functions, but I wouldn't like to use them... Kevin