From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKTqB-0001kB-Iz for qemu-devel@nongnu.org; Sat, 27 Jun 2009 05:04:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKTq7-0001ju-0B for qemu-devel@nongnu.org; Sat, 27 Jun 2009 05:04:54 -0400 Received: from [199.232.76.173] (port=58343 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKTq6-0001jr-QV for qemu-devel@nongnu.org; Sat, 27 Jun 2009 05:04:50 -0400 Received: from mx2.redhat.com ([66.187.237.31]:46699) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MKTq6-00010Q-7R for qemu-devel@nongnu.org; Sat, 27 Jun 2009 05:04:50 -0400 Message-ID: <4A45DFF5.6080909@redhat.com> Date: Sat, 27 Jun 2009 11:01:41 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] qcow2: Cache refcount blocks during snapshot creation References: <1246040378-4134-1-git-send-email-kwolf@redhat.com> <20090626184806.GE1119@codesourcery.com> In-Reply-To: <20090626184806.GE1119@codesourcery.com> 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: Nathan Froyd Cc: qemu-devel@nongnu.org Nathan Froyd schrieb: > On Fri, Jun 26, 2009 at 08:19:38PM +0200, Kevin Wolf wrote: >> + if (s->refcount_block_cache_offset == 0) { >> + return 0; >> + } >> + >> + if (bdrv_pwrite(s->hd, s->refcount_block_cache_offset, >> + s->refcount_block_cache, size) != size) >> + { > > Nit: bad formatting for opening brace here. Oh, I like nitpicking. The coding style says: "The opening brace is on the line that contains the control flow statement that introduces the new block". No way to conform here without breaking the 80 characters limit, so I did what I think is most reasonable. ;-) I guess you mean something like the following: if (bdrv_pwrite(s->hd, s->refcount_block_cache_offset, s->refcount_block_cache, size) != size) { do_it(); } I don't like this very much because you can't see from the indentation where the condition ends and the "then" branch begins (which is different from a single-line condition). Maybe something to clarify in the coding style and I'll happily follow it then. Kevin