https://bugzilla.redhat.com/show_bug.cgi?id=
1458708
If the parent provided for the storage pool adapter is not vHBA
capable, then issue a configuration error even though the provided
wwnn/wwpn were found.
It is a configuration error to provide a mismatched parent to
the wwnn/wwpn. The @parent is optional and is used as a means to
perform duplicate pool source checks.
const char *name,
const char *parent_name)
{
+ unsigned int host_num;
char *scsi_host_name = NULL;
char *vhba_parent = NULL;
bool retval = false;
if (!conn)
return true;
+ if (virSCSIHostGetNumber(parent_name, &host_num) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("parent '%s' is not properly formatted"),
+ parent_name);
+ goto cleanup;
+ }
+
+ if (!virVHBAPathExists(NULL, host_num)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("parent '%s' is not an fc_host for the wwnn/wwpn"),
+ parent_name);
+ goto cleanup;
+ }
+
if (virAsprintf(&scsi_host_name, "scsi_%s", name) < 0)
goto cleanup;