From: Konrad Rzeszutek Wilk Subject: [PATCH v5 3/7] libxl/libxl_domain_info: Log if domain not found. Date: Fri, 3 Apr 2015 16:02:30 -0400 Message-ID: <1428091354-6720-4-git-send-email-konrad.wilk@oracle.com> References: <1428091354-6720-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1428091354-6720-1-git-send-email-konrad.wilk@oracle.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@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, wei.liu2@citrix.com Cc: Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org If we cannot find the domain - log an error (and still continue returning an error). Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Ian Campbell --- tools/libxl/libxl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index c0e9cfe..8753e27 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -698,8 +698,10 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r, LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list"); return ERROR_FAIL; } - if (ret==0 || xcinfo.domain != domid) return ERROR_DOMAIN_NOTFOUND; - + if (ret==0 || xcinfo.domain != domid) { + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Domain %d not found!", domid); + return ERROR_DOMAIN_NOTFOUND; + } if (info_r) xcinfo2xlinfo(ctx, &xcinfo, info_r); return 0; -- 2.1.0