On Wed, 20 Aug 2014, Peter Maydell wrote: > On 20 August 2014 09:53, Stefan Weil <[email protected]> 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 <[email protected]> > >> --- > >> > >> 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? No reason, we could just switch to const char*. I would be happy to take a patch for that.
Sorry for the late reply, I am attending XenSummit/LinuxCon.
