From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 6/6] xl: 'xl list' supports '-c' for global claim information. Date: Fri, 15 Mar 2013 14:05:10 -0400 Message-ID: <20130315180510.GA26895@phenom.dumpdata.com> References: <1363011652-25949-1-git-send-email-konrad.wilk@oracle.com> <1363011652-25949-7-git-send-email-konrad.wilk@oracle.com> <1363171878.32410.147.camel@zakaz.uk.xensource.com> <20130313150236.GI25782@phenom.dumpdata.com> <1363190594.32410.212.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1363190594.32410.212.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "Tim (Xen.org)" , "xen-devel@lists.xensource.com" , "Keir (Xen.org)" , "konrad@kernel.org" List-Id: xen-devel@lists.xenproject.org On Wed, Mar 13, 2013 at 04:03:14PM +0000, Ian Campbell wrote: > On Wed, 2013-03-13 at 15:02 +0000, Konrad Rzeszutek Wilk wrote: > > On Wed, Mar 13, 2013 at 10:51:18AM +0000, Ian Campbell wrote: > > > On Mon, 2013-03-11 at 14:20 +0000, Konrad Rzeszutek Wilk wrote: > > > > When guests have XENMEM_claim_pages called, they influence a global > > > > counter value - which has the cumulative count of the number of > > > > pages requested by all domains. This value is provided via the > > > > XENMEM_get_unclaimed_pages hypercall. The value fluctuates quite > > > > often so the value is stale once it is provided to the user-space. > > > > However it is useful for diagnostic purposes. > > > > > > > > [v1: s/unclaimed/outstanding/] > > > > Signed-off-by: Konrad Rzeszutek Wilk > > > > --- > > > > tools/libxl/libxl.c | 12 ++++++++++++ > > > > tools/libxl/libxl.h | 1 + > > > > tools/libxl/libxl_types.idl | 4 ++++ > > > > tools/libxl/xl_cmdimpl.c | 29 +++++++++++++++++++++++++---- > > > > tools/libxl/xl_cmdtable.c | 4 +++- > > > > 5 files changed, 45 insertions(+), 5 deletions(-) > > > > > > > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > > > > index 0745888..fd5d725 100644 > > > > --- a/tools/libxl/libxl.c > > > > +++ b/tools/libxl/libxl.c > > > > @@ -4051,6 +4051,18 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr) > > > > return ret; > > > > } > > > > > > > > +int libxl_get_claiminfo(libxl_ctx *ctx, libxl_claiminfo *claiminfo) > > > > +{ > > > > + long l; > > > > + > > > > + l = xc_domain_get_outstanding_pages(ctx->xch); > > > > + if (l == -ENOSYS) > > > > > > Does this function really return -errno and not -1 + set errno on error? > > > > It should be -Exxxx. I need to double check with a hypervisor that does not > > have this hypercall implemented to make sure it actually does return > > a proper -E value. > > You should probably double check the call chain to make sure it > propagates the way you think. Remember that libc (not libxc) translates > the return value of the underlying ioctl used to make the hypercall from > -Efoo into -1 + errno=Efoo. Some libxc call paths then jump through > hoops to turn this back into -Efoo :-( Some libxc calls do either > depending on the error path they take :-(( It looks as it gets the righ value: > xl create vm-hvm.cfg Parsing config from vm-hvm.cfg WARNING: ignoring "kernel" directive for HVM guest. Use "firmware_override" instead if you really want a non-default firmware xc: info: VIRTUAL MEMORY ARRANGEMENT: Loader: 0000000000100000->000000000019c844 Modules: 0000000000000000->0000000000000000 TOTAL: 0000000000000000->00000000ff800000 ENTRY ADDRESS: 0000000000100000 xc: error: Could not allocate memory for HVM guest as we cannot claim memory! (38 = Function not implemented): Internal error libxl: error: libxl_dom.c:613:libxl__build_hvm: hvm building failed libxl: error: libxl_create.c:907:domcreate_rebuild_done: cannot (re-)build domain: -3 libxl: error: libxl_dm.c:1250:libxl__destroy_device_model: could not find device-model's pid for dom 1 libxl: error: libxl.c:1415:libxl__destroy_domid: libxl__destroy_device_model failed for 1 18:02:45 # 22 :/OVS/seed_pool/konrad/ > echo $? 3 and when running 'xl info' through strace: ioctl(5, SNDCTL_DSP_RESET, 0x7fffb7a4ebe0) = -1 ENOSYS (Function not implemented) write(2, "libxl_get_claiminfo failed.\n", 28libxl_get_claiminfo failed. ) = 28