]> git.proxmox.com Git - mirror_qemu.git/commit - ui/spice-display.c
ui/spice-display: use uintptr_t when casting qxl physical addresses
authorAlon Levy <alevy@redhat.com>
Wed, 21 Mar 2012 16:17:18 +0000 (18:17 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 22 Mar 2012 13:29:13 +0000 (14:29 +0100)
commita13ccc991a852cf12f2c05f537c40ce239ae464f
tree70f0f5fbd5f2fca659531cbe3ec027ffe359b7b7
parent34d14c6d8c7af0d2457cf5730fe5a65a878c509d
ui/spice-display: use uintptr_t when casting qxl physical addresses

The current intptr_t casts are a problem when the address's highest
bit is 1, and it is cast to a intptr_t and then to uint64_t, such
as at:
     surface.mem        = (intptr_t)ssd->buf;

This causes the sign bit to be extended which causes a wrong address to
be passed on to spice, which then complains when it gets the wrong
slot_id number, since the slot_id is taken from the higher bits.

The assertion happens early - during the first primary surface creation.

This fixes running "-vga qxl -spice" with 32 bit compiled
qemu-system-i386.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/spice-display.c