0001-contrib-vhost-user-blk-Replace-lseek64-with-lseek.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 38f5c88bf296dbbc04dcd57f36d64695055a2d3f Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Fri, 16 Dec 2022 20:19:49 -0800
  4. Subject: [PATCH 1/2] contrib/vhost-user-blk: Replace lseek64 with lseek
  5. 64bit off_t is already in use since build uses _FILE_OFFSET_BITS=64
  6. already. Using lseek/off_t also makes it work with latest must without
  7. using _LARGEFILE64_SOURCE macro. This macro is implied with _GNU_SOURCE
  8. when using glibc but not with musl.
  9. Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2022-12/msg02840.html]
  10. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  11. Cc: Michael S. Tsirkin <mst@redhat.com>
  12. CC: Raphael Norwitz <raphael.norwitz@nutanix.com>
  13. ---
  14. contrib/vhost-user-blk/vhost-user-blk.c | 4 ++--
  15. 1 file changed, 2 insertions(+), 2 deletions(-)
  16. diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
  17. index aa99877fcd..7941694e53 100644
  18. --- a/contrib/vhost-user-blk/vhost-user-blk.c
  19. +++ b/contrib/vhost-user-blk/vhost-user-blk.c
  20. @@ -532,9 +532,9 @@ vub_get_blocksize(int fd)
  21. static void
  22. vub_initialize_config(int fd, struct virtio_blk_config *config)
  23. {
  24. - off64_t capacity;
  25. + off_t capacity;
  26. - capacity = lseek64(fd, 0, SEEK_END);
  27. + capacity = lseek(fd, 0, SEEK_END);
  28. config->capacity = capacity >> 9;
  29. config->blk_size = vub_get_blocksize(fd);
  30. config->size_max = 65536;
  31. --
  32. 2.39.0