Commit ba889444 authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Kevin Wolf
Browse files

block: fix bdrv_ioctl called from coroutine



When called from a coroutine, bdrv_ioctl must be asynchronous just like
e.g. bdrv_flush.  The code was incorrectly making it synchronous, fix
it.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarFam Zheng <famz@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 27a7649a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2614,11 +2614,12 @@ int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
        bdrv_co_ioctl_entry(&data);
    } else {
        Coroutine *co = qemu_coroutine_create(bdrv_co_ioctl_entry);

        qemu_coroutine_enter(co, &data);
    }
        while (data.ret == -EINPROGRESS) {
            aio_poll(bdrv_get_aio_context(bs), true);
        }
    }
    return data.ret;
}