qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] active block commit bug?


From: Eric Blake
Subject: Re: [Qemu-devel] active block commit bug?
Date: Wed, 04 Jun 2014 19:54:58 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 06/04/2014 06:12 PM, Jeff Cody wrote:

>> Huh? I thought that an active commit was not supposed to complete
>> automatically, but that the job would remain around until I either
>> 'block-job-cancel' or 'block-job-complete' it.  That is, I should have
>> gotten a BLOCK_JOB_READY event and still see the job when I query for
>> it.  Where am I going wrong, or did I uncover a bug in active commit?
>>
> 
> I tried repeating your findings, but I couldn't, until I noticed that
> 'f' was just a 0-length raw image in your test.
> 
> The snapshot file will be the same size, 0.  So when we go to perform
> the active commit, we short-circuit at the beginning, since we are
> committing a zero-length image:

That explains it.

>  
>      s->common.len = bdrv_getlength(bs);
>      if (s->common.len <= 0) {
>          block_job_completed(&s->common, s->common.len);
>          return;
>      }
>      ^^^^^
>      we exit early here, with a completed message, since there is
>      nothing to do.
> 
> If 'g' had increased to non-zero size, then you would have received a
> BLOCK_JOB_READY instead.

Sounds like we have an off-by-one condition if empty files behave
differently from other files.  We ought to fix that bug (not that your
normal guest will ever have a 0-length backing file, but this was what I
was trying to use for libvirt's probing of whether active commit is
supported)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]