Arik Hadas has uploaded a new change for review. Change subject: core: replace negative with positive check in RunVmCommand ......................................................................
core: replace negative with positive check in RunVmCommand Minor refactoring in RunVmCommand changing negative check with positive one in a ternary structure - making it more readable Change-Id: I6588f22bf6a5f8e2bc2dcd5a01f147f8c6a09c99 Signed-off-by: Arik Hadas <aha...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/11793/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java index d5cd07f..6693dfc 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java @@ -516,13 +516,13 @@ getVm().setConsoleUserId(null); getParameters().setRunAsStateless(getVmRunHandler().shouldVmRunAsStateless(getParameters(), getVm())); - // if Use Vnc is null it means runVM was launch not from the run - // once command - if (getParameters().getUseVnc() != null) { - getVm().setDisplayType(getParameters().getUseVnc() ? DisplayType.vnc : DisplayType.qxl); - } else { - getVm().setDisplayType(getVm().getDefaultDisplayType()); - } + + getVm().setDisplayType(getParameters().getUseVnc() == null ? + getVm().getDefaultDisplayType() : + // if Use Vnc is not null it means runVM was launch from the run once command, thus + // the VM can run with display type which is different from its default display type + (getParameters().getUseVnc() ? DisplayType.vnc : DisplayType.qxl)); + if (getParameters().getReinitialize()) { getVm().setUseSysPrep(true); } -- To view, visit http://gerrit.ovirt.org/11793 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6588f22bf6a5f8e2bc2dcd5a01f147f8c6a09c99 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches