mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
storage: Create virStoragePoolSourceMatchSingleHost
Split out the nhost == 1 and hosts[0].name logic into a separate routine Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
fc20b41271
commit
9aced8c9d5
@ -2405,6 +2405,16 @@ matchSCSIAdapterParent(virStoragePoolObjPtr pool,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
virStoragePoolSourceMatchSingleHost(virStoragePoolSourcePtr poolsrc,
|
||||
virStoragePoolSourcePtr defsrc)
|
||||
{
|
||||
if (poolsrc->nhost != 1 && defsrc->nhost != 1)
|
||||
return false;
|
||||
|
||||
return STREQ(poolsrc->hosts[0].name, defsrc->hosts[0].name);
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
virStoragePoolSourceISCSIMatch(virStoragePoolObjPtr matchpool,
|
||||
@ -2413,10 +2423,7 @@ virStoragePoolSourceISCSIMatch(virStoragePoolObjPtr matchpool,
|
||||
virStoragePoolSourcePtr poolsrc = &matchpool->def->source;
|
||||
virStoragePoolSourcePtr defsrc = &def->source;
|
||||
|
||||
if (poolsrc->nhost != 1 && defsrc->nhost != 1)
|
||||
return false;
|
||||
|
||||
if (STRNEQ(poolsrc->hosts[0].name, defsrc->hosts[0].name))
|
||||
if (!virStoragePoolSourceMatchSingleHost(poolsrc, defsrc))
|
||||
return false;
|
||||
|
||||
if (STRNEQ_NULLABLE(poolsrc->initiator.iqn, defsrc->initiator.iqn))
|
||||
|
Loading…
x
Reference in New Issue
Block a user