WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 1 of 5] tools: Add xc_domain_set_memory_map and x

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1 of 5] tools: Add xc_domain_set_memory_map and xc_get_machine_memory_map calls
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Fri, 8 Apr 2011 09:19:45 -0400
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "keir.fraser@xxxxxxxxxxxxx" <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Fri, 08 Apr 2011 06:20:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1302250739.27835.47.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1302207921@xxxxxxxxxxxxxxxxxxxxxxx> <decab6c21cc3d7ce4d4d.1302207922@xxxxxxxxxxxxxxxxxxxxxxx> <1302250739.27835.47.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Apr 08, 2011 at 09:18:59AM +0100, Ian Campbell wrote:
> On Thu, 2011-04-07 at 21:25 +0100, Konrad Rzeszutek Wilk wrote:
> > # HG changeset patch
> > # User Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> > # Date 1302194186 14400
> > # Node ID decab6c21cc3d7ce4d4dad949d34ba35d4600490
> > # Parent  97763efc41f9b664cf6f7db653c9c3f51e50b358
> > tools: Add xc_domain_set_memory_map and xc_get_machine_memory_map calls.
> > 
> > The later retrieves the E820 as seen by the hypervisor (completly
> > unchanged) and the second call sets the E820 for a specific guest.
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> > 
> > diff -r 97763efc41f9 -r decab6c21cc3 tools/libxc/xc_domain.c
> > --- a/tools/libxc/xc_domain.c       Tue Apr 05 18:23:54 2011 +0100
> > +++ b/tools/libxc/xc_domain.c       Thu Apr 07 12:36:26 2011 -0400
> > @@ -510,6 +510,55 @@
> 
> Please add:
>         [diff]
>         showfunc = True
> to your ~/.hgrc

Aye aye
> 
> >  
> >      return rc;
> >  }
> > +
> > +int xc_domain_set_memory_map(xc_interface *xch,
> > +                               uint32_t domid,
> > +                               struct e820entry entries[],
> > +                               uint32_t nr_entries)
> > +{
> > +    int rc;
> > +    struct xen_foreign_memory_map fmap = {
> > +        .domid = domid,
> > +        .map = { .nr_entries = nr_entries }
> > +    };
> > +    DECLARE_HYPERCALL_BOUNCE(entries, nr_entries * sizeof(struct 
> > e820entry),
> > +                             XC_HYPERCALL_BUFFER_BOUNCE_IN);
> > +
> > +    if ( !entries || xc_hypercall_bounce_pre(xch, entries) )
> > +        return -1;
> > +
> > +    set_xen_guest_handle(fmap.map.buffer, entries);
> > +
> > +    rc = do_memory_op(xch, XENMEM_set_memory_map, &fmap, sizeof(fmap));
> > +
> > +    xc_hypercall_bounce_post(xch, entries);
> > +
> > +    return rc;
> > +}
> 
> Should probably reimplement xc_domain_set_memmap_limit() as a wrapper
> around this new function. And/or nuke it if that's an option.

Yes! Will do that.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>