xen: hvm: Abstract away memory region name ref

The mr->name field is removed. This slipped through compile testing.
Fix.

Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Peter Crosthwaite 2014-08-25 20:09:48 -07:00 committed by Paolo Bonzini
parent dc6c4fe837
commit 3e1f50867b

View File

@ -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;
}
}