Muli Salem has uploaded a new change for review. Change subject: core: Do Not Fail RunVm on Non-Activated Vnic (#854978) ......................................................................
core: Do Not Fail RunVm on Non-Activated Vnic (#854978) https://bugzilla.redhat.com/854978 Makes sure the Vds is not required to have networks that are defined on non-active Vnics of the VM, for running the VM. Signed-off-by: Muli Salem <[email protected]> Change-Id: I1834acde0800562b653ba19648f5b8a1fa64733b --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsSelector.java 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/78/7878/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsSelector.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsSelector.java index f436762..51b137e 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsSelector.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsSelector.java @@ -327,12 +327,20 @@ return readyToRun.isEmpty() ? Guid.Empty : getBestVdsToRun(readyToRun); } + /** + * Determine whether all required networks are assigned to the VDS's nics. Required networks are the networks that + * are defined on active vnics of the VM. + * + * @param vdsId + * The VDS id. + * @return <c>true</c> if all required networks are assigned to a host nic, otherwise, <c>false</c>. + */ boolean areRequiredNetworksAvailable(Guid vdsId) { final List<VdsNetworkInterface> allInterfacesForVds = getInterfaceDAO().getAllInterfacesForVds(vdsId); for (final VmNetworkInterface vmIf : getVmNICs()) { boolean found = false; for (final VdsNetworkInterface vdsIf : allInterfacesForVds) { - if (StringUtils.equals(vmIf.getNetworkName(), vdsIf.getNetworkName())) { + if (!vmIf.isActive() || StringUtils.equals(vmIf.getNetworkName(), vdsIf.getNetworkName())) { found = true; break; } -- To view, visit http://gerrit.ovirt.org/7878 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1834acde0800562b653ba19648f5b8a1fa64733b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Muli Salem <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
