From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vu0S3-0000Wz-0g for qemu-devel@nongnu.org; Fri, 20 Dec 2013 08:49:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vu0Ru-0005En-Jh for qemu-devel@nongnu.org; Fri, 20 Dec 2013 08:49:14 -0500 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:51040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vu0Ru-0005Eh-CC for qemu-devel@nongnu.org; Fri, 20 Dec 2013 08:49:06 -0500 Received: by mail-we0-f170.google.com with SMTP id w61so2522937wes.29 for ; Fri, 20 Dec 2013 05:49:05 -0800 (PST) Date: Fri, 20 Dec 2013 14:48:54 +0100 From: Stefan Hajnoczi Message-ID: <20131220134854.GA9296@stefanha-thinkpad.redhat.com> References: <1386244972-528-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1386244972-528-3-git-send-email-xiawenc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1386244972-528-3-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH V7 2/6] qcow2: add error message in qcow2_write_snapshots() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com On Thu, Dec 05, 2013 at 08:02:48PM +0800, Wenchao Xia wrote: > @@ -227,24 +236,40 @@ static int qcow2_write_snapshots(BlockDriverState *bs) > > ret = bdrv_pwrite(bs->file, offset, &h, sizeof(h)); > if (ret < 0) { > + error_setg_errno(errp, -ret, > + "Failed in write of snapshot header at %" > + PRIi64 " with size %d", > + offset, (int)sizeof(h)); The casts in this patch are not necessary: size_t == %zu ssize_t == %zd (Very minor point but in case you respin)