From 0dd5b654107103765994243017a7f0eb15fda341 Mon Sep 17 00:00:00 2001 From: Dario Faggioli Date: Tue, 10 Sep 2013 19:53:40 +0200 Subject: libxc: introduce xc_domain_get_guest_width() As a wrapper to XEN_DOMCTL_get_address_size, and use it wherever the call was being issued directly via do_domctl(), saving quite some line of code. Actually, the function returns the guest width in bytes, rather than directly what XEN_DOMCTL_get_address_size provides (which is a number of bits), since that is what it is useful almost everywhere. Signed-off-by: Dario Faggioli Acked-by: Ian Campbell --- tools/xentrace/xenctx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tools/xentrace') diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c index 060e480005..1214185bd8 100644 --- a/tools/xentrace/xenctx.c +++ b/tools/xentrace/xenctx.c @@ -771,12 +771,9 @@ static void dump_ctx(int vcpu) } ctxt_word_size = (strstr(xen_caps, "xen-3.0-x86_64")) ? 8 : 4; } else { - struct xen_domctl domctl; - memset(&domctl, 0, sizeof domctl); - domctl.domain = xenctx.domid; - domctl.cmd = XEN_DOMCTL_get_address_size; - if (xc_domctl(xenctx.xc_handle, &domctl) == 0) - ctxt_word_size = guest_word_size = domctl.u.address_size.size / 8; + unsigned int gw; + if ( !xc_domain_get_guest_width(xenctx.xc_handle, xenctx.domid, &gw) ) + ctxt_word_size = guest_word_size = gw; } } #endif -- cgit v1.2.3