Received: from eggs.gnu.org ([2001:4830:134:3::10]:46865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atr1i-0006s4-6U for qemu-devel@nongnu.org; Sat, 23 Apr 2016 02:26:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atr1h-0003TM-Cn for qemu-devel@nongnu.org; Sat, 23 Apr 2016 02:26:46 -0400 From: Ren Kimura Date: Sat, 23 Apr 2016 15:26:26 +0900 Message-Id: <1461392787-26897-1-git-send-email-rkx1209dev@gmail.com> Subject: [Qemu-devel] [PATCH v4 0/1] qemu-img: check block status of backing file when converting. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mreitz@redhat.com Cc: kwolf@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org I've just changed last patch to new one that uses loop iteration instead of recursion. https://lists.gnu.org/archive/html/qemu-block/2016-04/msg00584.html At first, a head of chain has checked it's status by bdrv_get_block_status in "convert_iteration_sectors". If this status is not BDRV_BLOCK_DATA nor BDRV_BLOCK_ZERO, then check backing files by using new function, get_backing_status. This function iterates backing files chain and return the status BDRV_BLOCK_DATA, BDRV_BLOCK_ZERO or error(< 0) caused by bdrv_get_block_status. When none of backing files has valid status(i.e. backing file which must have data doesn't exist), then return -1(< 0) and goto fail.