Tomas Jelinek has uploaded a new change for review. Change subject: [RFE] Integrate smartcard support ......................................................................
[RFE] Integrate smartcard support This patch integrates the smartcard support into the frontend and engine. The behavior on frontend: - the new/edit VM, pool, template dialogs contains in console side tab a new checkbox with label "Smartcard enabled" - this checkbox is enabled only for the Spice client, it is visible but disabled for VNC. - if the smartcard is enabled and gui is going to connect to the guest using spice, it sets the "Smartcard" option on the XPI client to true, else sets it to false (ignores this for the activex client because the activex client does not support the smartcard yet) The behavior on the backend: - if the smartcard is enabled or not is persisted in the vm_static table under the boolean field "is_smartcard_enabled" - VmInfoBuilderBase adds a new parameter to VDSM: smartcard_enabled ("true" if yes, "false" if no) Change-Id: Icaa874d6316c4040253231a7a301a17d8b69eb4b Signed-off-by: Tomas Jelinek <tjeli...@redhat.com> --- M backend/manager/dbscripts/create_views.sql A backend/manager/dbscripts/upgrade/03_01_1440_add_smartcard.sql M backend/manager/dbscripts/vm_templates_sp.sql M backend/manager/dbscripts/vms_sp.sql M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmTemplateHandler.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/VmBase.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmStatic.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/AbstractVmRowMapper.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 backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.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/uicommon/SpiceInterfaceImpl.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/models/pools/PoolListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.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/ISpice.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.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 M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java 34 files changed, 120 insertions(+), 22 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/84/8484/1 diff --git a/backend/manager/dbscripts/create_views.sql b/backend/manager/dbscripts/create_views.sql index 8fd50b5..2ac2f08 100644 --- a/backend/manager/dbscripts/create_views.sql +++ b/backend/manager/dbscripts/create_views.sql @@ -360,6 +360,7 @@ vm_templates.priority as priority, vm_templates.auto_startup as auto_startup, vm_templates.is_stateless as is_stateless, + vm_templates.is_smartcard_enabled as is_smartcard_enabled, vm_templates.iso_path as iso_path, vm_templates.origin as origin, vm_templates.initrd_url as initrd_url, @@ -518,7 +519,7 @@ AS SELECT vm_static.vm_name as vm_name, vm_static.mem_size_mb as vm_mem_size_mb, vm_static.nice_level as nice_level, vm_static.vmt_guid as vmt_guid, vm_static.os as vm_os, vm_static.description as vm_description, vm_static.vds_group_id as vds_group_id, - vm_static.domain as vm_domain, vm_static.creation_date as vm_creation_date, vm_static.auto_startup as auto_startup, vm_static.is_stateless as is_stateless, vm_static.dedicated_vm_for_vds as dedicated_vm_for_vds, + vm_static.domain as vm_domain, vm_static.creation_date as vm_creation_date, vm_static.auto_startup as auto_startup, vm_static.is_stateless as is_stateless, vm_static.is_smartcard_enabled as is_smartcard_enabled, vm_static.dedicated_vm_for_vds as dedicated_vm_for_vds, vm_static.fail_back as fail_back, vm_static.default_boot_sequence as default_boot_sequence, vm_static.vm_type as vm_type, vm_static.hypervisor_type as hypervisor_type, vm_static.operation_mode as operation_mode, vds_groups.name as vds_group_name, vds_groups.selection_algorithm as selection_algorithm, vds_groups.transparent_hugepages as transparent_hugepages, storage_pool.id as storage_pool_id, storage_pool.name as storage_pool_name, @@ -559,7 +560,7 @@ CREATE OR REPLACE VIEW vms_with_tags AS SELECT vms.vm_name, vms.vm_mem_size_mb, vms.nice_level, vms.vmt_guid, vms.vm_os, vms.vm_description, - vms.vds_group_id, vms.vm_domain, vms.vm_creation_date, vms.auto_startup, vms.is_stateless, + vms.vds_group_id, vms.vm_domain, vms.vm_creation_date, vms.auto_startup, vms.is_stateless, vms.is_smartcard_enabled, vms.dedicated_vm_for_vds, vms.fail_back, vms.default_boot_sequence, vms.vm_type, vms.hypervisor_type, vms.operation_mode, vms.vds_group_name, vms.selection_algorithm, vms.storage_pool_id, vms.storage_pool_name, vms.vds_group_description, vms.vmt_name, vms.vmt_mem_size_mb, vms.vmt_os, vms.vmt_creation_date, diff --git a/backend/manager/dbscripts/upgrade/03_01_1440_add_smartcard.sql b/backend/manager/dbscripts/upgrade/03_01_1440_add_smartcard.sql new file mode 100644 index 0000000..3d0ed0d --- /dev/null +++ b/backend/manager/dbscripts/upgrade/03_01_1440_add_smartcard.sql @@ -0,0 +1 @@ +select fn_db_add_column('vm_static', 'is_smartcard_enabled', 'BOOLEAN default false'); diff --git a/backend/manager/dbscripts/vm_templates_sp.sql b/backend/manager/dbscripts/vm_templates_sp.sql index ae6fcba..b6bd368 100644 --- a/backend/manager/dbscripts/vm_templates_sp.sql +++ b/backend/manager/dbscripts/vm_templates_sp.sql @@ -34,6 +34,7 @@ v_priority INTEGER, v_auto_startup BOOLEAN, v_is_stateless BOOLEAN, + v_is_smartcard_enabled BOOLEAN, v_iso_path VARCHAR(4000) , v_origin INTEGER , v_initrd_url VARCHAR(4000) , @@ -84,7 +85,8 @@ entity_type, quota_id, migration_support, - dedicated_vm_for_vds) + dedicated_vm_for_vds, + is_smartcard_enabled) VALUES( -- This field is meaningless for templates for the time being, however we want to keep it not null for VMs. -- Thus, since templates are top level elements they "point" to the 'Blank' template. @@ -124,7 +126,8 @@ 'TEMPLATE', v_quota_id, v_migration_support, - v_dedicated_vm_for_vds); + v_dedicated_vm_for_vds, + v_is_smartcard_enabled); END; $procedure$ LANGUAGE plpgsql; @@ -159,6 +162,7 @@ v_priority INTEGER, v_auto_startup BOOLEAN, v_is_stateless BOOLEAN, + v_is_smartcard_enabled BOOLEAN, v_iso_path VARCHAR(4000) , v_origin INTEGER , v_initrd_url VARCHAR(4000) , @@ -186,7 +190,7 @@ priority = v_priority,auto_startup = v_auto_startup,is_stateless = v_is_stateless, iso_path = v_iso_path,origin = v_origin,initrd_url = v_initrd_url, kernel_url = v_kernel_url,kernel_params = v_kernel_params, _update_date = CURRENT_TIMESTAMP, quota_id = v_quota_id, - migration_support = v_migration_support, dedicated_vm_for_vds = v_dedicated_vm_for_vds + migration_support = v_migration_support, dedicated_vm_for_vds = v_dedicated_vm_for_vds, is_smartcard_enabled = v_is_smartcard_enabled WHERE vm_guid = v_vmt_guid AND entity_type = 'TEMPLATE'; END; $procedure$ diff --git a/backend/manager/dbscripts/vms_sp.sql b/backend/manager/dbscripts/vms_sp.sql index 4b6ade9..15ed44d 100644 --- a/backend/manager/dbscripts/vms_sp.sql +++ b/backend/manager/dbscripts/vms_sp.sql @@ -288,6 +288,7 @@ v_time_zone VARCHAR(40) , v_auto_startup BOOLEAN, v_is_stateless BOOLEAN, + v_is_smartcard_enabled BOOLEAN, v_dedicated_vm_for_vds UUID , v_fail_back BOOLEAN , v_vm_type INTEGER , @@ -311,8 +312,8 @@ 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, hypervisor_type, operation_mode, 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) - 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_hypervisor_type, v_operation_mode, 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); +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, hypervisor_type, operation_mode, 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) + 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_hypervisor_type, v_operation_mode, 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); END; $procedure$ LANGUAGE plpgsql; @@ -339,6 +340,7 @@ v_time_zone VARCHAR(40) , v_auto_startup BOOLEAN, v_is_stateless BOOLEAN, + v_is_smartcard_enabled BOOLEAN, v_dedicated_vm_for_vds UUID , v_fail_back BOOLEAN , v_vm_type INTEGER , @@ -381,7 +383,7 @@ initrd_url = v_initrd_url,kernel_url = v_kernel_url, kernel_params = v_kernel_params,migration_support = v_migration_support, 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 + min_allocated_mem = v_min_allocated_mem, quota_id = v_quota_id, cpu_pinning = v_cpu_pinning, is_smartcard_enabled = v_is_smartcard_enabled WHERE vm_guid = v_vm_guid AND entity_type = 'VM'; END; $procedure$ @@ -653,6 +655,7 @@ v_time_zone VARCHAR(40) , v_auto_startup BOOLEAN, v_is_stateless BOOLEAN, + v_is_smartcard_enabled BOOLEAN, v_dedicated_vm_for_vds UUID , v_fail_back BOOLEAN , v_vm_type INTEGER , @@ -675,8 +678,8 @@ 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,hypervisor_type,operation_mode,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) - 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_hypervisor_type,v_operation_mode,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); +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,hypervisor_type,operation_mode,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) + 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_hypervisor_type,v_operation_mode,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); 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/AddVmTemplateCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java index 44f6856..9cca5e2 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java @@ -287,7 +287,7 @@ .getnice_level(), getParameters().getMasterVm().getfail_back(), getParameters().getMasterVm().getdefault_boot_sequence(), getParameters() .getMasterVm().getvm_type(), getParameters().getMasterVm().gethypervisor_type(), - getParameters().getMasterVm().getoperation_mode())); + getParameters().getMasterVm().getoperation_mode(),getParameters().getMasterVm().getis_smartcard_enabled())); getVmTemplate().setauto_startup(getParameters().getMasterVm().getauto_startup()); getVmTemplate().setpriority(getParameters().getMasterVm().getpriority()); getVmTemplate().setdefault_display_type(getParameters().getMasterVm().getdefault_display_type()); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java index 35a7bbd..a96a671 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java @@ -82,7 +82,7 @@ "dedicated_vm_for_vds", "default_display_type", "priority", "default_boot_sequence", "initrd_url", "kernel_url", "kernel_params", "migrationSupport", "minAllocatedMem", "quotaId", "quotaName", "quotaEnforcementType", "cpuPinning", - "vmPayload", "balloonEnabled", + "vmPayload", "balloonEnabled", "is_smartcard_enabled", "images", // images list is relational entity - ignore value changes "interfaces" // interfaces is relational entity - ignore value changes }); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmTemplateHandler.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmTemplateHandler.java index 3562a0a..b5e2bca 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmTemplateHandler.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmTemplateHandler.java @@ -34,7 +34,7 @@ "default_boot_sequence", "iso_path", "diskImageMap", "default_display_type", "priority", "auto_startup", "is_stateless", "initrd_url", "kernel_url", "kernel_params", "images", "interfaces", "quotaId", "quotaName", - "quotaEnforcementType", "migrationSupport", "dedicated_vm_for_vds" + "quotaEnforcementType", "migrationSupport", "dedicated_vm_for_vds", "is_smartcard_enabled" }); } 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 8282588..fdab369 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 @@ -411,6 +411,15 @@ return mVmStatic.getis_stateless(); } + public boolean getis_smartcard_enabled() { + return mVmStatic.getis_smartcard_enabled(); + } + + public void setis_smartcard_enabled(boolean isSmartcardEnabled) { + mVmStatic.setis_smartcard_enabled(isSmartcardEnabled); + OnPropertyChanged(new PropertyChangedEventArgs("is_smartcard_enabled")); + } + public void setis_stateless(boolean value) { mVmStatic.setis_stateless(value); OnPropertyChanged(new PropertyChangedEventArgs("is_stateless")); @@ -1476,7 +1485,7 @@ "num_of_sockets", "cpu_per_socket", "vds_group_compatibility_version", "usb_policy", "vmt_guid", "vmt_name", "initrd_url", "kernel_url", "kernel_params", "VmPauseStatus", "CustomProperties", "MigrationSupport", "num_of_cpus", - "MinAllocatedMem" })); + "MinAllocatedMem", "is_smartcard_enabled" })); @Override public ArrayList<String> getChangeablePropertiesList() { diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java index 8e571e1..69d5878 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java @@ -117,6 +117,9 @@ @Column(name = "is_stateless") private boolean stateless; + @Column(name = "is_smartcard_enabled") + private boolean smartcardEnabled; + @Size(max = BusinessEntitiesDefinitions.GENERAL_MAX_SIZE) @Column(name = "iso_path", length = BusinessEntitiesDefinitions.GENERAL_MAX_SIZE) private String isoPath = ""; @@ -197,7 +200,8 @@ String kernelUrl, String kernelParams, String initrdUrl, - Guid quotaId) { + Guid quotaId, + boolean smartcardEnabled) { super(); this.id = id; this.vds_group_id = vds_group_id; @@ -226,6 +230,7 @@ this.kernelUrl = kernelUrl; this.kernelParams = kernelParams; this.initrdUrl = initrdUrl; + this.smartcardEnabled = smartcardEnabled; setQuotaId(quotaId); } @@ -513,6 +518,14 @@ return exportDate; } + public boolean getis_smartcard_enabled() { + return smartcardEnabled; + } + + public void setis_smartcard_enabled(boolean smartcardEnabled) { + this.smartcardEnabled = smartcardEnabled; + } + @Override public int hashCode() { final int prime = 31; @@ -540,6 +553,7 @@ result = prime * result + ((origin == null) ? 0 : origin.hashCode()); result = prime * result + priority; result = prime * result + (stateless ? 1231 : 1237); + result = prime * result + (smartcardEnabled ? 1231 : 1237); result = prime * result + ((timezone == null) ? 0 : timezone.hashCode()); result = prime * result + ((usbPolicy == null) ? 0 : usbPolicy.hashCode()); result = prime * result + ((vds_group_id == null) ? 0 : vds_group_id.hashCode()); @@ -665,6 +679,9 @@ if (stateless != other.stateless) { return false; } + if (smartcardEnabled != other.smartcardEnabled) { + return false; + } if (timezone == null) { if (other.timezone != null) { return false; 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 fb459c3..c5fa952 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 @@ -108,7 +108,8 @@ vmStatic.getkernel_url(), vmStatic.getkernel_params(), vmStatic.getinitrd_url(), - vmStatic.getQuotaId()); + vmStatic.getQuotaId(), + vmStatic.getis_smartcard_enabled()); name = vmStatic.getvm_name(); vmt_guid = vmStatic.getvmt_guid(); setCustomProperties(vmStatic.getCustomProperties()); @@ -129,7 +130,7 @@ int numOfMonitors, UsbPolicy usb_policy, String time_zone, boolean auto_startup, boolean is_stateless, boolean fail_back, BootSequence default_boot_sequence, VmType vm_type, HypervisorType hypervisor_type, - OperationMode operation_mode, int minAllocatedMem, Guid quotaGuid) { + OperationMode operation_mode, int minAllocatedMem, Guid quotaGuid, boolean smartcardEnabled) { super(vm_guid, vds_group_id, os, @@ -157,7 +158,8 @@ null, null, null, - quotaGuid); + quotaGuid, + smartcardEnabled); this.name = vm_name; this.vmt_guid = vmt_guid; diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java index ca0ddd8..3e647ae 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmTemplate.java @@ -34,7 +34,6 @@ @Entity @Table(name = "vm_templates") @TypeDef(name = "guid", typeClass = GuidType.class) -@SuppressWarnings("unused") public class VmTemplate extends VmBase { private static final long serialVersionUID = -522552511046744989L; @@ -43,7 +42,7 @@ "default_display_type", "mem_size_mb", "vds_group_name", "status", "time_zone", "num_of_monitors", "vds_group_id", "usb_policy", "num_of_sockets", "cpu_per_socket", "os", "is_auto_suspend", "auto_startup", "priority", "default_boot_sequence", "is_stateless", "iso_path", "initrd_url", - "kernel_url", "kernel_params" })); + "kernel_url", "kernel_params", "is_smartcard_enabled" })); @Transient private List<VmNetworkInterface> _Interfaces = new ArrayList<VmNetworkInterface>(); @@ -97,7 +96,7 @@ int num_of_sockets, int cpu_per_socket, VmOsType os, Guid vds_group_id, Guid vmt_guid, String domain, int num_of_monitors, int status, int usb_policy, String time_zone, boolean is_auto_suspend, int nice_level, boolean fail_back, BootSequence default_boot_sequence, VmType vm_type, HypervisorType hypervisor_type, - OperationMode operation_mode) { + OperationMode operation_mode, boolean smartcardEnabled) { super(vmt_guid, vds_group_id, os, @@ -125,7 +124,8 @@ null, null, null, - null); + null, + smartcardEnabled); diskTemplateMap = new HashMap<Guid, DiskImage>(); diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/AbstractVmRowMapper.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/AbstractVmRowMapper.java index 3aa3ad1..0e9fd0b 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/AbstractVmRowMapper.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/AbstractVmRowMapper.java @@ -42,6 +42,7 @@ entity.setkernel_url(rs.getString("kernel_url")); entity.setkernel_params(rs.getString("kernel_params")); entity.setinitrd_url(rs.getString("initrd_url")); + entity.setis_smartcard_enabled(rs.getBoolean("is_smartcard_enabled")); } } 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 efdf146..44bae25 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 @@ -203,6 +203,7 @@ .addValue("time_zone", vm.gettime_zone()) .addValue("auto_startup", vm.getauto_startup()) .addValue("is_stateless", vm.getis_stateless()) + .addValue("is_smartcard_enabled", vm.getis_smartcard_enabled()) .addValue("dedicated_vm_for_vds", vm.getdedicated_vm_for_vds()) .addValue("fail_back", vm.getfail_back()) .addValue("vm_type", vm.getvm_type()) @@ -305,6 +306,7 @@ entity.setutc_diff((Integer) rs.getObject("utc_diff")); entity.setauto_startup(rs.getBoolean("auto_startup")); entity.setis_stateless(rs.getBoolean("is_stateless")); + entity.setis_smartcard_enabled(rs.getBoolean("is_smartcard_enabled")); entity.setdedicated_vm_for_vds(NGuid.createGuidFromString(rs.getString("dedicated_vm_for_vds"))); entity.setfail_back(rs.getBoolean("fail_back")); entity.setlast_vds_run_on(NGuid.createGuidFromString(rs.getString("last_vds_run_on"))); 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 554959b..409a1a8 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 @@ -59,6 +59,7 @@ .addValue("time_zone", vm.gettime_zone()) .addValue("auto_startup", vm.getauto_startup()) .addValue("is_stateless", vm.getis_stateless()) + .addValue("is_smartcard_enabled", vm.getis_smartcard_enabled()) .addValue("dedicated_vm_for_vds", vm.getdedicated_vm_for_vds()) .addValue("fail_back", vm.getfail_back()) .addValue("vm_type", vm.getvm_type()) diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java index 32a0ad0..92a69ca 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java @@ -140,6 +140,7 @@ .addValue("priority", template.getpriority()) .addValue("auto_startup", template.getauto_startup()) .addValue("is_stateless", template.getis_stateless()) + .addValue("is_smartcard_enabled", template.getis_smartcard_enabled()) .addValue("iso_path", template.getiso_path()) .addValue("origin", template.getorigin()) .addValue("initrd_url", template.getinitrd_url()) diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java index 2a62226..7aa5fb7 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java @@ -151,6 +151,7 @@ public static final String cpuPinning = "cpuPinning"; public static final String vm_name = "vmName"; public static final String vm_guid = "vmId"; + public static final String smartcard_enabled = "smartcard_enabled"; // vm configuration (i.e. VmDynamic) public static final String guest_cur_user_name = "username"; public static final String vm_ip = "guestIPs"; diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java index 0865fd8..f6ec3bb 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java @@ -40,6 +40,7 @@ createInfo.add(VdsProperties.vm_guid, vm.getId().toString()); createInfo.add(VdsProperties.vm_name, vm.getvm_name()); createInfo.add(VdsProperties.mem_size_mb, vm.getvm_mem_size_mb()); + createInfo.add(VdsProperties.smartcard_enabled, Boolean.toString(vm.getis_smartcard_enabled())); createInfo.add(VdsProperties.num_of_cpus, (new Integer(vm.getnum_of_cpus())).toString()); if (Config.<Boolean> GetValue(ConfigValues.SendSMPOnRunVm)) { 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 75625d1..8287aa2 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 @@ -329,6 +329,9 @@ @DefaultStringValue("Stateless") String statelessVmPopup(); + @DefaultStringValue("Smartcard enabled") + String smartcardVmPopup(); + @DefaultStringValue("Pool") String poolVmPopup(); diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java index 74376be..17b018d 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java @@ -60,6 +60,7 @@ private boolean wanOptionsEnabled; ClientAgentType cat = new ClientAgentType(); private String spiceBaseURL; + private boolean smartcardEnabled = false; public SpiceInterfaceImpl() { logger.fine("Instantiating GWT Spice Implementation"); //$NON-NLS-1$ @@ -401,6 +402,14 @@ this.spiceBaseURL = spiceBaseURL; } + public boolean isSmartcardEnabled() { + return smartcardEnabled; + } + + public void setSmartcardEnabled(boolean smartcardEnabled) { + this.smartcardEnabled = smartcardEnabled; + } + private int colorDepthAsInt() { if (getWANColorDepth() != null) { return getWANColorDepth().asInt(); @@ -526,6 +535,7 @@ var wanOptionsEnabled = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::getIsWanOptionsEnabled()(); var colorDepth = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::colorDepthAsInt()(); var disableEffects = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::disbaleEffectsAsString()(); + var smartcardEnabled = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::isSmartcardEnabled()(); var model = this; //alert("disableEffects ["+disableEffects+"], wanOptionsEnabled ["+wanOptionsEnabled+"], colorDepth ["+colorDepth+"], Host IP ["+hostIp+"], port ["+port+"], fullScreen ["+fullScreen+"], password ["+password+"], numberOfMonitors ["+numberOfMonitors+"], Usb Listen Port ["+usbListenPort+"], Admin Console ["+adminConsole+"], Guest HostName ["+guestHostName+"], Secure Port ["+securePort+"], Ssl Chanels ["+sslChanels+"], cipherSuite ["+cipherSuite+"], Host Subject ["+hostSubject+"], Title [" + title+"], Hot Key ["+hotKey+"], Menu ["+menu+"], GuestID [" + guestID+"], version ["+version+"]"); @@ -555,6 +565,7 @@ client.SendCtrlAltDelete = sendCtrlAltDelete; client.UsbAutoShare = usbAutoShare; client.SetUsbFilter(usbFilter); + client.Smartcard = smartcardEnabled; if (wanOptionsEnabled) { client.DisableEffects = disableEffects; client.ColorDepth = colorDepth; 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 d63eddd..5b3e45d 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 @@ -265,6 +265,11 @@ public EntityModelCheckBoxEditor isStatelessEditor; @UiField(provided = true) + @Path(value = "isSmartcardEnabled.entity") + @WithElementId("isSmartcardEnabled") + public EntityModelCheckBoxEditor isSmartcardEnabledEditor; + + @UiField(provided = true) @Path(value = "allowConsoleReconnect.entity") @WithElementId("allowConsoleReconnect") public EntityModelCheckBoxEditor allowConsoleReconnectEditor; @@ -451,6 +456,7 @@ dontMigrateVMEditor = new EntityModelCheckBoxEditor(Align.RIGHT); isHighlyAvailableEditor = new EntityModelCheckBoxEditor(Align.RIGHT); isStatelessEditor = new EntityModelCheckBoxEditor(Align.RIGHT); + isSmartcardEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT); cdAttachedEditor = new EntityModelCheckBoxEditor(Align.LEFT); allowConsoleReconnectEditor = new EntityModelCheckBoxEditor(Align.RIGHT); @@ -664,6 +670,7 @@ oSTypeEditor.setLabel(constants.osVmPopup()); isStatelessEditor.setLabel(constants.statelessVmPopup()); + isSmartcardEnabledEditor.setLabel(constants.smartcardVmPopup()); // Pools Tab poolTab.setLabel(constants.poolVmPopup()); 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 f55e2d6..6c36000 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 @@ -308,6 +308,7 @@ <e:ListModelListBoxEditor ui:field="displayProtocolEditor" /> <e:ListModelListBoxEditor ui:field="usbSupportEditor" /> <e:ListModelListBoxEditor ui:field="numOfMonitorsEditor" /> + <e:EntityModelCheckBoxEditor ui:field="isSmartcardEnabledEditor" addStyleNames="{style.checkbox}" /> <g:Label ui:field="nativeUsbWarningMessage" text="{constants.nativeUsbSupportWarning}" addStyleNames="{style.warningMessageLabel}" /> <d:AdvancedParametersExpander ui:field="expander"/> <g:FlowPanel ui:field="expanderContent" addStyleNames="{style.expanderContent}"> diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java index 8dc25f4..53c1ec8 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java @@ -644,6 +644,7 @@ desktop.setvmt_guid(((VmTemplate) model.getTemplate().getSelectedItem()).getId()); desktop.setvm_name(name); desktop.setvm_os((VmOsType) model.getOSType().getSelectedItem()); + desktop.setis_smartcard_enabled((Boolean) model.getIsSmartcardEnabled().getEntity()); desktop.setnum_of_monitors((Integer) model.getNumOfMonitors().getSelectedItem()); desktop.setvm_domain(model.getDomain().getIsAvailable() ? (String) model.getDomain() .getSelectedItem() : ""); //$NON-NLS-1$ diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java index 380b985..058f3f1 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java @@ -520,6 +520,7 @@ template.setusb_policy((UsbPolicy) model.getUsbPolicy().getSelectedItem()); template.setis_auto_suspend(false); template.setis_stateless((Boolean) model.getIsStateless().getEntity()); + template.setis_smartcard_enabled((Boolean) model.getIsSmartcardEnabled().getEntity()); template.setdefault_boot_sequence(model.getBootSequence()); template.setiso_path(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ template.setauto_startup((Boolean) model.getIsHighlyAvailable().getEntity()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java index 06fdfb5..3707824 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java @@ -651,6 +651,7 @@ tempVar.setusb_policy((UsbPolicy) model.getUsbPolicy().getSelectedItem()); tempVar.setis_auto_suspend(false); tempVar.setis_stateless((Boolean) model.getIsStateless().getEntity()); + tempVar.setis_smartcard_enabled((Boolean) model.getIsSmartcardEnabled().getEntity()); tempVar.setdefault_boot_sequence(model.getBootSequence()); tempVar.setauto_startup((Boolean) model.getIsHighlyAvailable().getEntity()); tempVar.setiso_path(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ @@ -1293,6 +1294,7 @@ gettempVm().setusb_policy((UsbPolicy) model.getUsbPolicy().getSelectedItem()); gettempVm().setis_auto_suspend(false); gettempVm().setis_stateless((Boolean) model.getIsStateless().getEntity()); + gettempVm().setis_smartcard_enabled((Boolean) model.getIsSmartcardEnabled().getEntity()); gettempVm().setdefault_boot_sequence(model.getBootSequence()); gettempVm().setiso_path(model.getCdImage().getIsChangable() ? (String) model.getCdImage() .getSelectedItem() : ""); //$NON-NLS-1$ 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 baf2c9c..26edc9c 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,8 @@ getModel().getIsStateless().setEntity(vm.getis_stateless()); getModel().getIsStateless().setIsAvailable(vm.getVmPoolId() == null); + getModel().getIsSmartcardEnabled().setEntity(vm.getis_smartcard_enabled()); + getModel().getNumOfSockets().setSelectedItem(vm.getnum_of_sockets()); getModel().getNumOfSockets().setIsChangable(!vm.isStatusUp()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java index 7f6676b..b0f31a8 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java @@ -143,4 +143,5 @@ void setIsWanOptionsEnabled(boolean enabled); + public void setSmartcardEnabled(boolean enabled); } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java index d998c83..17fe8e1 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java @@ -198,6 +198,7 @@ getModel().getTotalCPUCores().setEntity(Integer.toString(this.vm.getnum_of_cpus())); getModel().getNumOfSockets().setSelectedItem(this.vm.getnum_of_sockets()); getModel().getIsStateless().setEntity(this.vm.getis_stateless()); + getModel().getIsSmartcardEnabled().setEntity(this.vm.getis_smartcard_enabled()); if (!StringHelper.isNullOrEmpty(this.vm.gettime_zone())) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java index 0ad1d21..539981b 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java @@ -97,6 +97,8 @@ updateHostPinning(template.getMigrationSupport()); doChangeDefautlHost(template.getdedicated_vm_for_vds()); + getModel().getIsSmartcardEnabled().setEntity(template.getis_smartcard_enabled()); + if (getModel().getVmType() == VmType.Desktop) { getModel().getIsStateless().setEntity(template.getis_stateless()); getModel().getAllowConsoleReconnect().setEntity(template.getAllowConsoleReconnect()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java index 51336d3..294ced8 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java @@ -117,6 +117,7 @@ getModel().getUsbPolicy().setSelectedItem(vmBase.getusb_policy()); getModel().setBootSequence(vmBase.getdefault_boot_sequence()); getModel().getIsHighlyAvailable().setEntity(vmBase.getauto_startup()); + getModel().getIsSmartcardEnabled().setEntity(vmBase.getis_smartcard_enabled()); boolean hasCd = !StringHelper.isNullOrEmpty(vmBase.getiso_path()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java index aba8aa9..5286363 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java @@ -362,6 +362,7 @@ } getspice().setHost(getEntity().getdisplay_ip()); + getspice().setSmartcardEnabled(getEntity().getis_smartcard_enabled()); getspice().setPort((getEntity().getdisplay() == null ? 0 : getEntity().getdisplay())); getspice().setPassword(ticket); getspice().setNumberOfMonitors(getEntity().getnum_of_monitors()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java index a266671..80bd653 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java @@ -147,6 +147,7 @@ getModel().getTotalCPUCores().setEntity(Integer.toString(this.template.getnum_of_cpus())); getModel().getNumOfSockets().setSelectedItem(this.template.getnum_of_sockets()); getModel().getIsStateless().setEntity(this.template.getis_stateless()); + getModel().getIsSmartcardEnabled().setEntity(this.template.getis_smartcard_enabled()); getModel().getKernel_parameters().setEntity(this.template.getkernel_params()); getModel().getKernel_path().setEntity(this.template.getkernel_url()); 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 5f89314..b694ae0 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 @@ -511,6 +511,18 @@ privateDefaultHost = value; } + private EntityModel privateisSmartcardEnabled; + + public EntityModel getIsSmartcardEnabled() + { + return privateisSmartcardEnabled; + } + + private void setIsSmartcardEnabled(EntityModel value) + { + privateisSmartcardEnabled = value; + } + private EntityModel privateIsStateless; public EntityModel getIsStateless() @@ -956,6 +968,7 @@ setMinAllocatedMemory(new EntityModel()); setUsbPolicy(new ListModel()); setIsStateless(new EntityModel()); + setIsSmartcardEnabled(new EntityModel()); setCdImage(new ListModel()); getCdImage().setIsChangable(false); @@ -1091,6 +1104,7 @@ getMemSize().setEntity(256); getMinAllocatedMemory().setEntity(256); getIsStateless().setEntity(false); + getIsSmartcardEnabled().setEntity(false); getIsHighlyAvailable().setEntity(false); getDontMigrateVM().setEntity(false); getIsAutoAssign().setEntity(true); @@ -1519,9 +1533,11 @@ if (type == DisplayType.vnc) { getUsbPolicy().setSelectedItem(org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED); + getIsSmartcardEnabled().setEntity(false); } getUsbPolicy().setIsChangable(type == DisplayType.qxl); + getIsSmartcardEnabled().setIsChangable(type == DisplayType.qxl); UpdateNumOfMonitors(); } 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 1342754..0df2747 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 @@ -1634,6 +1634,7 @@ / (Integer) model.getNumOfSockets().getSelectedItem()); tempVar.setis_auto_suspend(false); tempVar.setis_stateless((Boolean) model.getIsStateless().getEntity()); + tempVar.setis_smartcard_enabled((Boolean) model.getIsSmartcardEnabled().getEntity()); tempVar.setdefault_boot_sequence(model.getBootSequence()); tempVar.setauto_startup((Boolean) model.getIsHighlyAvailable().getEntity()); tempVar.setiso_path(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ @@ -2194,6 +2195,7 @@ getcurrentVm().setusb_policy((UsbPolicy) model.getUsbPolicy().getSelectedItem()); getcurrentVm().setis_auto_suspend(false); getcurrentVm().setis_stateless((Boolean) model.getIsStateless().getEntity()); + getcurrentVm().setis_smartcard_enabled((Boolean) model.getIsSmartcardEnabled().getEntity()); getcurrentVm().setdefault_boot_sequence(model.getBootSequence()); getcurrentVm().setiso_path(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java index 813e414..1465f22 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java @@ -648,6 +648,7 @@ getcurrentVm().setusb_policy((UsbPolicy) model.getUsbPolicy().getSelectedItem()); getcurrentVm().setis_auto_suspend(false); getcurrentVm().setis_stateless((Boolean) model.getIsStateless().getEntity()); + getcurrentVm().setis_smartcard_enabled((Boolean) model.getIsSmartcardEnabled().getEntity()); getcurrentVm().setdefault_boot_sequence(model.getBootSequence()); getcurrentVm().setiso_path(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ -- To view, visit http://gerrit.ovirt.org/8484 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icaa874d6316c4040253231a7a301a17d8b69eb4b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tomas Jelinek <tjeli...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches