Juan Hernandez has posted comments on this change. Change subject: Allow to avoid lock screen on spice disconnect ......................................................................
Patch Set 20: (4 comments) In the context of the RESTAPI the "console" term is currently used for the serial console. The term for the graphics console is "display". Consider moving the new element to the "Display" complex type, and name it just "disconnect_action". The value of that new element should be validated, either in "VMValidator" or, if you move to "Display", in "DisplayValidator". https://gerrit.ovirt.org/#/c/34079/20/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/ConsoleDisconnectAction.java File backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/ConsoleDisconnectAction.java: Line 3: import org.apache.commons.lang.StringUtils; Line 4: import org.slf4j.Logger; Line 5: import org.slf4j.LoggerFactory; Line 6: Line 7: public enum ConsoleDisconnectAction { Consider renaming to "DisplayDisconnectAction", as in the RESTAPI "console" is used for the serial console. Line 8: NONE, Line 9: LOCK_SCREEN, Line 10: LOGOUT, Line 11: REBOOT, https://gerrit.ovirt.org/#/c/34079/20/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd File backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd: Line 3298: <xs:element ref="migration" minOccurs="0" maxOccurs="1" /> Line 3299: <xs:element name="custom_properties" type="CustomProperties" minOccurs="0" maxOccurs="1"/> Line 3300: <xs:element name="custom_emulated_machine" type="xs:string" minOccurs="0" maxOccurs="1"/> Line 3301: <xs:element name="custom_cpu_model" type="xs:string" minOccurs="0" maxOccurs="1"/> Line 3302: <xs:element name="console_disconnect_action" type="xs:string" minOccurs="0" maxOccurs="1"/> Consider moving this to the "Display" complex type, and then name it just "disconnect_action". Line 3303: </xs:sequence> Line 3304: </xs:extension> Line 3305: </xs:complexContent> Line 3306: </xs:complexType> https://gerrit.ovirt.org/#/c/34079/20/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java: Line 177: @Mapping(from = ConsoleDisconnectAction.class, to = org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction.class) Line 178: public static org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction map(ConsoleDisconnectAction action, Line 179: org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction incoming) { Line 180: if (action == null) { Line 181: return org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction.LOCK_SCREEN; The RESTAPI should not decide what are the default values. If no value is given by the user then the RESTAPI should pass null to the backend, and then the backend should decide what is the default value. Line 182: } Line 183: switch (action) { Line 184: case NONE: Line 185: return org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction.NONE; Line 199: @Mapping(from = org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction.class, to = ConsoleDisconnectAction.class) Line 200: public static ConsoleDisconnectAction map(org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction action, Line 201: ConsoleDisconnectAction incoming) { Line 202: if (action == null) { Line 203: return ConsoleDisconnectAction.LOCK_SCREEN; Same, the RESTAPI doesn't decide what are default values. Line 204: } Line 205: switch (action) { Line 206: case NONE: Line 207: return ConsoleDisconnectAction.NONE; -- To view, visit https://gerrit.ovirt.org/34079 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2ef5ffaceed619f6630b56a7156f25e9111fd9e Gerrit-PatchSet: 20 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Vinzenz Feenstra <vfeen...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Martin Betak <mbe...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Shahar Havivi <shav...@redhat.com> Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com> Gerrit-Reviewer: Vinzenz Feenstra <vfeen...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches