提交 3ad8a273 编写于 作者: D Daniel P. Berrange

Improve error reporting in Xen driver SEXPR generation

上级 b2f5ba21
Wed Apr 1 10:58:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
Improve error reporting in SEXPR generation
* src/xm_internal.c, src/xend_internal.c: Avoid overwriting
previously set error message. Clarify message when network
lookup fails
Wed Apr 1 10:55:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
* src/node_device.c: Fix error message for missing node device
......
......@@ -3850,8 +3850,6 @@ xenDaemonCreateXML(virConnectPtr conn, const char *xmlDesc,
return (NULL);
if (!(sexpr = xenDaemonFormatSxpr(conn, def, priv->xendConfigVersion))) {
virXendError(conn, VIR_ERR_XML_ERROR,
"%s", _("failed to build sexpr"));
virDomainDefFree(def);
return (NULL);
}
......@@ -5214,7 +5212,7 @@ xenDaemonFormatSxprNet(virConnectPtr conn,
char *bridge;
if (!network) {
virXendError(conn, VIR_ERR_NO_SOURCE, "%s",
virXendError(conn, VIR_ERR_NO_NETWORK, "%s",
def->data.network.name);
return -1;
}
......@@ -5222,7 +5220,8 @@ xenDaemonFormatSxprNet(virConnectPtr conn,
bridge = virNetworkGetBridgeName(network);
virNetworkFree(network);
if (!bridge) {
virXendError(conn, VIR_ERR_NO_SOURCE, "%s",
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
_("network %s is not active"),
def->data.network.name);
return -1;
}
......
......@@ -1734,11 +1734,8 @@ int xenXMDomainCreate(virDomainPtr domain) {
if (!(entry = virHashLookup(priv->configCache, filename)))
goto error;
if (!(sexpr = xenDaemonFormatSxpr(domain->conn, entry->def, priv->xendConfigVersion))) {
xenXMError(domain->conn, VIR_ERR_XML_ERROR,
"%s", _("failed to build sexpr"));
if (!(sexpr = xenDaemonFormatSxpr(domain->conn, entry->def, priv->xendConfigVersion)))
goto error;
}
ret = xenDaemonDomainCreateXML(domain->conn, sexpr);
VIR_FREE(sexpr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册