mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
contrib/vhost-user-blk: fix the compilation issue
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
committed by
Michael S. Tsirkin
parent
afa26ecc30
commit
a56de056c9
@@ -20,6 +20,10 @@
|
||||
#include "contrib/libvhost-user/libvhost-user-glib.h"
|
||||
#include "contrib/libvhost-user/libvhost-user.h"
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <linux/fs.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
struct virtio_blk_inhdr {
|
||||
unsigned char status;
|
||||
@@ -454,7 +458,7 @@ vub_get_blocksize(int fd)
|
||||
|
||||
#if defined(__linux__) && defined(BLKSSZGET)
|
||||
if (ioctl(fd, BLKSSZGET, &blocksize) == 0) {
|
||||
return blocklen;
|
||||
return blocksize;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user