From 3f9380fdbb41a52ac8288ea4f0333d59b556ec76 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 1 Mar 2007 23:24:09 +0000 Subject: [PATCH] Change way we look for xend errors (Kazuki Mizushima ) --- ChangeLog | 6 ++++++ src/xend_internal.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f07f607e5..aa597fce11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 01 18;22:23 EST 2007 Daniel P. Berrange + + * src/xend_internal.c: Instead of looking for string 'Cannot' + in POST response, look for 'xend.err' which is likely to catch + many more error replies from XenD. Signed-off-by: Kazuki Mizushima + Thu Mar 01 16:17:48 EST 2007 Mark McLoughlin * acinclude.m4: add LIBVIRT_COMPILE_WARNINGS, copied from diff --git a/src/xend_internal.c b/src/xend_internal.c index f7288d61f3..ec38c49eb1 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -511,10 +511,10 @@ xend_post(virConnectPtr xend, const char *path, const char *ops, } else if ((ret == 202) && (strstr(content, "failed") != NULL)) { virXendError(xend, VIR_ERR_POST_FAILED, content); ret = -1; - } else if ((ret == 202) && (strstr(content, "Cannot") != NULL)) { - /* This is to catch case of 'virsh dump Domain-0 foo' - * which returns a success code, but the word 'Cannot' - * in body to indicate error + } else if (((ret >= 200) && (ret <= 202)) && (strstr(content, "xend.err") != NULL)) { + /* This is to catch case of things like 'virsh dump Domain-0 foo' + * which returns a success code, but the word 'xend.err' + * in body to indicate error :-( */ virXendError(xend, VIR_ERR_POST_FAILED, content); ret = -1;