[Spice-devel] Spice is breaking in 32 bits hosts
Alon Levy
alevy at redhat.com
Mon Mar 19 02:38:32 PDT 2012
On Mon, Mar 19, 2012 at 12:48:37AM -0300, Fabiano Fidêncio wrote:
> Guys, I've been trouble using spice-protocol/spice/qemu from git, in a
> 32 bits host.
>
> Could somone take a look in this issue?
>
Please try the following patch.
commit 5c3c02a581590bd746cc4c98a83f24ad40039cfa
Author: Alon Levy <alevy at redhat.com>
Date: Mon Mar 19 10:37:38 2012 +0100
server: get_virt should use QXLPHYSICAL for 32 bit compat
diff --git a/server/red_memslots.c b/server/red_memslots.c
index d727a09..976e803 100644
--- a/server/red_memslots.c
+++ b/server/red_memslots.c
@@ -91,7 +91,7 @@ void validate_virt(RedMemSlotInfo *info, unsigned long virt, int slot_id,
}
}
-unsigned long get_virt(RedMemSlotInfo *info, unsigned long addr, uint32_t add_size,
+unsigned long get_virt(RedMemSlotInfo *info, QXLPHYSICAL addr, uint32_t add_size,
int group_id)
{
int slot_id;
@@ -127,20 +127,6 @@ unsigned long get_virt(RedMemSlotInfo *info, unsigned long addr, uint32_t add_si
return h_virt;
}
-void *cb_get_virt(void *opaque, unsigned long addr,
- uint32_t add_size, uint32_t group_id)
-{
- return (void *)get_virt((RedMemSlotInfo *)opaque, addr, add_size, group_id);
-}
-
-void cb_validate_virt(void *opaque,
- unsigned long virt, unsigned long from_addr,
- uint32_t add_size, uint32_t group_id)
-{
- int slot_id = get_memslot_id((RedMemSlotInfo *)opaque, from_addr);
- validate_virt((RedMemSlotInfo *)opaque, virt, slot_id, add_size, group_id);
-}
-
void *validate_chunk (RedMemSlotInfo *info, QXLPHYSICAL data, uint32_t group_id, uint32_t *data_size_out, QXLPHYSICAL *next_out)
{
QXLDataChunk *chunk;
diff --git a/server/red_memslots.h b/server/red_memslots.h
index 18d5208..75754d0 100644
--- a/server/red_memslots.h
+++ b/server/red_memslots.h
@@ -43,12 +43,12 @@ typedef struct RedMemSlotInfo {
unsigned long memslot_clean_virt_mask;
} RedMemSlotInfo;
-static inline int get_memslot_id(RedMemSlotInfo *info, unsigned long addr)
+static inline int get_memslot_id(RedMemSlotInfo *info, uint64_t addr)
{
return addr >> info->memslot_id_shift;
}
-static inline int get_generation(RedMemSlotInfo *info, unsigned long addr)
+static inline int get_generation(RedMemSlotInfo *info, uint64_t addr)
{
return (addr >> info->memslot_gen_shift) & info->memslot_gen_mask;
}
@@ -60,11 +60,6 @@ unsigned long get_virt(RedMemSlotInfo *info, unsigned long addr, uint32_t add_si
int group_id);
void *validate_chunk (RedMemSlotInfo *info, QXLPHYSICAL data, uint32_t group_id, uint32_t *data_size_out, QXLPHYSICAL *next_out);
-void *cb_get_virt(void *opaque, unsigned long addr,
- uint32_t add_size, uint32_t group_id);
-void cb_validate_virt(void *opaque,
- unsigned long virt, unsigned long from_addr,
- uint32_t add_size, uint32_t group_id);
void red_memslot_info_init(RedMemSlotInfo *info,
uint32_t num_groups, uint32_t num_slots,
uint8_t generation_bits,
More information about the Spice-devel
mailing list