[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] active block commit bug?
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] active block commit bug? |
Date: |
Thu, 5 Jun 2014 10:09:06 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, 06/04 19:54, Eric Blake wrote:
> 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)
>
Yes, agreed, this special case is only going to make management confused. I
will send a patch to fix this.
Eric, is this a good way to probe the active commit? I was expecting full
instrospection of QMP could do it, but I don't know about the status of that
piece of work. Amos, any ideas?
Fam
- [Qemu-devel] active block commit bug?, Eric Blake, 2014/06/04
- Re: [Qemu-devel] active block commit bug?, Jeff Cody, 2014/06/04
- Re: [Qemu-devel] active block commit bug?, Eric Blake, 2014/06/04
- Re: [Qemu-devel] active block commit bug?,
Fam Zheng <=
- Re: [Qemu-devel] active block commit bug?, Eric Blake, 2014/06/04
- Re: [Qemu-devel] active block commit bug?, Fam Zheng, 2014/06/04
- Re: [Qemu-devel] active block commit bug?, Markus Armbruster, 2014/06/05
- Re: [Qemu-devel] active block commit bug?, Kevin Wolf, 2014/06/05
- Re: [Qemu-devel] active block commit bug?, Markus Armbruster, 2014/06/05
- Re: [Qemu-devel] active block commit bug?, Amos Kong, 2014/06/06