Libor Spevak has uploaded a new change for review. Change subject: engine,webadmin: Run and pause action enabled ......................................................................
engine,webadmin: Run and pause action enabled 'Start in Pause Mode' checkbox added to the Edit VM properties dialog, instead of only in the Run Once dialog. This is needed to assist the admin in boot-level troubleshooting. Allowing the VM to always start in paused mode without having to select "Run once" will save the admin time and hassle when starting and stopping VMs multiple times. Change-Id: Ib1fe46a9946f7914095310ddac9ab1a9e5a6564b Signed-off-by: Libor Spevak <lspe...@redhat.com> --- M backend/manager/dbscripts/create_views.sql A backend/manager/dbscripts/upgrade/03_03_0020_add_run_and_pause_to_vm.sql M backend/manager/dbscripts/vms_sp.sql M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmStatic.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java 16 files changed, 75 insertions(+), 24 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/64/13564/1 diff --git a/backend/manager/dbscripts/create_views.sql b/backend/manager/dbscripts/create_views.sql index 94ca169..0404a55 100644 --- a/backend/manager/dbscripts/create_views.sql +++ b/backend/manager/dbscripts/create_views.sql @@ -551,7 +551,7 @@ vm_statistics.usage_mem_percent as usage_mem_percent, vm_statistics.usage_cpu_percent as usage_cpu_percent, vds_static.vds_name as run_on_vds_name, vds_groups.cpu_name as vds_group_cpu_name, vm_static.default_display_type as default_display_type, vm_static.priority as priority,vm_static.iso_path as iso_path, vm_static.origin as origin, vds_groups.compatibility_version as vds_group_compatibility_version, vm_static.initrd_url as initrd_url, vm_static.kernel_url as kernel_url, vm_static.kernel_params as kernel_params, vm_dynamic.pause_status as pause_status, vm_dynamic.exit_message as exit_message, vm_dynamic.exit_status as exit_status,vm_static.migration_support as migration_support,vm_static.predefined_properties as predefined_properties,vm_static.userdefined_properties as userdefined_properties,vm_static.min_allocated_mem as min_allocated_mem, vm_dynamic.hash as hash, vm_static.cpu_pinning as cpu_pinning, vm_static.db_generation as db_generation, vm_static.host_cpu_flags as host_cpu_flags, - vm_static.tunnel_migration as tunnel_migration, vm_static.vnc_keyboard_layout as vnc_keyboard_layout + vm_static.tunnel_migration as tunnel_migration, vm_static.vnc_keyboard_layout as vnc_keyboard_layout, vm_static.is_run_and_pause as is_run_and_pause FROM vm_static INNER JOIN vm_dynamic ON vm_static.vm_guid = vm_dynamic.vm_guid INNER JOIN vm_static AS vm_templates ON vm_static.vmt_guid = vm_templates.vm_guid INNER JOIN @@ -588,7 +588,7 @@ vms.vds_group_compatibility_version, vms.initrd_url, vms.kernel_url, vms.kernel_params, vms.pause_status, vms.exit_status, vms.exit_message, vms.min_allocated_mem, storage_domain_static.id AS storage_id, vms.quota_id as quota_id, vms.quota_name as quota_name, vms.tunnel_migration as tunnel_migration, - vms.vnc_keyboard_layout as vnc_keyboard_layout + vms.vnc_keyboard_layout as vnc_keyboard_layout, vms.is_run_and_pause as is_run_and_pause FROM vms LEFT OUTER JOIN tags_vm_map_view ON vms.vm_guid = tags_vm_map_view.vm_id LEFT OUTER JOIN vm_device ON vm_device.vm_id = vms.vm_guid LEFT OUTER JOIN diff --git a/backend/manager/dbscripts/upgrade/03_03_0020_add_run_and_pause_to_vm.sql b/backend/manager/dbscripts/upgrade/03_03_0020_add_run_and_pause_to_vm.sql new file mode 100644 index 0000000..ac9f76d --- /dev/null +++ b/backend/manager/dbscripts/upgrade/03_03_0020_add_run_and_pause_to_vm.sql @@ -0,0 +1 @@ +select fn_db_add_column('vm_static', 'is_run_and_pause', 'boolean NOT NULL DEFAULT false'); diff --git a/backend/manager/dbscripts/vms_sp.sql b/backend/manager/dbscripts/vms_sp.sql index 9d27e1e..8211219 100644 --- a/backend/manager/dbscripts/vms_sp.sql +++ b/backend/manager/dbscripts/vms_sp.sql @@ -430,12 +430,13 @@ v_cpu_pinning VARCHAR(4000), v_host_cpu_flags BOOLEAN, v_tunnel_migration BOOLEAN, - v_vnc_keyboard_layout VARCHAR(16)) + v_vnc_keyboard_layout VARCHAR(16), + v_is_run_and_pause BOOLEAN) RETURNS VOID AS $procedure$ BEGIN -INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, vm_guid, VM_NAME, vmt_guid,domain,creation_date,num_of_monitors,allow_console_reconnect,is_initialized,is_auto_suspend,num_of_sockets,cpu_per_socket,usb_policy, time_zone,auto_startup,is_stateless,dedicated_vm_for_vds, fail_back, default_boot_sequence, vm_type, nice_level, default_display_type, priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem, entity_type, quota_id, cpu_pinning, is_smartcard_enabled,is_delete_protected,host_cpu_flags, tunnel_migration, vnc_keyboard_layout) - VALUES(v_description, v_mem_size_mb, v_os, v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_domain, v_creation_date, v_num_of_monitors, v_allow_console_reconnect, v_is_initialized, v_is_auto_suspend, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone, v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back, v_default_boot_sequence, v_vm_type, v_nice_level, v_default_display_type, v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem, 'VM', v_quota_id, v_cpu_pinning, v_is_smartcard_enabled,v_is_delete_protected,v_host_cpu_flags, v_tunnel_migration, v_vnc_keyboard_layout); +INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, vm_guid, VM_NAME, vmt_guid,domain,creation_date,num_of_monitors,allow_console_reconnect,is_initialized,is_auto_suspend,num_of_sockets,cpu_per_socket,usb_policy, time_zone,auto_startup,is_stateless,dedicated_vm_for_vds, fail_back, default_boot_sequence, vm_type, nice_level, default_display_type, priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem, entity_type, quota_id, cpu_pinning, is_smartcard_enabled,is_delete_protected,host_cpu_flags, tunnel_migration, vnc_keyboard_layout, is_run_and_pause) + VALUES(v_description, v_mem_size_mb, v_os, v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_domain, v_creation_date, v_num_of_monitors, v_allow_console_reconnect, v_is_initialized, v_is_auto_suspend, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone, v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back, v_default_boot_sequence, v_vm_type, v_nice_level, v_default_display_type, v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem, 'VM', v_quota_id, v_cpu_pinning, v_is_smartcard_enabled,v_is_delete_protected,v_host_cpu_flags, v_tunnel_migration, v_vnc_keyboard_layout, v_is_run_and_pause); -- perform deletion from vm_ovf_generations to ensure that no record exists when performing insert to avoid PK violation. DELETE FROM vm_ovf_generations gen WHERE gen.vm_guid = v_vm_guid; INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) VALUES (v_vm_guid, (SELECT storage_pool_id FROM vds_groups vg WHERE vg.vds_group_id = v_vds_group_id)); @@ -545,7 +546,8 @@ v_cpu_pinning VARCHAR(4000), v_host_cpu_flags BOOLEAN, v_tunnel_migration BOOLEAN, -v_vnc_keyboard_layout VARCHAR(16)) +v_vnc_keyboard_layout VARCHAR(16), +v_is_run_and_pause BOOLEAN) RETURNS VOID --The [vm_static] table doesn't have a timestamp column. Optimistic concurrency logic cannot be generated @@ -569,7 +571,7 @@ predefined_properties = v_predefined_properties,userdefined_properties = v_userdefined_properties, min_allocated_mem = v_min_allocated_mem, quota_id = v_quota_id, cpu_pinning = v_cpu_pinning, is_smartcard_enabled = v_is_smartcard_enabled, is_delete_protected = v_is_delete_protected, host_cpu_flags = v_host_cpu_flags, tunnel_migration = v_tunnel_migration, - vnc_keyboard_layout = v_vnc_keyboard_layout + vnc_keyboard_layout = v_vnc_keyboard_layout, is_run_and_pause = v_is_run_and_pause WHERE vm_guid = v_vm_guid AND entity_type = 'VM'; END; $procedure$ @@ -911,12 +913,13 @@ v_min_allocated_mem INTEGER, v_cpu_pinning varchar(4000), v_host_cpu_flags BOOLEAN, - v_tunnel_migration BOOLEAN) + v_tunnel_migration BOOLEAN, + v_is_run_and_pause BOOLEAN) RETURNS VOID AS $procedure$ BEGIN -INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, vm_guid, VM_NAME, vmt_guid, num_of_monitors, allow_console_reconnect, is_initialized, is_auto_suspend, num_of_sockets, cpu_per_socket, usb_policy, time_zone,auto_startup,is_stateless,dedicated_vm_for_vds,fail_back,vm_type,nice_level,default_boot_sequence,default_display_type,priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem,cpu_pinning,is_smartcard_enabled,is_delete_protected,host_cpu_flags, tunnel_migration) - VALUES(v_description, v_mem_size_mb, v_os, v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_num_of_monitors, v_num_of_monitors, v_is_initialized, v_is_auto_suspend, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone,v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back,v_vm_type,v_nice_level,v_default_boot_sequence,v_default_display_type,v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem,v_cpu_pinning,v_is_smartcard_enabled,v_is_delete_protected,v_host_cpu_flags, v_tunnel_migration); +INSERT INTO vm_static(description, mem_size_mb, os, vds_group_id, vm_guid, VM_NAME, vmt_guid, num_of_monitors, allow_console_reconnect, is_initialized, is_auto_suspend, num_of_sockets, cpu_per_socket, usb_policy, time_zone,auto_startup,is_stateless,dedicated_vm_for_vds,fail_back,vm_type,nice_level,default_boot_sequence,default_display_type,priority,iso_path,origin,initrd_url,kernel_url,kernel_params,migration_support,predefined_properties,userdefined_properties,min_allocated_mem,cpu_pinning,is_smartcard_enabled,is_delete_protected,host_cpu_flags, tunnel_migration, is_run_and_pause) + VALUES(v_description, v_mem_size_mb, v_os, v_vds_group_id, v_vm_guid, v_vm_name, v_vmt_guid, v_num_of_monitors, v_num_of_monitors, v_is_initialized, v_is_auto_suspend, v_num_of_sockets, v_cpu_per_socket, v_usb_policy, v_time_zone,v_auto_startup,v_is_stateless,v_dedicated_vm_for_vds,v_fail_back,v_vm_type,v_nice_level,v_default_boot_sequence,v_default_display_type,v_priority,v_iso_path,v_origin,v_initrd_url,v_kernel_url,v_kernel_params,v_migration_support,v_predefined_properties,v_userdefined_properties,v_min_allocated_mem,v_cpu_pinning,v_is_smartcard_enabled,v_is_delete_protected,v_host_cpu_flags, v_tunnel_migration, v_is_run_and_pause); INSERT INTO vm_dynamic(vm_guid, status) VALUES(v_vm_guid, 0); 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 3a576d4..c30027f 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,7 +516,7 @@ getVm().setCdPath(_cdImagePath); getVm().setFloppyPath(_floppyImagePath); getVm().setKvmEnable(getParameters().getKvmEnable()); - getVm().setRunAndPause(getParameters().getRunAndPause()); + getVm().setRunAndPause(getParameters().getRunAndPause() == null ? getVm().isRunAndPause() : getParameters().getRunAndPause()); getVm().setAcpiEnable(getParameters().getAcpiEnable()); // Clear the first user: diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java index 1a6d2ce..cdda4f4 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java @@ -11,7 +11,7 @@ private BootSequence _bootSequence; private String _diskPath; private boolean _kvmEnable; - private boolean _runAndPause; + private Boolean _runAndPause; private Boolean _useVnc; private boolean _acpiEnable; private Boolean _win2kHackEnable; @@ -33,7 +33,7 @@ } public RunVmParams(BootSequence bootSequence, Guid vmId, String diskPath, boolean kvmEnable, - boolean runAndPause, Boolean useVnc, boolean acpiEnable, boolean win2kHackEnable, + Boolean runAndPause, Boolean useVnc, boolean acpiEnable, boolean win2kHackEnable, String clientIp, boolean runAsStateless) { super(vmId); _internal = false; @@ -114,11 +114,11 @@ _kvmEnable = value; } - public boolean getRunAndPause() { + public Boolean getRunAndPause() { return _runAndPause; } - public void setRunAndPause(boolean value) { + public void setRunAndPause(Boolean value) { _runAndPause = value; } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java index 0d84a40..3fd281e 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java @@ -69,7 +69,6 @@ this.setDiskMap(new HashMap<Guid, Disk>()); this.setCdPath(""); this.setFloppyPath(""); - this.setRunAndPause(false); this.setDiskSize(0); } @@ -956,7 +955,6 @@ // ignores the final fields private String cdPath = ""; private String floppyPath = ""; - private boolean runAndPause = false; /** * Vitaly change. guest last logout time treatment. If vm stoped without logging out - set last logout time now @@ -1114,12 +1112,12 @@ floppyPath = value; } - public boolean isRunAndPause() { - return runAndPause; + public Boolean isRunAndPause() { + return vmStatic.isRunAndPause(); } - public void setRunAndPause(boolean value) { - runAndPause = value; + public void setRunAndPause(Boolean value) { + vmStatic.setRunAndPause(value); } public boolean isWin2kHackEnable() { diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmStatic.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmStatic.java index a1cff4c..29dff48 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmStatic.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmStatic.java @@ -44,6 +44,9 @@ @EditableField private boolean useHostCpuFlags = false; + @EditableField + private boolean runAndPause = false; + public VmStatic() { setNumOfMonitors(1); initialized = false; @@ -94,6 +97,7 @@ setDefaultDisplayType(vmStatic.getDefaultDisplayType()); setDedicatedVmForVds(vmStatic.getDedicatedVmForVds()); setMigrationSupport(vmStatic.getMigrationSupport()); + setRunAndPause(vmStatic.isRunAndPause()); } public String getCustomProperties() { @@ -222,5 +226,12 @@ return getMemSizeMb(); } + public boolean isRunAndPause() { + return runAndPause; + } + + public void setRunAndPause(boolean runAndPause) { + this.runAndPause = runAndPause; + } } diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java index 525156f..9696372 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java @@ -239,7 +239,8 @@ .addValue("host_cpu_flags", vm.isUseHostCpuFlags()) .addValue("guest_agent_nics_hash", vm.getGuestAgentNicsHash()) .addValue("tunnel_migration", vm.getTunnelMigration()) - .addValue("vnc_keyboard_layout", vm.getVncKeyboardLayout())); + .addValue("vnc_keyboard_layout", vm.getVncKeyboardLayout()) + .addValue("is_run_and_pause", vm.isRunAndPause())); } @Override @@ -394,6 +395,7 @@ entity.setGuestAgentNicsHash(rs.getInt("guest_agent_nics_hash")); entity.setTunnelMigration((Boolean) rs.getObject("tunnel_migration")); entity.setVncKeyboardLayout(rs.getString("vnc_keyboard_layout")); + entity.setRunAndPause(rs.getBoolean("is_run_and_pause")); return entity; } } diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java index a109906..ca0d3a1 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java @@ -85,7 +85,8 @@ .addValue("cpu_pinning", vm.getCpuPinning()) .addValue("host_cpu_flags", vm.isUseHostCpuFlags()) .addValue("tunnel_migration", vm.getTunnelMigration()) - .addValue("vnc_keyboard_layout", vm.getVncKeyboardLayout()); + .addValue("vnc_keyboard_layout", vm.getVncKeyboardLayout()) + .addValue("is_run_and_pause", vm.isRunAndPause()); } @Override @@ -203,6 +204,7 @@ entity.setUseHostCpuFlags(rs.getBoolean("host_cpu_flags")); entity.setTunnelMigration((Boolean) rs.getObject("tunnel_migration")); entity.setVncKeyboardLayout(rs.getString("vnc_keyboard_layout")); + entity.setRunAndPause(rs.getBoolean("is_run_and_pause")); return entity; } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java index eda2939..4a066b0 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java @@ -340,6 +340,9 @@ @DefaultStringValue("Stateless") String statelessVmPopup(); + @DefaultStringValue("Start in Pause Mode") + String runAndPauseVmPopup(); + @DefaultStringValue("Delete protection") String deleteProtectionPopup(); diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java index a0df5b7..5f323c4 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java @@ -277,6 +277,11 @@ public EntityModelCheckBoxEditor isStatelessEditor; @UiField(provided = true) + @Path(value = "isRunAndPause.entity") + @WithElementId("isRunAndPause") + public EntityModelCheckBoxEditor isRunAndPauseEditor; + + @UiField(provided = true) @Path(value = "isSmartcardEnabled.entity") @WithElementId("isSmartcardEnabled") public EntityModelCheckBoxEditor isSmartcardEnabledEditor; @@ -477,6 +482,7 @@ hostCpuEditor = new EntityModelCheckBoxEditor(Align.RIGHT); isHighlyAvailableEditor = new EntityModelCheckBoxEditor(Align.RIGHT); isStatelessEditor = new EntityModelCheckBoxEditor(Align.RIGHT); + isRunAndPauseEditor = new EntityModelCheckBoxEditor(Align.RIGHT); isDeleteProtectedEditor = new EntityModelCheckBoxEditor(Align.RIGHT); isSmartcardEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT); cdAttachedEditor = new EntityModelCheckBoxEditor(Align.LEFT); @@ -695,6 +701,7 @@ oSTypeEditor.setLabel(constants.osVmPopup()); isStatelessEditor.setLabel(constants.statelessVmPopup()); + isRunAndPauseEditor.setLabel(constants.runAndPauseVmPopup()); isDeleteProtectedEditor.setLabel(constants.deleteProtectionPopup()); isSmartcardEnabledEditor.setLabel(constants.smartcardVmPopup()); @@ -1067,6 +1074,7 @@ oSTypeEditor.setTabIndex(nextTabIndex++); isStatelessEditor.setTabIndex(nextTabIndex++); + isRunAndPauseEditor.setTabIndex(nextTabIndex++); isDeleteProtectedEditor.setTabIndex(nextTabIndex++); // == Pools == diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml index 1288d98..3393ad8 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml @@ -271,6 +271,7 @@ <g:FlowPanel addStyleNames="{style.sectionPanel}"> <e:ListModelListBoxEditor ui:field="oSTypeEditor" /> <e:EntityModelCheckBoxEditor ui:field="isStatelessEditor" addStyleNames="{style.checkbox}" /> + <e:EntityModelCheckBoxEditor ui:field="isRunAndPauseEditor" addStyleNames="{style.checkbox}" /> <e:EntityModelCheckBoxEditor ui:field="isDeleteProtectedEditor" addStyleNames="{style.checkbox}" /> </g:FlowPanel> <g:FlowPanel addStyleNames="{style.sectionPanel}"> diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java index 721d66e..25eb259 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java @@ -136,6 +136,7 @@ vm.setAutoSuspend(instance.isAutoSuspend()); vm.setInitialized(instance.isInitialized()); vm.setStateless(instance.isStateless()); + vm.setRunAndPause(instance.isRunAndPause()); vm.setIsoPath(instance.getIsoPath()); vm.setKernelParams(instance.getKernelParams()); vm.setKernelUrl(instance.getKernelUrl()); @@ -408,6 +409,7 @@ obj.setAutoSuspend(instance.isAutoSuspend()); obj.setInitialized(instance.isInitialized()); obj.setStateless(instance.isStateless()); + obj.setRunAndPause(instance.isRunAndPause()); obj.setMemSizeMb(instance.getMemSizeMb()); obj.setDiskSize(instance.getDiskSize()); obj.setNiceLevel(instance.getNiceLevel()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java index f50fe30..12b1b45 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java @@ -130,6 +130,9 @@ getModel().getIsStateless().setEntity(vm.isStateless()); getModel().getIsStateless().setIsAvailable(vm.getVmPoolId() == null); + getModel().getIsRunAndPause().setEntity(vm.isRunAndPause()); + getModel().getIsRunAndPause().setIsAvailable(!vm.isRunning()); + getModel().getIsSmartcardEnabled().setEntity(vm.isSmartcardEnabled()); getModel().getIsDeleteProtected().setEntity(vm.isDeleteProtected()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java index 5b76962..1d2c17d 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java @@ -105,6 +105,7 @@ getOSType().setIsChangable(false); getIsStateless().setIsChangable(false); + getIsRunAndPause().setIsChangable(false); getIsDeleteProtected().setIsChangable(false); // ==Initial run Tab== @@ -616,6 +617,18 @@ privateIsStateless = value; } + private NotChangableForVmInPoolEntityModel privateIsRunAndPause; + + public EntityModel getIsRunAndPause() + { + return privateIsRunAndPause; + } + + private void setIsRunAndPause(NotChangableForVmInPoolEntityModel value) + { + privateIsRunAndPause = value; + } + private NotChangableForVmInPoolEntityModel privateIsDeleteProtected; public EntityModel getIsDeleteProtected() { @@ -1052,6 +1065,7 @@ setMinAllocatedMemory(new NotChangableForVmInPoolEntityModel()); setUsbPolicy(new NotChangableForVmInPoolListModel()); setIsStateless(new NotChangableForVmInPoolEntityModel()); + setIsRunAndPause(new NotChangableForVmInPoolEntityModel()); setIsSmartcardEnabled(new NotChangableForVmInPoolEntityModel()); setIsDeleteProtected(new NotChangableForVmInPoolEntityModel()); @@ -1192,6 +1206,7 @@ getMemSize().setEntity(256); getMinAllocatedMemory().setEntity(256); getIsStateless().setEntity(false); + getIsRunAndPause().setEntity(false); getIsSmartcardEnabled().setEntity(false); getIsHighlyAvailable().setEntity(false); getIsAutoAssign().setEntity(true); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java index 257b9a4..2b82202 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java @@ -1362,7 +1362,7 @@ model.getAttachIso().setEntity(false); model.getAttachFloppy().setEntity(false); model.getRunAsStateless().setEntity(vm.isStateless()); - model.getRunAndPause().setEntity(false); + model.getRunAndPause().setEntity(vm.isRunAndPause()); model.setHwAcceleration(true); // passing Kernel parameters @@ -1821,6 +1821,7 @@ / (Integer) model.getNumOfSockets().getSelectedItem()); tempVar.setAutoSuspend(false); tempVar.setStateless((Boolean) model.getIsStateless().getEntity()); + tempVar.setRunAndPause(((Boolean) model.getIsRunAndPause().getEntity())); tempVar.setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); tempVar.setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); tempVar.setDefaultBootSequence(model.getBootSequence()); @@ -2393,6 +2394,7 @@ getcurrentVm().setUsbPolicy((UsbPolicy) model.getUsbPolicy().getSelectedItem()); getcurrentVm().setAutoSuspend(false); getcurrentVm().setStateless((Boolean) model.getIsStateless().getEntity()); + getcurrentVm().setRunAndPause((Boolean) model.getIsRunAndPause().getEntity()); getcurrentVm().setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); getcurrentVm().setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); getcurrentVm().setDefaultBootSequence(model.getBootSequence()); -- To view, visit http://gerrit.ovirt.org/13564 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1fe46a9946f7914095310ddac9ab1a9e5a6564b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Libor Spevak <lspe...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches