qemu-block
[Top][All Lists]
Advanced

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

Re: qemu-nbd CMD_BLOCK_STATUS returns one extent in CentOS 8.0, all exte


From: Nir Soffer
Subject: Re: qemu-nbd CMD_BLOCK_STATUS returns one extent in CentOS 8.0, all extents in 4.1.0 - is this a bug?
Date: Wed, 27 Nov 2019 22:04:58 +0200

On Wed, Nov 27, 2019 at 9:46 PM Eric Blake <address@hidden> wrote:
>
> On 11/27/19 1:35 PM, Eric Blake wrote:
>
> >> Changing this to:
> >>
> >>          extents = []
> >>          pos = 0
> >>
> >>          while pos < size:
> >>              res = c.extents(pos, size - pos)["base:allocation"]
> >>              for ext in res:
> >>                  pos += ext.length
> >>                  extents.append(ext)
> >>
> >> Solves the issue:
> >> https://travis-ci.org/nirs/ovirt-imageio/jobs/617846324
> >>
> >> So I guess I answered my question but I would like to get
> >> your opinion anyway.
> >
> > Correct, the behavior is spec-compliant, even if annoying that it
> > doesn't make as much forward progress as is possible.  Writing a loop in
> > the client is the correct behavior (the spec guarantees forward progress
> > on success, so at least that aspect of writing a loop is easier).
>
> Oh, one other thing - your loop happens to work for your test case, but
> will be thrown off if you ever get the same status in successive calls.
> A more robust loop will coalesce consecutive ranges with the same status
> before doing any comparison of whether the overall array matches an
> expected pattern.

Yes, I found this issue when querying qcow2 images, partly allocated
cluster returns consecutive extents with same flags.

Currently writing 64k to avoid this issue for this test. I hope to keep the
test simple.

We will have to handle this in the code reporting the extents to the user so
users do not have to deal with these issues.

Nir




reply via email to

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