]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
block/blkio: use blkio_set_int("fd") to check fd support
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 27 Jul 2023 16:10:20 +0000 (18:10 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 27 Jul 2023 19:51:46 +0000 (15:51 -0400)
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: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20230727161020.84213-5-sgarzare@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/blkio.c

index 72b46d61fdc6dbe2a8c3f756b0e52165f3b3eb00..8e7ce42c79a5ae33aeea7d208cd4e9ef3cba35b0 100644 (file)
@@ -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;
     }