]> xenbits.xensource.com Git - libvirt.git/commitdiff
domain_conf: Remove zPCI validation from formatter
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 27 Jun 2020 07:09:39 +0000 (09:09 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 29 Jun 2020 11:44:00 +0000 (13:44 +0200)
In 076591009ad a validation code was added to
virDomainDeviceInfoFormat() which reports an error if zPCI
address entered in was incomplete. But, there are two problems
with this approach.

The first problem is the placement of the code - it doesn't
belong into XML formatter rather than XML validator.

The second one is that at the point of formatting XML the post
parse callback has run and thus filled in required info.
Therefore this check can never do something useful and instead of
moving it into validator, it's removed completely.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/conf/domain_conf.c

index 33f177b16f208d9ee486980821c525de069e320e..0c883cd834056e0b60f98303deb36aa46f0278c2 100644 (file)
@@ -7523,10 +7523,6 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
         }
 
         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,