[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH bugfix v1 1/3] xen: hvm: Abstract away memory re
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [PATCH bugfix v1 1/3] xen: hvm: Abstract away memory region name ref (fix broken build) |
Date: |
Thu, 21 Aug 2014 20:27:07 +0100 |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Wed, 20 Aug 2014, Peter Maydell wrote:
> On 20 August 2014 09:53, Stefan Weil <address@hidden> 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 <address@hidden>
> >> ---
> >>
> >> 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.