On 20 August 2014 09:53, Stefan Weil <s...@weilnetz.de> wrote: > Am 20.08.2014 um 07:07 schrieb Peter Crosthwaite: >> The mr->name field is removed. This slipped through compile testing. >> Fix. >> >> Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com> >> --- >> >> xen-hvm.c | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/xen-hvm.c b/xen-hvm.c >> index 91de2e2..9fd9d6e 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 = (char *)mr->name; >> + physmap->name = (char *)mr_name; > > This type cast can be removed. Just add the const in XenPhysmap's name > declaration.
Yes, I noticed that dodgy cast too. Stefano, is there a reason why the XenPhysmap field isn't just a const pointer? thanks -- PMM