From 10732a507140e029d237ccfeb61eeb777d3c434e Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 27 Feb 2007 15:50:03 +0000 Subject: [PATCH] Added additional check for failure of core dump on domain-0 --- ChangeLog | 5 +++++ src/xend_internal.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c6a9bf0bcf..4af0013bbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 27 10:49:35 EST 2007 Daniel P. Berrange + + * src/xend_internal.c: Check POST reply for 'Cannot' to detect + failure of core dump on Domain-0. Signed-off-by: Kazuki Mizushima + Tue Feb 27 10:35:35 EST 2007 Daniel P. Berrange * src/virsh.c: Fix SEGV when doing tab-completion of commands diff --git a/src/xend_internal.c b/src/xend_internal.c index bb42bc67da..f7288d61f3 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -508,7 +508,14 @@ xend_post(virConnectPtr xend, const char *path, const char *ops, if ((ret < 0) || (ret >= 300)) { virXendError(xend, VIR_ERR_POST_FAILED, content); - } else if ((ret = 202) && (strstr(content, "failed") != NULL)) { + } 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 + */ virXendError(xend, VIR_ERR_POST_FAILED, content); ret = -1; }