[Spice-commits] server/red_memslots.c server/red_memslots.h

Marc-André Lureau elmarco at kemper.freedesktop.org
Tue Oct 1 07:24:52 PDT 2013


 server/red_memslots.c |   48 ------------------------------------------------
 server/red_memslots.h |    3 ---
 2 files changed, 51 deletions(-)

New commits:
commit 30783c8e59c6a30f981451b9498ab60f7de90890
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Tue Oct 1 16:23:35 2013 +0200

    server: remove memslot unused functions

diff --git a/server/red_memslots.c b/server/red_memslots.c
index d9153d3..1b3ec62 100644
--- a/server/red_memslots.c
+++ b/server/red_memslots.c
@@ -48,31 +48,6 @@ static void print_memslots(RedMemSlotInfo *info)
     }
 }
 
-unsigned long get_virt_delta(RedMemSlotInfo *info, QXLPHYSICAL addr, int group_id)
-{
-    MemSlot *slot;
-    int slot_id;
-    int generation;
-
-    if (group_id > info->num_memslots_groups) {
-        spice_critical("group_id %d too big", group_id);
-    }
-
-    slot_id = get_memslot_id(info, addr);
-    if (slot_id > info->num_memslots) {
-        spice_critical("slot_id %d too big", slot_id);
-    }
-
-    slot = &info->mem_slots[group_id][slot_id];
-
-    generation = get_generation(info, addr);
-    if (generation != slot->generation) {
-        spice_critical("address generation is not valid");
-    }
-
-    return (slot->address_delta - (addr - __get_clean_virt(info, addr)));
-}
-
 /* return 1 if validation successfull, 0 otherwise */
 int validate_virt(RedMemSlotInfo *info, unsigned long virt, int slot_id,
                   uint32_t add_size, uint32_t group_id)
@@ -147,29 +122,6 @@ unsigned long get_virt(RedMemSlotInfo *info, QXLPHYSICAL addr, uint32_t add_size
     return h_virt;
 }
 
-void *validate_chunk(RedMemSlotInfo *info, QXLPHYSICAL data, uint32_t group_id,
-                     uint32_t *data_size_out, QXLPHYSICAL *next_out, int *error)
-{
-    QXLDataChunk *chunk;
-    uint32_t data_size;
-
-    chunk = (QXLDataChunk *)get_virt(info, data, sizeof(QXLDataChunk), group_id,
-                                     error);
-    if (*error) {
-        return NULL;
-    }
-    data_size = chunk->data_size;
-    if (!validate_virt(info, (unsigned long)chunk->data, get_memslot_id(info, data),
-                       data_size, group_id)) {
-        *error = 1;
-        return NULL;
-    }
-    *next_out = chunk->next_chunk;
-    *data_size_out = data_size;
-
-    return chunk->data;
-}
-
 void red_memslot_info_init(RedMemSlotInfo *info,
                            uint32_t num_groups, uint32_t num_slots,
                            uint8_t generation_bits,
diff --git a/server/red_memslots.h b/server/red_memslots.h
index c4303bd..27443a6 100644
--- a/server/red_memslots.h
+++ b/server/red_memslots.h
@@ -53,14 +53,11 @@ static inline int get_generation(RedMemSlotInfo *info, uint64_t addr)
     return (addr >> info->memslot_gen_shift) & info->memslot_gen_mask;
 }
 
-unsigned long get_virt_delta(RedMemSlotInfo *info, QXLPHYSICAL addr, int group_id);
 int validate_virt(RedMemSlotInfo *info, unsigned long virt, int slot_id,
                   uint32_t add_size, uint32_t group_id);
 unsigned long get_virt(RedMemSlotInfo *info, QXLPHYSICAL addr, uint32_t add_size,
                        int group_id, int *error);
 
-void *validate_chunk(RedMemSlotInfo *info, QXLPHYSICAL data, uint32_t group_id,
-                     uint32_t *data_size_out, QXLPHYSICAL *next_out, int *error);
 void red_memslot_info_init(RedMemSlotInfo *info,
                            uint32_t num_groups, uint32_t num_slots,
                            uint8_t generation_bits,


More information about the Spice-commits mailing list