[Libvirt-cim] [PATCH 1 of 3] (#2) Add count field to dominfo. Add keymap support for graphics devices

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Fri Nov 21 18:54:33 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1225319502 25200
# Node ID b070e80c1c0fb2621b5d601c2aa5d57b6501e8b9
# Parent  0741392902634278daf88655883ce5f97f79ffea
(#2) Add count field to dominfo.  Add keymap support for graphics devices.

Not really needed, but allows VSMS to treat this device in the same manner the
other devices are treated.

Updates from 1 to 2:
  -Add KeyMapping attribute to GraphicsRASD - use this instead of
   ResourceSubType to store mapping.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 074139290263 -r b070e80c1c0f libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c	Wed Nov 19 13:49:35 2008 -0800
+++ b/libxkutil/device_parsing.c	Wed Oct 29 15:31:42 2008 -0700
@@ -926,8 +926,9 @@
                 goto err;
 
         parse_devices(xml, &(*dominfo)->dev_emu, CIM_RES_TYPE_EMU);
-        parse_devices(xml, &(*dominfo)->dev_graphics, CIM_RES_TYPE_GRAPHICS);
-
+        (*dominfo)->dev_graphics_ct = parse_devices(xml, 
+                                                    &(*dominfo)->dev_graphics, 
+                                                    CIM_RES_TYPE_GRAPHICS);
         (*dominfo)->dev_input_ct = parse_devices(xml, 
                                                  &(*dominfo)->dev_input, 
                                                  CIM_RES_TYPE_INPUT);
@@ -1000,6 +1001,7 @@
         cleanup_virt_devices(&dom->dev_net, dom->dev_net_ct);
         cleanup_virt_devices(&dom->dev_disk, dom->dev_disk_ct);
         cleanup_virt_devices(&dom->dev_vcpu, dom->dev_vcpu_ct);
+        cleanup_virt_devices(&dom->dev_graphics, dom->dev_graphics_ct);
         cleanup_virt_devices(&dom->dev_input, dom->dev_input_ct);
 
         free(dom);
diff -r 074139290263 -r b070e80c1c0f libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h	Wed Nov 19 13:49:35 2008 -0800
+++ b/libxkutil/device_parsing.h	Wed Oct 29 15:31:42 2008 -0700
@@ -125,6 +125,8 @@
         int on_crash;
 
         struct virt_device *dev_graphics;
+        int dev_graphics_ct;
+
         struct virt_device *dev_emu;
 
         struct virt_device *dev_input;
diff -r 074139290263 -r b070e80c1c0f libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c	Wed Nov 19 13:49:35 2008 -0800
+++ b/libxkutil/xmlgen.c	Wed Oct 29 15:31:42 2008 -0700
@@ -703,7 +703,7 @@
         if (dominfo->dev_graphics)
                 concat_devxml(&devxml,
                               dominfo->dev_graphics,
-                              1,
+                              dominfo->dev_graphics_ct,
                               graphics_to_xml);
 
         console_xml(dominfo, &devxml);
diff -r 074139290263 -r b070e80c1c0f schema/ResourceAllocationSettingData.mof
--- a/schema/ResourceAllocationSettingData.mof	Wed Nov 19 13:49:35 2008 -0800
+++ b/schema/ResourceAllocationSettingData.mof	Wed Oct 29 15:31:42 2008 -0700
@@ -117,6 +117,8 @@
 ]
 class Xen_GraphicsResourceAllocationSettingData : Xen_ResourceAllocationSettingData
 {
+      [Description ("Keyboard keymapping")]
+      string KeyMapping;
 };
 
 [Description ("KVM virtual graphics device"),
@@ -124,6 +126,8 @@
 ]
 class KVM_GraphicsResourceAllocationSettingData : KVM_ResourceAllocationSettingData
 {
+      [Description ("Keyboard keymapping")]
+      string KeyMapping;
 };
 
 [Description ("LXC virtual graphics device"),
@@ -131,6 +135,8 @@
 ]
 class LXC_GraphicsResourceAllocationSettingData : LXC_ResourceAllocationSettingData
 {
+      [Description ("Keyboard keymapping")]
+      string KeyMapping;
 };
 
 [Description ("Xen virtual input device"),
diff -r 074139290263 -r b070e80c1c0f src/Virt_RASD.c
--- a/src/Virt_RASD.c	Wed Nov 19 13:49:35 2008 -0800
+++ b/src/Virt_RASD.c	Wed Oct 29 15:31:42 2008 -0700
@@ -279,6 +279,8 @@
         }
 
         CMSetProperty(inst, "Address", (CMPIValue *)addr_str, CMPI_chars);
+        CMSetProperty(inst, "KeyMapping", 
+                      (CMPIValue *)dev->dev.graphics.keymap, CMPI_chars);
 
  out:
         free(addr_str);
diff -r 074139290263 -r b070e80c1c0f src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c	Wed Nov 19 13:49:35 2008 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c	Wed Oct 29 15:31:42 2008 -0700
@@ -748,6 +748,8 @@
         addr = "127.0.0.1:-1";
         CMSetProperty(inst, "Address", (CMPIValue *)addr, CMPI_chars);
 
+        CMSetProperty(inst, "KeyMapping", (CMPIValue *)"en-us", CMPI_chars);
+
         inst_list_add(list, inst);
 
  out:




More information about the Libvirt-cim mailing list