提交 e9840196 编写于 作者: C Cole Robinson 提交者: Daniel Veillard

domain: Fix PCI address decimal parsing regression

<hostdev> address parsing previously attempted to detect the number
base: currently it is hardcoded to base 16, which can break PCI
assignment via virt-manager. Revert to the previous behavior.

* src/conf/domain_conf.c: virDomainDevicePCIAddressParseXML, switch to
  virStrToLong_ui(bus, NULL, 0, ...) to autodetect base
上级 34dcbbb4
...@@ -1079,28 +1079,28 @@ virDomainDevicePCIAddressParseXML(xmlNodePtr node, ...@@ -1079,28 +1079,28 @@ virDomainDevicePCIAddressParseXML(xmlNodePtr node,
function = virXMLPropString(node, "function"); function = virXMLPropString(node, "function");
if (domain && if (domain &&
virStrToLong_ui(domain, NULL, 16, &addr->domain) < 0) { virStrToLong_ui(domain, NULL, 0, &addr->domain) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s", virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'domain' attribute")); _("Cannot parse <address> 'domain' attribute"));
goto cleanup; goto cleanup;
} }
if (bus && if (bus &&
virStrToLong_ui(bus, NULL, 16, &addr->bus) < 0) { virStrToLong_ui(bus, NULL, 0, &addr->bus) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s", virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'bus' attribute")); _("Cannot parse <address> 'bus' attribute"));
goto cleanup; goto cleanup;
} }
if (slot && if (slot &&
virStrToLong_ui(slot, NULL, 16, &addr->slot) < 0) { virStrToLong_ui(slot, NULL, 0, &addr->slot) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s", virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'slot' attribute")); _("Cannot parse <address> 'slot' attribute"));
goto cleanup; goto cleanup;
} }
if (function && if (function &&
virStrToLong_ui(function, NULL, 16, &addr->function) < 0) { virStrToLong_ui(function, NULL, 0, &addr->function) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s", virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'function' attribute")); _("Cannot parse <address> 'function' attribute"));
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册