summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorPeter Xu2019-01-16 04:08:15 +0100
committerMichael S. Tsirkin2019-02-05 16:58:33 +0100
commita56de056c91f87e1e8569a32f8d3513b5ae1d7ec (patch)
treea14fb2ba8b5b54fe99b309a843e0c89319a4239d /contrib
parentpci/msi: export msi_is_masked() (diff)
downloadqemu-a56de056c91f87e1e8569a32f8d3513b5ae1d7ec.tar.gz
qemu-a56de056c91f87e1e8569a32f8d3513b5ae1d7ec.tar.xz
qemu-a56de056c91f87e1e8569a32f8d3513b5ae1d7ec.zip
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>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/vhost-user-blk/vhost-user-blk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
index 858221ad95..49640dfdf2 100644
--- a/contrib/vhost-user-blk/vhost-user-blk.c
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
@@ -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