[libvirt] [PATCH 07/11] iscsi: Change order of checks in createVport
Ján Tomko
jtomko at redhat.com
Mon Jan 2 14:28:40 UTC 2017
On Fri, Nov 18, 2016 at 09:26:33AM -0500, John Ferlan wrote:
>Move the check for an already existing vHBA to the top of the function.
>No sense in first decoding a provided parent if the next thing we're going
>to do is fail if a provided wwnn/wwpn already exists.
>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/storage/storage_backend_scsi.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
>@@ -736,6 +722,20 @@ createVport(virConnectPtr conn,
> goto cleanup;
> }
>
>+ /* If a parent was provided, then let's make sure it's vhost capable */
>+ if (adapter->data.fchost.parent) {
>+ if (virGetSCSIHostNumber(adapter->data.fchost.parent, &parent_host) < 0)
>+ return -1;
>+
>+ if (!virIsCapableFCHost(NULL, parent_host)) {
>+ virReportError(VIR_ERR_XML_ERROR,
>+ _("parent '%s' specified for vHBA "
>+ "is not vport capable"),
>+ adapter->data.fchost.parent);
>+ return -1;
These returns leak name, but the following patch fixes that.
ACK
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170102/aafc9e10/attachment-0001.sig>
More information about the libvir-list
mailing list