From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com, mreitz@redhat.com,
Wenchao Xia <xiawenc@linux.vnet.ibm.com>,
stefanha@gmail.com
Subject: [Qemu-devel] [PATCH V3 5/7] qcow2: use debug events for snapshot
Date: Mon, 9 Sep 2013 10:58:00 +0800 [thread overview]
Message-ID: <1378695482-29805-6-git-send-email-xiawenc@linux.vnet.ibm.com> (raw)
In-Reply-To: <1378695482-29805-1-git-send-email-xiawenc@linux.vnet.ibm.com>
For those error paths which can't be triggered by other debug event,
use snapshot debug events.
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
---
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) {
--
1.7.1
next prev parent reply other threads:[~2013-09-09 2:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 2:57 [Qemu-devel] [PATCH V3 0/7] qcow2: rollback the modification on fail in snapshot creation Wenchao Xia
2013-09-09 2:57 ` [Qemu-devel] [PATCH V3 1/7] qcow2: restore nb_snapshots when " Wenchao Xia
2013-09-30 17:20 ` Eric Blake
2013-10-02 12:26 ` Stefan Hajnoczi
2013-09-09 2:57 ` [Qemu-devel] [PATCH V3 2/7] qcow2: free allocated cluster on fail in qcow2_write_snapshots() Wenchao Xia
2013-09-30 21:16 ` Eric Blake
2013-10-02 12:07 ` Stefan Hajnoczi
2013-09-09 2:57 ` [Qemu-devel] [PATCH V3 3/7] qcow2: cancel the modification on fail in qcow2_snapshot_create() Wenchao Xia
2013-09-30 21:24 ` Eric Blake
2013-09-09 2:57 ` [Qemu-devel] [PATCH V3 4/7] blkdebug: add debug events for snapshot Wenchao Xia
2013-09-30 21:26 ` Eric Blake
2013-09-09 2:58 ` Wenchao Xia [this message]
2013-09-30 21:41 ` [Qemu-devel] [PATCH V3 5/7] qcow2: use " Eric Blake
2013-09-09 2:58 ` [Qemu-devel] [PATCH V3 6/7] qcow2: print message for error path in snapshot creation Wenchao Xia
2013-09-30 22:08 ` Eric Blake
2013-10-02 12:23 ` Stefan Hajnoczi
2013-10-14 7:39 ` Wenchao Xia
2013-09-09 2:58 ` [Qemu-devel] [PATCH V3 7/7] qemu-iotests: add test for qcow2 snapshot Wenchao Xia
2013-09-30 22:28 ` Eric Blake
2013-10-14 7:48 ` Wenchao Xia
2013-09-24 3:36 ` [Qemu-devel] [PATCH V3 0/7] qcow2: rollback the modification on fail in snapshot creation Wenchao Xia
2013-10-02 12:28 ` Stefan Hajnoczi
2013-10-14 7:38 ` Wenchao Xia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378695482-29805-6-git-send-email-xiawenc@linux.vnet.ibm.com \
--to=xiawenc@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).