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: Eric Blake
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 13:46:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

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.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

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