aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xen-hvm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xen-hvm.c b/xen-hvm.c
index d763e86f24..0d09940111 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -291,6 +291,7 @@ static int xen_add_to_physmap(XenIOState *state,
hwaddr pfn, start_gpfn;
hwaddr phys_offset = memory_region_get_ram_addr(mr);
char path[80], value[17];
+ const char *mr_name;
if (get_physmapping(state, start_addr, size)) {
return 0;
@@ -326,11 +327,13 @@ go_physmap:
}
}
+ mr_name = memory_region_name(mr);
+
physmap = g_malloc(sizeof (XenPhysmap));
physmap->start_addr = start_addr;
physmap->size = size;
- physmap->name = mr->name;
+ physmap->name = mr_name;
physmap->phys_offset = phys_offset;
QLIST_INSERT_HEAD(&state->physmap, physmap, list);
@@ -354,11 +357,11 @@ go_physmap:
if (!xs_write(state->xenstore, 0, path, value, strlen(value))) {
return -1;
}
- if (mr->name) {
+ if (mr_name) {
snprintf(path, sizeof(path),
"/local/domain/0/device-model/%d/physmap/%"PRIx64"/name",
xen_domid, (uint64_t)phys_offset);
- if (!xs_write(state->xenstore, 0, path, mr->name, strlen(mr->name))) {
+ if (!xs_write(state->xenstore, 0, path, mr_name, strlen(mr_name))) {
return -1;
}
}