Skip to content
Snippets Groups Projects
Commit 1c38fe69 authored by Stefano Garzarella's avatar Stefano Garzarella Committed by Stefan Hajnoczi
Browse files

block/blkio: use blkio_set_int("fd") to check fd support

Setting the `fd` property fails with virtio-blk-* libblkio drivers
that do not support fd passing since
https://gitlab.com/libblkio/libblkio/-/merge_requests/208

.

Getting the `fd` property, on the other hand, always succeeds for
virtio-blk-* libblkio drivers even when they don't support fd passing.

This patch switches to setting the `fd` property because it is a
better mechanism for probing fd passing support than getting the `fd`
property.

Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Message-id: 20230727161020.84213-5-sgarzare@redhat.com
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 723bea27
No related branches found
No related tags found
No related merge requests found
......@@ -690,7 +690,7 @@ static int blkio_virtio_blk_connect(BlockDriverState *bs, QDict *options,
return -EINVAL;
}
if (blkio_get_int(s->blkio, "fd", &fd) == 0) {
if (blkio_set_int(s->blkio, "fd", -1) == 0) {
fd_supported = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment