From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3cRB-0002Jq-77 for qemu-devel@nongnu.org; Tue, 03 Jun 2008 15:44:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3cRA-0002JJ-GI for qemu-devel@nongnu.org; Tue, 03 Jun 2008 15:44:52 -0400 Received: from [199.232.76.173] (port=55111 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3cN9-0000wb-ER for qemu-devel@nongnu.org; Tue, 03 Jun 2008 15:40:43 -0400 Received: from mail2.shareable.org ([80.68.89.115]:57480) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K3cN9-0005tj-9J for qemu-devel@nongnu.org; Tue, 03 Jun 2008 15:40:43 -0400 Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from ) id 1K3cN7-0002FH-PT for qemu-devel@nongnu.org; Tue, 03 Jun 2008 20:40:41 +0100 Date: Tue, 3 Jun 2008 20:40:41 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] New qemu-img convert -B option to preserve the COW aspect of images and/or re-base them Message-ID: <20080603194041.GE6899@shareable.org> References: <48459641.5040000@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48459641.5040000@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori wrote: > >+ if (!bs->drv->bdrv_is_allocated) { > >+ if (sector_num >= bs->total_sectors) { > >+ *pnum = 0; > >+ return 0; > >+ } > >+ int64_t n = bs->total_sectors - sector_num; > > Don't mix declarations with code. Suggest: compile with "gcc -Wdeclaration-after-statement". Though, since declarations after statements are supported by GCC 3.0+ (according to "man gcc"), and GCC is required to compile QEMU... perhaps it's not such a bad thing to allow it/ -- Jamie