[Libvirt-cim] [PATCH 2 of 5] (#2) Add input device support to device_parsing and Virt_Device

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Nov 11 23:22:25 UTC 2008


> KR> +
> KR> +        vdev->id = strdup(id);
> KR> +        free(id);
> 
> Just asprintf() into vdev->id instead of using the intermediate
> variable and two allocations.

Good call.

> 
> KR> +static int input_set_attr(CMPIInstance *instance,
> KR> +                          struct input_device *dev)
> KR> +{
> KR> +        uint16_t cim_type;
> KR> +
> KR> +        if (STREQC(dev->type, "mouse"))
> KR> +                cim_type = CIM_INPUT_MOUSE;
> KR> +        else
> KR> +                cim_type = CIM_INPUT_UNKNOWN;
> 
> Does CIM not have a tablet device?  If not, I think we can expose the
> tablet devices as mice as well.  IIRC, virt-manager gives most domains
> a PS2 and USB tablet pointer device.  The PS2 device is for
> compatibility and boot, and the tablet provides an absolute-movement
> pointer for more seamless host-to-guest cursor movement.  I think it's
> worth exposing both.  What do you think?
> 

I don't see anything more specific than "PointingDevice."  I think this 
is supposed to cover all mice, etc.

These patches do return instances for tablet devices, but the type isn't 
set to mouse. I went back and added tablet support after first getting 
the mouse support to work, and I never changed this to also set tablet 
devices properly.

The devices are returned as:

localhost:5988/root/virt:KVM_PointingDevice.CreationClassName="KVM_PointingDevice",DeviceID="demo2/mouse:usb",SystemCreationClassName="KVM_ComputerSystem",SystemName="demo2"
localhost:5988/root/virt:KVM_PointingDevice.CreationClassName="KVM_PointingDevice",DeviceID="demo2/tablet:usb",SystemCreationClassName="KVM_ComputerSystem",SystemName="demo2"
localhost:5988/root/virt:KVM_PointingDevice.CreationClassName="KVM_PointingDevice",DeviceID="demo2/mouse:ps2",SystemCreationClassName="KVM_ComputerSystem",SystemName="demo2"

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list