From: Don Slutz Subject: [PATCH v5 16/17] xenctx: Allow output for offline vcpu when specified. Date: Thu, 20 Mar 2014 15:07:04 -0400 Message-ID: <1395342425-16260-17-git-send-email-dslutz@verizon.com> References: <1395342425-16260-1-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1395342425-16260-1-git-send-email-dslutz@verizon.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: xen-devel@lists.xen.org Cc: Ian Campbell , Stefano Stabellini , George Dunlap , Ian Jackson , Don Slutz , Jan Beulich List-Id: xen-devel@lists.xenproject.org xc_domain_hvm_getcontext_partial() will fail to get data for an offline cpu. Switch back to PV mode of calculating ctxt_word_size and guest_word_size in the case. Signed-off-by: Don Slutz --- tools/xentrace/xenctx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c index e7ef09b..d6e85ac 100644 --- a/tools/xentrace/xenctx.c +++ b/tools/xentrace/xenctx.c @@ -994,6 +994,11 @@ static void dump_ctx(int vcpu) if (xc_domain_hvm_getcontext_partial( xenctx.xc_handle, xenctx.domid, HVM_SAVE_CODE(CPU), vcpu, &cpuctx, sizeof cpuctx) != 0) { + if ( errno == EBADSLT ) + { + printf("Note: vcpu%d offline:\n\n", vcpu); + goto vcpu_off_line; + } perror("xc_domain_hvm_getcontext_partial"); return; } @@ -1007,6 +1012,7 @@ static void dump_ctx(int vcpu) ctxt_word_size = (strstr(xen_caps, "xen-3.0-x86_64")) ? 8 : 4; } else { unsigned int gw; + vcpu_off_line: if ( !xc_domain_get_guest_width(xenctx.xc_handle, xenctx.domid, &gw) ) ctxt_word_size = guest_word_size = gw; } -- 1.8.4