qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Jeff Cody <jcody@redhat.com>
Cc: kwolf@redhat.com, Paolo Bonzini <pbonzini@redhat.com>,
	gentoo.integer@gmail.com, qemu-devel@nongnu.org,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 5/5] mirror: Check for bdrv_get_info result
Date: Thu, 14 Nov 2013 09:26:34 +0800	[thread overview]
Message-ID: <528426CA.8060600@redhat.com> (raw)
In-Reply-To: <20131113153451.GB22807@localhost.localdomain>

On 2013年11月13日 23:34, Jeff Cody wrote:
> On Wed, Nov 13, 2013 at 08:53:14AM +0800, Fam Zheng wrote:
>> bdrv_get_info could fail. Add check before using the returned value.
>>
>> Signed-off-by: Fam Zheng <famz@redhat.com>
>> ---
>>   block/mirror.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/block/mirror.c b/block/mirror.c
>> index 7b95acf..c0c321b 100644
>> --- a/block/mirror.c
>> +++ b/block/mirror.c
>> @@ -320,8 +320,8 @@ static void coroutine_fn mirror_run(void *opaque)
>>       bdrv_get_backing_filename(s->target, backing_filename,
>>                                 sizeof(backing_filename));
>>       if (backing_filename[0] && !s->target->backing_hd) {
>> -        bdrv_get_info(s->target, &bdi);
>> -        if (s->granularity < bdi.cluster_size) {
>> +        ret = bdrv_get_info(s->target, &bdi);
>> +        if (ret == 0 && s->granularity < bdi.cluster_size) {
>
> For ret < 0, I think we should exit on error (at least in cases where
> ret < 0 && ret != -ENOTSUP).
>

We only need the cluster_size here, which is optional to set up 
operation granularity. Exiting the block job because bdrv_get_info fails 
(which is not a critical error) is worse in fault tolerance sense, so 
I'd like to keep this way.

Paolo, any ideas?

Fam

      reply	other threads:[~2013-11-14  1:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13  0:53 [Qemu-devel] [PATCH 0/5] Fix conversion from ISO to VMDK streamOptimized Fam Zheng
2013-11-13  0:53 ` [Qemu-devel] [PATCH 1/5] qemu-img: Convert by cluster size if target is compressed Fam Zheng
2013-11-13 15:23   ` Jeff Cody
2013-11-14  1:18     ` Fam Zheng
2013-11-14  1:34       ` Jeff Cody
2013-11-14  1:49         ` Fam Zheng
2013-11-13  0:53 ` [Qemu-devel] [PATCH 2/5] vmdk: Implement .bdrv_write_compressed Fam Zheng
2013-11-13  0:53 ` [Qemu-devel] [PATCH 3/5] block: Change BlockDriverInfo.cluster_size to 64 bits Fam Zheng
2013-11-13  0:53 ` [Qemu-devel] [PATCH 4/5] vmdk: Implement .bdrv_get_info() Fam Zheng
2013-11-13  0:53 ` [Qemu-devel] [PATCH 5/5] mirror: Check for bdrv_get_info result Fam Zheng
2013-11-13 15:34   ` Jeff Cody
2013-11-14  1:26     ` Fam Zheng [this message]

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=528426CA.8060600@redhat.com \
    --to=famz@redhat.com \
    --cc=gentoo.integer@gmail.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).