提交 3e1f5086 编写于 作者: P Peter Crosthwaite 提交者: Paolo Bonzini

xen: hvm: Abstract away memory region name ref

The mr->name field is removed. This slipped through compile testing.
Fix.
Reviewed-by: NStefan Weil <sw@weilnetz.de>
Signed-off-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 dc6c4fe8
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册