[libvirt] [PATCH] Don't overwrite errors from xend_{get,req}

xenDaemonDomainFetch() was overwriting errors reported by xend_get() and xend_req(). E.g. without patch error: failed Xen syscall xenDaemonDomainFetch failed to find this domain with patch error: internal error Xend returned HTTP Content-Length of 73817, which exceeds maximum of 65536 --- src/xen/xend_internal.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index f44d674..957cd17 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -359,8 +359,10 @@ xend_get(virConnectPtr xend, const char *path, ret = xend_req(s, content); VIR_FORCE_CLOSE(s); - if (((ret < 0) || (ret >= 300)) && - ((ret != 404) || (!STRPREFIX(path, "/xend/domain/")))) { + if (ret < 0) + return ret; + + if ((ret >= 300) && ((ret != 404) || (!STRPREFIX(path, "/xend/domain/")))) { virXendError(VIR_ERR_GET_FAILED, _("%d status from xen daemon: %s:%s"), ret, path, NULLSTR(*content)); @@ -1810,12 +1812,8 @@ xenDaemonDomainFetch(virConnectPtr conn, root = sexpr_get(conn, "/xend/domain/%s?detail=1", name); else root = sexpr_get(conn, "/xend/domain/%d?detail=1", domid); - if (root == NULL) { - virXendError(VIR_ERR_XEN_CALL, - "%s", _("xenDaemonDomainFetch failed to" - " find this domain")); + if (root == NULL) return (NULL); - } priv = (xenUnifiedPrivatePtr) conn->privateData; -- 1.7.5.4

On 09/01/2011 04:27 PM, Jim Fehlig wrote:
xenDaemonDomainFetch() was overwriting errors reported by xend_get() and xend_req(). E.g. without patch
error: failed Xen syscall xenDaemonDomainFetch failed to find this domain
with patch
error: internal error Xend returned HTTP Content-Length of 73817, which exceeds maximum of 65536 --- src/xen/xend_internal.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-)
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Eric Blake wrote:
On 09/01/2011 04:27 PM, Jim Fehlig wrote:
xenDaemonDomainFetch() was overwriting errors reported by xend_get() and xend_req(). E.g. without patch
error: failed Xen syscall xenDaemonDomainFetch failed to find this domain
with patch
error: internal error Xend returned HTTP Content-Length of 73817, which exceeds maximum of 65536 --- src/xen/xend_internal.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-)
ACK.
Thanks, pushed.

Opps, sent a reply from @novell domain, which is now setting on the list server I suppose... Eric Blake wrote:
On 09/01/2011 04:27 PM, Jim Fehlig wrote:
xenDaemonDomainFetch() was overwriting errors reported by xend_get() and xend_req(). E.g. without patch
error: failed Xen syscall xenDaemonDomainFetch failed to find this domain
with patch
error: internal error Xend returned HTTP Content-Length of 73817, which exceeds maximum of 65536 --- src/xen/xend_internal.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-)
ACK.
Thanks, pushed.
participants (3)
-
Eric Blake
-
Jim Fehlig
-
Jim Fehlig