diff options
author | Changpeng Liu <changpeng.liu@intel.com> | 2019-02-12 15:06:20 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-02-21 12:28:41 -0500 |
commit | 4387b78ac31279cd575658d02fcea26e743a1c79 (patch) | |
tree | fd60ac4be034059841dca6c3c1888f75b65373fb | |
parent | 8c43812ba2bcf7ca11002f6f0e60931f8179d439 (diff) | |
download | qemu-4387b78ac31279cd575658d02fcea26e743a1c79.zip qemu-4387b78ac31279cd575658d02fcea26e743a1c79.tar.gz qemu-4387b78ac31279cd575658d02fcea26e743a1c79.tar.bz2 |
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>
Message-Id: <1547615970-23545-2-git-send-email-changpeng.liu@intel.com>
[PMD: this patch was first (incorrectly) introduced as a56de056c91f8]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190212140621.17009-3-philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
-rw-r--r-- | contrib/vhost-user-blk/vhost-user-blk.c | 6 |
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 5c2092e..43583f2 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; @@ -521,7 +525,7 @@ vub_get_blocksize(int fd) #if defined(__linux__) && defined(BLKSSZGET) if (ioctl(fd, BLKSSZGET, &blocksize) == 0) { - return blocklen; + return blocksize; } #endif |