Re: [libvirt] [PATCH v2] storage: Disallow usage of the HBA for a fc_host backing

2017-07-25 Thread Erik Skultety
> One would hope it doesn't fail... Even if it does, virSCSIHostGetNumber does report an error already. > > Your suggestions make checkName much cleaner: > > if (virSCSIHostGetNumber(name, &host_num) && > virVHBAIsVportCapable(NULL, host_num)) > return true; > if virSCSIHostG

Re: [libvirt] [PATCH v2] storage: Disallow usage of the HBA for a fc_host backing

2017-07-25 Thread John Ferlan
On 07/25/2017 08:49 AM, Erik Skultety wrote: > On Tue, Jul 25, 2017 at 07:36:48AM -0400, John Ferlan wrote: >> >> >> On 07/25/2017 03:45 AM, Erik Skultety wrote: +/** + * @name: Name from a wwnn/wwpn lookup + * + * Validate that the @name fetched from the wwnn/wwpn is a vHBA a

Re: [libvirt] [PATCH v2] storage: Disallow usage of the HBA for a fc_host backing

2017-07-25 Thread Erik Skultety
On Tue, Jul 25, 2017 at 07:36:48AM -0400, John Ferlan wrote: > > > On 07/25/2017 03:45 AM, Erik Skultety wrote: > >> +/** > >> + * @name: Name from a wwnn/wwpn lookup > >> + * > >> + * Validate that the @name fetched from the wwnn/wwpn is a vHBA and not > >> + * an HBA as that should be a configura

Re: [libvirt] [PATCH v2] storage: Disallow usage of the HBA for a fc_host backing

2017-07-25 Thread John Ferlan
On 07/25/2017 03:45 AM, Erik Skultety wrote: >> +/** >> + * @name: Name from a wwnn/wwpn lookup >> + * >> + * Validate that the @name fetched from the wwnn/wwpn is a vHBA and not >> + * an HBA as that should be a configuration error. It's only possible to >> + * use an existing wwnn/wwpn of a vHB

Re: [libvirt] [PATCH v2] storage: Disallow usage of the HBA for a fc_host backing

2017-07-25 Thread Erik Skultety
> +/** > + * @name: Name from a wwnn/wwpn lookup > + * > + * Validate that the @name fetched from the wwnn/wwpn is a vHBA and not > + * an HBA as that should be a configuration error. It's only possible to > + * use an existing wwnn/wwpn of a vHBA because that's what someone would > + * have create

[libvirt] [PATCH v2] storage: Disallow usage of the HBA for a fc_host backing

2017-07-24 Thread John Ferlan
Disallow providing the wwnn/wwpn of the HBA in the adapter XML: This should be considered a configuration error since a vHBA would not be created. In order to use the HBA as the backing the following XML should be used: So add a check prior to the checkParent call to validate that the pro