[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 11/13] contrib/vhost-user-blk: fix 32 bit build and enable
From: |
Alex Bennée |
Subject: |
[PATCH v1 11/13] contrib/vhost-user-blk: fix 32 bit build and enable |
Date: |
Mon, 21 Mar 2022 15:30:35 +0000 |
We were not building the vhost-user-blk server due to 32 bit
compilation problems. The problem was due to format string types so
fix that and then enable the build. Tweak the rule to follow the same
rules as other vhost-user daemons.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
meson.build | 2 +-
contrib/vhost-user-blk/vhost-user-blk.c | 6 +++---
contrib/vhost-user-blk/meson.build | 3 +--
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 282e7c4650..0435419307 100644
--- a/meson.build
+++ b/meson.build
@@ -1326,7 +1326,7 @@ have_vhost_user_blk_server =
get_option('vhost_user_blk_server') \
error_message: 'vhost_user_blk_server requires linux') \
.require('CONFIG_VHOST_USER' in config_host,
error_message: 'vhost_user_blk_server requires vhost-user support')
\
- .disable_auto_if(not have_system) \
+ .disable_auto_if(not have_tools and not have_system) \
.allowed()
if get_option('fuse').disabled() and get_option('fuse_lseek').enabled()
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c
b/contrib/vhost-user-blk/vhost-user-blk.c
index d14b2896bf..0bee79360f 100644
--- a/contrib/vhost-user-blk/vhost-user-blk.c
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
@@ -146,7 +146,7 @@ vub_readv(VubReq *req, struct iovec *iov, uint32_t iovcnt)
req->size = vub_iov_size(iov, iovcnt);
rc = preadv(vdev_blk->blk_fd, iov, iovcnt, req->sector_num * 512);
if (rc < 0) {
- fprintf(stderr, "%s, Sector %"PRIu64", Size %lu failed with %s\n",
+ fprintf(stderr, "%s, Sector %"PRIu64", Size %zu failed with %s\n",
vdev_blk->blk_name, req->sector_num, req->size,
strerror(errno));
return -1;
@@ -169,7 +169,7 @@ vub_writev(VubReq *req, struct iovec *iov, uint32_t iovcnt)
req->size = vub_iov_size(iov, iovcnt);
rc = pwritev(vdev_blk->blk_fd, iov, iovcnt, req->sector_num * 512);
if (rc < 0) {
- fprintf(stderr, "%s, Sector %"PRIu64", Size %lu failed with %s\n",
+ fprintf(stderr, "%s, Sector %"PRIu64", Size %zu failed with %s\n",
vdev_blk->blk_name, req->sector_num, req->size,
strerror(errno));
return -1;
@@ -188,7 +188,7 @@ vub_discard_write_zeroes(VubReq *req, struct iovec *iov,
uint32_t iovcnt,
size = vub_iov_size(iov, iovcnt);
if (size != sizeof(*desc)) {
- fprintf(stderr, "Invalid size %ld, expect %ld\n", size, sizeof(*desc));
+ fprintf(stderr, "Invalid size %zd, expect %zd\n", size, sizeof(*desc));
return -1;
}
buf = g_new0(char, size);
diff --git a/contrib/vhost-user-blk/meson.build
b/contrib/vhost-user-blk/meson.build
index 601ea15ef5..dcb9e2ffcd 100644
--- a/contrib/vhost-user-blk/meson.build
+++ b/contrib/vhost-user-blk/meson.build
@@ -1,5 +1,4 @@
-# FIXME: broken on 32-bit architectures
executable('vhost-user-blk', files('vhost-user-blk.c'),
dependencies: [qemuutil, vhost_user],
- build_by_default: false,
+ build_by_default: targetos == 'linux',
install: false)
--
2.30.2
- [PATCH v1 03/13] hw/virtio: add vhost_user_[read|write] trace points, (continued)
- [PATCH v1 03/13] hw/virtio: add vhost_user_[read|write] trace points, Alex Bennée, 2022/03/21
- [PATCH v1 04/13] docs: vhost-user: clean up request/reply description, Alex Bennée, 2022/03/21
- [PATCH v1 06/13] docs: vhost-user: replace master/slave with front-end/back-end, Alex Bennée, 2022/03/21
- [PATCH v1 08/13] libvhost-user: expose vu_request_to_string, Alex Bennée, 2022/03/21
- [PATCH v1 10/13] include/hw: start documenting the vhost API, Alex Bennée, 2022/03/21
- [PATCH v1 07/13] vhost-user.rst: add clarifying language about protocol negotiation, Alex Bennée, 2022/03/21
- [PATCH v1 09/13] docs/devel: start documenting writing VirtIO devices, Alex Bennée, 2022/03/21
- [PATCH v1 11/13] contrib/vhost-user-blk: fix 32 bit build and enable,
Alex Bennée <=
- [PATCH v1 12/13] hw/virtio/vhost-user: don't suppress F_CONFIG when supported, Alex Bennée, 2022/03/21
- [PATCH v1 05/13] docs: vhost-user: rewrite section on ring state machine, Alex Bennée, 2022/03/21
- [PATCH v1 13/13] virtio/vhost-user: dynamically assign VhostUserHostNotifiers, Alex Bennée, 2022/03/21
- Re: [PATCH v1 00/13] various virtio docs, fixes and tweaks, Michael S. Tsirkin, 2022/03/22