提交 d482cf6b 编写于 作者: D Daniel Henrique Barboza 提交者: Andrea Bolognani

domain_conf.c: skip checking ZPCI address is incomplete if not present

Commit 07659100 ("conf: fix zPCI address auto-generation on
s390") is doing a check for virZPCIDeviceAddressIsIncomplete()
prior to checking if the device has a ZPCI address at all. This
results in errors like these when starting libvirt:

  error : virDomainDeviceInfoFormat:7527 : internal error:
  Missing uid or fid attribute of zPCI address

Fix it by moving virZPCIDeviceAddressIsIncomplete() after the
check done by virZPCIDeviceAddressIsPresent().

Fixes: 07659100Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
上级 f6f74529
...@@ -7522,11 +7522,11 @@ virDomainDeviceInfoFormat(virBufferPtr buf, ...@@ -7522,11 +7522,11 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
virTristateSwitchTypeToString(info->addr.pci.multi)); virTristateSwitchTypeToString(info->addr.pci.multi));
} }
if (virZPCIDeviceAddressIsIncomplete(&info->addr.pci.zpci)) { if (virZPCIDeviceAddressIsPresent(&info->addr.pci.zpci)) {
if (virZPCIDeviceAddressIsIncomplete(&info->addr.pci.zpci))
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing uid or fid attribute of zPCI address")); _("Missing uid or fid attribute of zPCI address"));
}
if (virZPCIDeviceAddressIsPresent(&info->addr.pci.zpci)) {
virBufferAsprintf(&childBuf, virBufferAsprintf(&childBuf,
"<zpci uid='0x%.4x' fid='0x%.8x'/>\n", "<zpci uid='0x%.4x' fid='0x%.8x'/>\n",
info->addr.pci.zpci.uid.value, info->addr.pci.zpci.uid.value,
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册