From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Murray Subject: Re: [PATCH v5 3/7] libxl/libxl_domain_info: Log if domain not found. Date: Fri, 03 Apr 2015 23:12:15 +0100 Message-ID: <551F103F.2000209@yahoo.co.uk> References: <1428091354-6720-1-git-send-email-konrad.wilk@oracle.com> <1428091354-6720-4-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-4-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: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 03/04/15 21:02, Konrad Rzeszutek Wilk wrote: > If we cannot find the domain - log an error (and still > continue returning an error). Forgive me if I am misunderstanding the effect of this patch (I tried to find the original rationale but failed). If the effect is that commands such as xl domid will cause a log entry when the specified domain doesn't exist, I would suggest that's going to be a problem for people that use that or similar commands to tell if a domain is present or still alive. I use it as part of a back-up script to make sure a domain shutdown before the script continues. I suspect many other people will be doing something similar. Apologies if I have the wrong end of the stick! Thanks, Ian. > > 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;