]> xenbits.xensource.com Git - libvirt.git/commitdiff
domain_conf.c: skip checking ZPCI address is incomplete if not present
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Fri, 26 Jun 2020 21:49:00 +0000 (18:49 -0300)
committerAndrea Bolognani <abologna@redhat.com>
Sat, 27 Jun 2020 13:24:58 +0000 (15:24 +0200)
Commit 076591009ad1 ("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: 076591009ad11ec108521b52a4945d0f895fa160
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/conf/domain_conf.c

index 31ba78b950059567819d778608ff326f4ab2c066..33f177b16f208d9ee486980821c525de069e320e 100644 (file)
@@ -7522,11 +7522,11 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
                               virTristateSwitchTypeToString(info->addr.pci.multi));
         }
 
-        if (virZPCIDeviceAddressIsIncomplete(&info->addr.pci.zpci)) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("Missing uid or fid attribute of zPCI address"));
-        }
         if (virZPCIDeviceAddressIsPresent(&info->addr.pci.zpci)) {
+            if (virZPCIDeviceAddressIsIncomplete(&info->addr.pci.zpci))
+                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                               _("Missing uid or fid attribute of zPCI address"));
+
             virBufferAsprintf(&childBuf,
                               "<zpci uid='0x%.4x' fid='0x%.8x'/>\n",
                               info->addr.pci.zpci.uid.value,