Skip to content
Snippets Groups Projects
Commit facc6851 authored by Bruce Rogers's avatar Bruce Rogers Committed by Michael S. Tsirkin
Browse files

virtio-mem: Correct format specifier mismatch for RISC-V


This likely affects other, less popular host architectures as well.
Less common host architectures under linux get QEMU_VMALLOC_ALIGN (from
which VIRTIO_MEM_MIN_BLOCK_SIZE is derived) define to a variable of
type uintptr, which isn't compatible with the format specifier used to
print a user message. Since this particular usage of the underlying data
seems unique to this file, the simple fix is to just cast
QEMU_VMALLOC_ALIGN to uint32_t, which corresponds to the format specifier
used.

Signed-off-by: default avatarBruce Rogers <brogers@suse.com>
Message-Id: <20200730130519.168475-1-brogers@suse.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Reviewed-by: default avatarPankaj Gupta <pankaj.gupta.linux@gmail.com>
parent 5c1c3e4f
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@
* Use QEMU_VMALLOC_ALIGN, so no THP will have to be split when unplugging
* memory (e.g., 2MB on x86_64).
*/
#define VIRTIO_MEM_MIN_BLOCK_SIZE QEMU_VMALLOC_ALIGN
#define VIRTIO_MEM_MIN_BLOCK_SIZE ((uint32_t)QEMU_VMALLOC_ALIGN)
/*
* Size the usable region bigger than the requested size if possible. Esp.
* Linux guests will only add (aligned) memory blocks in case they fully
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment