Martin Beták has uploaded a new change for review.

Change subject: engine: VncKeyboardLayout [WIP] DO NOT MERGE
......................................................................

engine: VncKeyboardLayout
[WIP] DO NOT MERGE

Added vnc_keyboard_layout to vm_static table

Change-Id: Iee97a3a6595d52d0d3acc457a8c8b89b768e211b
Signed-off-by: Martin Betak <[email protected]>
---
M backend/manager/dbscripts/create_views.sql
A backend/manager/dbscripts/upgrade/03_02_0360_add_vm_vnc_keyboard_layout.sql
M backend/manager/dbscripts/vm_templates_sp.sql
M backend/manager/dbscripts/vms_sp.sql
4 files changed, 25 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/13/11313/1

diff --git a/backend/manager/dbscripts/create_views.sql 
b/backend/manager/dbscripts/create_views.sql
index ccf8405..51d4858 100644
--- a/backend/manager/dbscripts/create_views.sql
+++ b/backend/manager/dbscripts/create_views.sql
@@ -372,7 +372,8 @@
        vm_templates.db_generation as db_generation,
        vm_templates.migration_support,
        vm_templates.dedicated_vm_for_vds,
-       vm_templates.is_disabled
+       vm_templates.is_disabled,
+       vm_templates.vnc_keyboard_layout as vnc_keyboard_layout
 FROM       vm_static AS vm_templates  INNER JOIN
 vds_groups ON vm_templates.vds_group_id = vds_groups.vds_group_id
 left outer JOIN
@@ -545,7 +546,8 @@
                       vm_statistics.elapsed_time as elapsed_time, 
vm_statistics.usage_network_percent as usage_network_percent,
                       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.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.vnc_keyboard_layout as vnc_keyboard_layout
 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
@@ -581,7 +583,8 @@
             vms.vds_group_cpu_name, tags_vm_map_view.tag_name, 
tags_vm_map_view.tag_id, vms.default_display_type, vms.priority,
             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.quota_id as quota_id, vms.quota_name as quota_name,
+            vms.vnc_keyboard_layout as vnc_keyboard_layout
 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_02_0360_add_vm_vnc_keyboard_layout.sql 
b/backend/manager/dbscripts/upgrade/03_02_0360_add_vm_vnc_keyboard_layout.sql
new file mode 100644
index 0000000..7dafb32
--- /dev/null
+++ 
b/backend/manager/dbscripts/upgrade/03_02_0360_add_vm_vnc_keyboard_layout.sql
@@ -0,0 +1 @@
+select fn_db_add_column('vm_static', 'vnc_keyboard_layout', 'VARCHAR(16) 
default null');
diff --git a/backend/manager/dbscripts/vm_templates_sp.sql 
b/backend/manager/dbscripts/vm_templates_sp.sql
index df312f7..6984b7a 100644
--- a/backend/manager/dbscripts/vm_templates_sp.sql
+++ b/backend/manager/dbscripts/vm_templates_sp.sql
@@ -42,7 +42,8 @@
  v_kernel_params VARCHAR(4000) ,
  v_quota_id UUID,
  v_migration_support integer,
- v_dedicated_vm_for_vds UUID)
+ v_dedicated_vm_for_vds UUID,
+ v_vnc_keyboard_layout VARCHAR(16))
 
 RETURNS VOID
    AS $procedure$
@@ -86,7 +87,8 @@
     is_disabled,
     dedicated_vm_for_vds,
     is_smartcard_enabled,
-    is_delete_protected)
+    is_delete_protected,
+    vnc_keyboard_layout)
 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.
@@ -127,7 +129,8 @@
     v_is_disabled,
     v_dedicated_vm_for_vds,
     v_is_smartcard_enabled,
-    v_is_delete_protected);
+    v_is_delete_protected,
+    v_vnc_keyboard_layout);
 -- 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_vmt_guid;
 INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id)
@@ -176,7 +179,8 @@
  v_kernel_params VARCHAR(4000),
  v_quota_id UUID,
  v_migration_support integer,
- v_dedicated_vm_for_vds uuid)
+ v_dedicated_vm_for_vds uuid,
+ v_vnc_keyboard_layout VARCHAR(16))
 RETURNS VOID
 
        --The [vm_templates] table doesn't have a timestamp column. Optimistic 
concurrency logic cannot be generated
@@ -197,7 +201,8 @@
       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, is_smartcard_enabled = v_is_smartcard_enabled,
-      is_delete_protected = v_is_delete_protected, is_disabled = v_is_disabled
+      is_delete_protected = v_is_delete_protected, is_disabled = v_is_disabled,
+      vnc_keyboard_layout = v_vnc_keyboard_layout
       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 feb12b1..4af0623 100644
--- a/backend/manager/dbscripts/vms_sp.sql
+++ b/backend/manager/dbscripts/vms_sp.sql
@@ -428,12 +428,13 @@
     v_min_allocated_mem INTEGER,
     v_quota_id UUID,
     v_cpu_pinning VARCHAR(4000),
-    v_host_cpu_flags BOOLEAN)
+    v_host_cpu_flags BOOLEAN,
+ v_vnc_keyboard_layout VARCHAR(16))
 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)
-       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);
+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, 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_vnc_keyboard_layout);
 -- 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));
@@ -541,7 +542,8 @@
 v_min_allocated_mem INTEGER,
 v_quota_id UUID,
 v_cpu_pinning VARCHAR(4000),
-v_host_cpu_flags BOOLEAN)
+v_host_cpu_flags BOOLEAN,
+v_vnc_keyboard_layout  VARCHAR(16))
 RETURNS VOID
 
        --The [vm_static] table doesn't have a timestamp column. Optimistic 
concurrency logic cannot be generated
@@ -564,7 +566,8 @@
       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, is_smartcard_enabled = v_is_smartcard_enabled,
-      is_delete_protected = v_is_delete_protected, host_cpu_flags = 
v_host_cpu_flags
+      is_delete_protected = v_is_delete_protected, host_cpu_flags = 
v_host_cpu_flags,
+      vnc_keyboard_layout = v_vnc_keyboard_layout
       WHERE vm_guid = v_vm_guid
       AND   entity_type = 'VM';
 END; $procedure$


--
To view, visit http://gerrit.ovirt.org/11313
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee97a3a6595d52d0d3acc457a8c8b89b768e211b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Beták <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to