[PATCH 1/2] qemu: convert the flags type to unsigned long

Peter Krempa pkrempa at redhat.com
Mon Nov 21 10:45:43 UTC 2022


On Sat, Nov 19, 2022 at 17:31:27 +0800, Jiang Jiacheng wrote:
> The flags type is unsigend long but passed as unsigend int
> when invoke 'qemuMigrationSrcNBDStorageCopy'. Modify it to
> prevent data truncation.
> 
> Signed-off-by: Jiang Jiacheng <jiangjiacheng at huawei.com>
> ---
>  src/qemu/qemu_migration.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Actually the use of 'unsigned long flags' in the migration APIs is a
historical mistake. While we can't remove that type from the function
prototype, internally the code MUST use 32 bit at most as 'unsigned
long' is not portable between 32 and 64 bit hosts.


More information about the libvir-list mailing list