From 10960f2a1a7225d2902d24b9e67ed915592a0b4c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 21 Jun 2007 15:49:09 +0000 Subject: [PATCH] Thu Jun 21 16:48:00 BST 2007 Richard W.M. Jones * src/remote_internal.c: Fix virConnectGetMaxVcpus in the remote case when type parameter is NULL. * src/xend_internal.c: Proper error reporting in xenDaemonDomainDumpXML function. --- ChangeLog | 7 +++++++ src/remote_internal.c | 2 +- src/xend_internal.c | 16 +++++++++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c537c4eb6b..9ea9edb1af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Jun 21 16:48:00 BST 2007 Richard W.M. Jones + + * src/remote_internal.c: Fix virConnectGetMaxVcpus in the + remote case when type parameter is NULL. + * src/xend_internal.c: Proper error reporting in + xenDaemonDomainDumpXML function. + Thu Jun 21 11:35:00 EST 2007 Daniel P. Berrange * src/remote_interal.c: fix marshalling of 'id' field for diff --git a/src/remote_internal.c b/src/remote_internal.c index e9c879b9a7..33107103f7 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -985,7 +985,7 @@ remoteGetMaxVcpus (virConnectPtr conn, const char *type) GET_PRIVATE (conn, -1); memset (&ret, 0, sizeof ret); - args.type = (char **) &type; + args.type = type == NULL ? NULL : (char **) &type; if (call (conn, priv, 0, REMOTE_PROC_GET_MAX_VCPUS, (xdrproc_t) xdr_remote_get_max_vcpus_args, (char *) &args, (xdrproc_t) xdr_remote_get_max_vcpus_ret, (char *) &ret) == -1) diff --git a/src/xend_internal.c b/src/xend_internal.c index e823c7990b..7885484be1 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -2398,8 +2398,11 @@ xenDaemonDomainDumpXMLByID(virConnectPtr conn, int domid) xenUnifiedPrivatePtr priv; root = sexpr_get(conn, "/xend/domain/%d?detail=1", domid); - if (root == NULL) + if (root == NULL) { + virXendError (conn, VIR_ERR_XEN_CALL, + "xenDaemonDomainDumpXMLByID failed to find this domain"); return (NULL); + } priv = (xenUnifiedPrivatePtr) conn->privateData; @@ -2417,8 +2420,11 @@ xenDaemonDomainDumpXMLByName(virConnectPtr conn, const char *name) xenUnifiedPrivatePtr priv; root = sexpr_get(conn, "/xend/domain/%s?detail=1", name); - if (root == NULL) + if (root == NULL) { + virXendError (conn, VIR_ERR_XEN_CALL, + "xenDaemonDomainDumpXMLByName failed to find this domain"); return (NULL); + } priv = (xenUnifiedPrivatePtr) conn->privateData; @@ -2451,8 +2457,12 @@ xenDaemonDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED) } priv = (xenUnifiedPrivatePtr) domain->conn->privateData; - if (domain->id < 0 && priv->xendConfigVersion < 3) + if (domain->id < 0 && priv->xendConfigVersion < 3) { + virXendError (domain->conn, VIR_ERR_XEN_CALL, + "xenDaemonDomainDumpXML domain ID < 0 and xendConfigVersion < 3"); return(NULL); + } + if (domain->id < 0) return xenDaemonDomainDumpXMLByName(domain->conn, domain->name); else -- GitLab