提交 db343ca8 编写于 作者: F Fabiano Fidêncio 提交者: John Ferlan

xen_common: Change xenConfigCopyStringInternal to use virConfGetValueString

Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 efc29ab2
...@@ -145,23 +145,13 @@ xenConfigCopyStringInternal(virConfPtr conf, ...@@ -145,23 +145,13 @@ xenConfigCopyStringInternal(virConfPtr conf,
char **value, char **value,
int allowMissing) int allowMissing)
{ {
virConfValuePtr val; int rc;
*value = NULL; *value = NULL;
if (!(val = virConfGetValue(conf, name))) { if ((rc = virConfGetValueString(conf, name, value)) < 0)
if (allowMissing)
return 0;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was missing"), name);
return -1; return -1;
}
if (val->type != VIR_CONF_STRING) { if (rc == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("config value %s was not a string"), name);
return -1;
}
if (!val->str) {
if (allowMissing) if (allowMissing)
return 0; return 0;
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
...@@ -169,7 +159,7 @@ xenConfigCopyStringInternal(virConfPtr conf, ...@@ -169,7 +159,7 @@ xenConfigCopyStringInternal(virConfPtr conf,
return -1; return -1;
} }
return VIR_STRDUP(*value, val->str); return 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册