
From Arik Hadas <ahadas@redhat.com>:
Arik Hadas has submitted this change and it was merged. Change subject: restapi + engine : handle scenarios for graphicsconsoles APIs ...................................................................... restapi + engine : handle scenarios for graphicsconsoles APIs When using /graphicsconsoles REST apis for deleting or adding a graphic device to an existing VM, there are cases that the VM is left after the operation with no graphic devices (all was removed) but with a video device OR lest with one graphic devide (which was added to a headless VM) and no video device. This patch handle all those senrois for the /graphicsconsoles APIS (GET, POST, DELETE) such that in case the last graphic device was removed-the video device also removed and the entity becomes headless. and also in case the first graphic device is added to a headless entity, a "QXL" video device is also added. Those changes are relevant for VMs, Templates and Instance-types: e.g. for adding a graphic device: POST ..api/instancetypes/<instancetype-id>/graphicsconsoles <graphics_console> <protocol>spice</protocol> </graphics_console> POST ..api/templates/<template-id>/graphicsconsoles ... POST ..api/vms/<vm-id>/graphicsconsoles ... For removing a graphic device: DELETE ..api/instancetypes/<instancetype-id>/graphicsconsoles/<console-id> DELETE ..api/templates/<template-id>/graphicsconsoles/<console-id> DELETE ..api/vms/<vm-id>/graphicsconsoles/<console-id> Change-Id: I15d94b31d91d51b0319af9100fcb45f1e1984ad8 Bug-Url: https://bugzilla.redhat.com/1414086 Signed-off-by: Sharon Gratch <sgratch@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractGraphicsDeviceCommand.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddGraphicsAndVideoDevicesCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddGraphicsDeviceCommand.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveGraphicsAndVideoDevicesCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendGraphicsConsoleHelper.java M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendInstanceTypeGraphicsConsolesResource.java M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendTemplateGraphicsConsolesResource.java M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmGraphicsConsolesResource.java 10 files changed, 159 insertions(+), 8 deletions(-) Approvals: Jenkins CI: Passed CI tests Sharon Gratch: Verified Shmuel Leib Melamud: Looks good to me, but someone else must approve Arik Hadas: Looks good to me, approved -- To view, visit https://gerrit.ovirt.org/70694 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15d94b31d91d51b0319af9100fcb45f1e1984ad8 Gerrit-PatchSet: 7 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sharon Gratch <sgratch@redhat.com> Gerrit-Reviewer: Arik Hadas <ahadas@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Juan Hernandez <juan.hernandez@redhat.com> Gerrit-Reviewer: Sharon Gratch <sgratch@redhat.com> Gerrit-Reviewer: Shmuel Leib Melamud <smelamud@redhat.com> Gerrit-Reviewer: Tomas Jelinek <tjelinek@redhat.com> Gerrit-Reviewer: gerrit-hooks <automation@ovirt.org>