From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org,
mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH V3 6/7] qcow2: print message for error path in snapshot creation
Date: Mon, 14 Oct 2013 15:39:33 +0800 [thread overview]
Message-ID: <525B9FB5.1020806@linux.vnet.ibm.com> (raw)
In-Reply-To: <20131002122324.GB12200@stefanha-thinkpad.redhat.com>
于 2013/10/2 20:23, Stefan Hajnoczi 写道:
> On Mon, Sep 30, 2013 at 04:08:53PM -0600, Eric Blake wrote:
>> On 09/08/2013 08:58 PM, Wenchao Xia wrote:
>>> The message will be print out with a macro enabled, which can
>> s/print/printed/
>>
>>> be used to check which error path is taken.
>>>
>>> Signed-off-by: Wenchao Xia<xiawenc@linux.vnet.ibm.com>
>>> ---
>>> block/qcow2-snapshot.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>>> 1 files changed, 46 insertions(+), 0 deletions(-)
>>>
>>> @@ -381,12 +413,20 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
>>> ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT,
>>> sn->l1_table_offset, s->l1_size * sizeof(uint64_t));
>>> if (ret< 0) {
>>> +#ifdef QCOW2_SNAPSHOT_PRINT_ERROR_PATH
>>> + printf("qcow2: Failed in overlap check before update L1 table for "
>>> + "snapshot\n");
>>> +#endif
>>> goto dealloc_cluster;
>>> }
>>>
>>> + BLKDBG_EVENT(bs->file, BLKDBG_SNAPSHOT_L1_UPDATE);
>> Should this BLKDBG be part of patch 5?
>>
>> In general, the move to avoid fprintf except under recompilation seems
>> okay; but it seems odd to be removing the diagnosis altogether. If you
>> had gone one step further and refactored the code to wire in Error*
>> support, then you could change fprintf to passing the Error back up the
>> stack to the caller rather than losing it except during a debug build.
> I agree with Eric. Use Error* and make snapshot commands print a
> detailed error to the monitor.
>
> When diagnostics are compiled out we can't help troubleshoot user
> problems.
>
> Stefan
>
Make sense, will add *errp to report the errors.
next prev parent reply other threads:[~2013-10-14 7:40 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 ` [Qemu-devel] [PATCH V3 5/7] qcow2: use " Wenchao Xia
2013-09-30 21:41 ` 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 [this message]
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=525B9FB5.1020806@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.