block/blkio: fall back on using `path` when `fd` setting fails
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 27 Jul 2023 16:10:19 +0000 (18:10 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 27 Jul 2023 19:51:46 +0000 (15:51 -0400)
commit723bea27b127969931fa26bc0de79372a3d9e148
tree154721488ca532fd6eb77778589df34f72637521
parent809c319f8a089fbc49223dc29e1cc2b978beeada
block/blkio: fall back on using `path` when `fd` setting fails

qemu_open() fails if called with an unix domain socket in this way:
    -blockdev node-name=drive0,driver=virtio-blk-vhost-user,path=vhost-user-blk.sock,cache.direct=on: Could not open 'vhost-user-blk.sock': No such device or address

Since virtio-blk-vhost-user does not support fd passing, let`s always fall back
on using `path` if we fail the fd passing.

Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk")
Reported-by: Qing Wang <qinwang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20230727161020.84213-4-sgarzare@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/blkio.c