dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0001-block-blkio-Make-s-mem_region_alignment-be-64-bits.patch

c8c913
From 500f3a81652dcefa79a4864c1f3fa6747c16952e Mon Sep 17 00:00:00 2001
93330a
From: "Richard W.M. Jones" <rjones@redhat.com>
93330a
Date: Mon, 29 Jan 2024 18:20:46 +0000
c8c913
Subject: [PATCH] block/blkio: Make s->mem_region_alignment be 64 bits
93330a
MIME-Version: 1.0
93330a
Content-Type: text/plain; charset=UTF-8
93330a
Content-Transfer-Encoding: 8bit
93330a
93330a
With GCC 14 the code failed to compile on i686 (and was wrong for any
93330a
version of GCC):
93330a
93330a
../block/blkio.c: In function ‘blkio_file_open’:
93330a
../block/blkio.c:857:28: error: passing argument 3 of ‘blkio_get_uint64’ from incompatible pointer type [-Wincompatible-pointer-types]
93330a
  857 |                            &s->mem_region_alignment);
93330a
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
93330a
      |                            |
93330a
      |                            size_t * {aka unsigned int *}
93330a
In file included from ../block/blkio.c:12:
93330a
/usr/include/blkio.h:49:67: note: expected ‘uint64_t *’ {aka ‘long long unsigned int *’} but argument is of type ‘size_t *’ {aka ‘unsigned int *’}
93330a
   49 | int blkio_get_uint64(struct blkio *b, const char *name, uint64_t *value);
93330a
      |                                                         ~~~~~~~~~~^~~~~
93330a
93330a
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
93330a
---
c8c913
 block/blkio.c | 2 +-
c8c913
 1 file changed, 1 insertion(+), 1 deletion(-)
93330a
93330a
diff --git a/block/blkio.c b/block/blkio.c
c8c913
index 0a0a6c0f5fd..bc2f21784c7 100644
93330a
--- a/block/blkio.c
93330a
+++ b/block/blkio.c
c8c913
@@ -68,7 +68,7 @@ typedef struct {
c8c913
     CoQueue bounce_available;
93330a
 
c8c913
     /* The value of the "mem-region-alignment" property */
c8c913
-    size_t mem_region_alignment;
c8c913
+    uint64_t mem_region_alignment;
93330a
 
c8c913
     /* Can we skip adding/deleting blkio_mem_regions? */
c8c913
     bool needs_mem_regions;
93330a
-- 
93330a
2.43.0
93330a