提交 5040c8da 编写于 作者: J John Ferlan 提交者: Cole Robinson

conf: Add check for non scsi_host parent during vport delete

https://bugzilla.redhat.com/show_bug.cgi?id=1420740

If the parent is not a scsi_host, then we can just happily return since
we won't be removing a vport.

Fixes a bug with the following output:

$ virsh pool-destroy host4_hba_pool
error: Failed to destroy pool host4_hba_pool
error: internal error: Invalid adapter name 'pci_0000_10_00_1' for SCSI pool

$

(cherry picked from commit 84f178bd)
上级 268c7e08
...@@ -2075,6 +2075,13 @@ virNodeDeviceDeleteVport(virConnectPtr conn, ...@@ -2075,6 +2075,13 @@ virNodeDeviceDeleteVport(virConnectPtr conn,
if (!(vhba_parent = virNodeDeviceGetParentName(conn, scsi_host_name))) if (!(vhba_parent = virNodeDeviceGetParentName(conn, scsi_host_name)))
goto cleanup; goto cleanup;
/* If the parent is not a scsi_host, then this is a pool backed
* directly to an HBA and there's no vHBA to remove - so we're done */
if (!STRPREFIX(vhba_parent, "scsi_host")) {
ret = 0;
goto cleanup;
}
if (virSCSIHostGetNumber(vhba_parent, &parent_host) < 0) if (virSCSIHostGetNumber(vhba_parent, &parent_host) < 0)
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册