From patchwork Mon Sep 9 02:58:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 273472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CAEF02C0126 for ; Mon, 9 Sep 2013 12:59:18 +1000 (EST) Received: from localhost ([::1]:47388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIrh7-0005hq-0h for incoming@patchwork.ozlabs.org; Sun, 08 Sep 2013 22:59:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIrgQ-0005V2-K6 for qemu-devel@nongnu.org; Sun, 08 Sep 2013 22:58:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIrgD-0000iY-6h for qemu-devel@nongnu.org; Sun, 08 Sep 2013 22:58:34 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:60336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIrgC-0000hl-HL for qemu-devel@nongnu.org; Sun, 08 Sep 2013 22:58:21 -0400 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Sep 2013 08:18:04 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp06.in.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Sep 2013 08:18:02 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 8E1B1394004E for ; Mon, 9 Sep 2013 08:28:02 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r89309lH33423408 for ; Mon, 9 Sep 2013 08:30:09 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r892wE0c008018 for ; Mon, 9 Sep 2013 08:28:14 +0530 Received: from RH64wenchao ([9.181.129.59]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r892w6dn007807; Mon, 9 Sep 2013 08:28:13 +0530 From: Wenchao Xia To: qemu-devel@nongnu.org Date: Mon, 9 Sep 2013 10:58:00 +0800 Message-Id: <1378695482-29805-6-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1378695482-29805-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1378695482-29805-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13090902-9574-0000-0000-0000098939C1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.6 Cc: kwolf@redhat.com, pbonzini@redhat.com, mreitz@redhat.com, Wenchao Xia , stefanha@gmail.com Subject: [Qemu-devel] [PATCH V3 5/7] qcow2: use debug events for snapshot X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org For those error paths which can't be triggered by other debug event, use snapshot debug events. Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- block/qcow2-snapshot.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index e0b7a5a..92b87f8 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -198,6 +198,7 @@ static int qcow2_write_snapshots(BlockDriverState *bs) } + BLKDBG_EVENT(bs->file, BLKDBG_SNAPSHOT_LIST_UPDATE); /* Write all snapshots to the new list */ for(i = 0; i < s->nb_snapshots; i++) { sn = s->snapshots + i; @@ -264,6 +265,7 @@ static int qcow2_write_snapshots(BlockDriverState *bs) header_data.nb_snapshots = cpu_to_be32(s->nb_snapshots); header_data.snapshots_offset = cpu_to_be64(snapshots_offset); + BLKDBG_EVENT(bs->file, BLKDBG_SNAPSHOT_HEADER_UPDATE); ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, nb_snapshots), &header_data, sizeof(header_data)); if (ret < 0) { @@ -375,6 +377,7 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) l1_table[i] = cpu_to_be64(s->l1_table[i]); } + BLKDBG_EVENT(bs->file, BLKDBG_SNAPSHOT_L1_UPDATE); ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT, sn->l1_table_offset, s->l1_size * sizeof(uint64_t)); if (ret < 0) {