summaryrefslogtreecommitdiffstats
path: root/server/red_memslots.h
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-04-04 20:40:59 +0300
committerAlon Levy <alevy@redhat.com>2012-04-05 18:28:49 +0300
commit2ec2dbc78a660ee4e3315f50c881d9e31a8e4fe2 (patch)
tree5b5bd52f9df547bcbbbdf9c492b54848b8aca23e /server/red_memslots.h
parent2439c0dc90bcfd83d3e0eb4f08f19ef2face2118 (diff)
downloadspice-2ec2dbc78a660ee4e3315f50c881d9e31a8e4fe2.tar.gz
spice-2ec2dbc78a660ee4e3315f50c881d9e31a8e4fe2.tar.xz
spice-2ec2dbc78a660ee4e3315f50c881d9e31a8e4fe2.zip
server: allow failure in getvirt
This patch changed getvirt to continue working even if spice_critical doesn't abort (i.e. SPICE_ABORT_LEVEL != -1). This is in preparation to make getvirt not abort at all. The reason is that getvirt is run on guest provided memory, so a bad driver can crash the vm.
Diffstat (limited to 'server/red_memslots.h')
-rw-r--r--server/red_memslots.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/red_memslots.h b/server/red_memslots.h
index d50587f6..c4303bd0 100644
--- a/server/red_memslots.h
+++ b/server/red_memslots.h
@@ -54,12 +54,13 @@ static inline int get_generation(RedMemSlotInfo *info, uint64_t addr)
}
unsigned long get_virt_delta(RedMemSlotInfo *info, QXLPHYSICAL addr, int group_id);
-void validate_virt(RedMemSlotInfo *info, unsigned long virt, int slot_id,
- uint32_t add_size, uint32_t 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 group_id, int *error);
-void *validate_chunk (RedMemSlotInfo *info, QXLPHYSICAL data, uint32_t group_id, uint32_t *data_size_out, QXLPHYSICAL *next_out);
+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,