qemu-block
[Top][All Lists]
Advanced

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

qemu-nbd CMD_BLOCK_STATUS returns one extent in CentOS 8.0, all extents


From: Nir Soffer
Subject: 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 20:06:43 +0200

I have a failing test[1] of ovirt-imageio nbd client[2], getting
base:allocation from qemu-nbd.

The failing test is:

def test_base_allocation_some_data(nbd_server, user_file):
    nbd_server.image = user_file.path
    size = 1024**3
    data_length = 4096
    zero_length = size // 2 - data_length

    with io.open(nbd_server.image, "wb") as f:
        f.truncate(size)
        f.write(b"x" * data_length)
        f.seek(zero_length, os.SEEK_CUR)
        f.write(b"x" * data_length)

    nbd_server.start()

    with nbd.open(nbd_server.url) as c:
        extents = c.extents(0, size)

        assert extents == {
            "base:allocation": [
                nbd.Extent(data_length, False),
                nbd.Extent(zero_length, True),
                nbd.Extent(data_length, False),
                nbd.Extent(zero_length, True),
            ]
        }

The test fails because on CentOS 8, qemu-nbd returns:

    {'base:allocation': [Extent(length=4096, zero=False)]}

We send CMD_BLOCK_STATUS with flags=0 (NBD_CMD_FLAG_REQ_ONE not set).

The tests fail with:
qemu-img-2.12.0-65.module_el8.0.0+189+f9babebb.5.x86_64

And work with:
qemu-img-4.1.0-5.fc30.x86_64

It looks like qemu on the failing version return single extent instead
of all extents
in the requested range (offset=0, length=1g). Reading the NBD spec it seems like
the server is allowed to that, but since the behaviour is different in
4.1.0, maybe
we are missing some patch in CentOS 8.0?

Looks like I need to change the test to do multiple calls until the
entire we have
reponse for the entire range.

[1] https://travis-ci.org/nirs/ovirt-imageio/jobs/617732045
[2] https://gerrit.ovirt.org/c/105126

Nir




reply via email to

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