[PATCH 2/3] domain_conf: Move zPCI validation from formatter to validator

Andrea Bolognani abologna at redhat.com
Mon Jun 29 09:58:13 UTC 2020


On Mon, 2020-06-29 at 09:43 +0200, Michal Privoznik wrote:
> +++ b/src/qemu/qemu_validate.c
> @@ -1028,6 +1028,12 @@ qemuValidateDomainDeviceDefZPCIAddress(virDomainDeviceInfoPtr info,
>          return -1;
>      }
>  
> +    if (virDeviceInfoPCIAddressExtensionIsWanted(info)) {
> +        virReportError(VIR_ERR_XML_ERROR, "%s",
> +                       _("Missing uid or fid attribute of zPCI address"));
> +        return -1;
> +    }

Throwing an XML_ERROR here doesn't seem right, because from the
user's point of view it's perfectly fine to only provide a partial
zPCI address: by the point we get here, we've already gone through
the PostParse callback, so if either attribute is missing that's
because of a developer mistake.

Do we even need this check at all? I'm the one who asked for it to
be introduced, but now I'm questioning that :)

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list