]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Return the vHBA name from virNodeDeviceCreateVport
authorJohn Ferlan <jferlan@redhat.com>
Fri, 27 Jan 2017 23:50:57 +0000 (18:50 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 16 Mar 2017 01:17:47 +0000 (21:17 -0400)
commit08c0ea16fcd3a4bf119ba3675431acfe75f29849
tree70a90fc99133ccd2d1b0db9bf85825d7c0f834fa
parent106930aaa7565f881e9238657d971a7dedb85aba
conf: Return the vHBA name from virNodeDeviceCreateVport

Rather than returning true/false and having the caller check if the
vHBA was actually created, let's do that check within the CreateVport
function. That way the caller can faithfully assume success based
on a name start the thread looking for the LUNs. Prior to this change
it's possible that the vHBA wasn't really created (e.g if the call to
virVHBAGetHostByWWN returned NULL), we'd claim success, but in reality
there'd be no vHBA for the pool. This also fixes a second yet seen
issue that if the nodedev was present, but the parent by name wasn't
provided (perhaps parent by wwnn/wwpn or by fabric_name), then a failure
would be returned. For this path it shouldn't be an error - we should
just be happy that something else is managing the device and we don't
have to create/delete it.

The end result is that the createVport code can now just start the
refresh thread once it gets a non NULL name back.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/conf/node_device_conf.c
src/conf/node_device_conf.h
src/storage/storage_backend_scsi.c