clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
524 stars 29 forks source link

Starting QEMU with `-drive aio=io_uring` fails with `invalid aio option` #2291

Open volkertb opened 3 years ago

volkertb commented 3 years ago

In Clear Linux version 34320, when you enter man qemu and scroll down to the available options under -drive, you find the following information:

aio=aio
       aio  is  "threads",  "native", or "io_uring" and selects between pthread based disk I/O, native Linux AIO, or Linux
       io_uring API.

All these three options are also listed when you run qemu with the --help option:

$ qemu-system-x86_64 --help | grep aio
       [,aio=threads|native|io_uring]

I've heard good things about the io_uring feature, so naturally, I'd like to try it. However, when I try to start QEMU with a drive configured with the aio mode set to io_uring, I get the following result:

$ qemu-system-x86_64 -drive aio=io_uring,if=virtio,format=qcow2,file=/some/file.qcow2
qemu-system-x86_64: -drive aio=io_uring,if=virtio,format=qcow2,file=/some/file.qcow2: invalid aio option

The invalid aio option error is shown whenever you enter a non-existent aio option, like this:

$ qemu-system-x86_64 -drive aio=blabla,if=virtio,format=qcow2,file=/some/file.qcow2
qemu-system-x86_64: -drive aio=blabla,if=virtio,format=qcow2,file=/some/file.qcow2: invalid aio option

When I specify threads or native, it works fine.

I've tried the same on a Fedora 33 system and on an Ubuntu 20.10 system, and in both cases, aio=io_uring was recognized without this error. So apparently, it's specific to Clear Linux.

Even if there's a technical limitation currently preventing aio=io_uring from working with QEMU in Clear Linux, I would expect a more specific and explanatory error to be shown, not the same one that you would get when you enter any invalid value. For instance, a GitHub search yielded this result in the QEMU source code:

#ifdef CONFIG_LINUX_IO_URING
    if (s->use_linux_io_uring) {
        if (!aio_setup_linux_io_uring(bdrv_get_aio_context(bs), errp)) {
            error_prepend(errp, "Unable to use io_uring: ");
            goto fail;
        }
    }

Direct link to this code: https://github.com/qemu/qemu/blob/1ed9228f63ea4bcc0ae240365305ee264e9189ce/block/file-posix.c#L696

Please let me know if I can help in testing or troubleshooting this further. Thanks.

mrartanis commented 2 years ago

Face same issue with qemu builded on machine without liburing-dev (qemu-system-x86_64 --help | grep aio returned [,aio=threads|native|io_uring] too) Rebuild package with liburing and aio=io_uring start working.

fenrus75 commented 2 years ago

adding iouring now.. should be in the next release

On Tue, Jan 18, 2022 at 6:24 AM Artanis @.***> wrote:

Face same issue with qemu builded on machine without liburing-dev (qemu-system-x86_64 --help | grep aio returned [,aio=threads|native|io_uring] too) Rebuild package with liburing and aio=io_uring start working.

— Reply to this email directly, view it on GitHub https://github.com/clearlinux/distribution/issues/2291#issuecomment-1015461939, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ54FIFQIHP6QFUZQM5RUDUWVZ3FANCNFSM4YLPBO2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>