Revision 11344a50 lib/hypervisor/hv_kvm.py

b/lib/hypervisor/hv_kvm.py
62 62
    constants.HV_BOOT_ORDER,
63 63
    constants.HV_NIC_TYPE,
64 64
    constants.HV_DISK_TYPE,
65
    constants.HV_USB_MOUSE,
65 66
    ]
66 67

  
67 68
  _MIGRATION_STATUS_RE = re.compile('Migration\s+status:\s+(\w+)',
......
285 286
      else:
286 287
        kvm_cmd.extend(['-append', root_append])
287 288

  
289
    mouse_type = instance.hvparams[constants.HV_USB_MOUSE]
290
    if mouse_type:
291
      kvm_cmd.extend(['-usb'])
292
      kvm_cmd.extend(['-usbdevice', mouse_type])
293

  
288 294
    # FIXME: handle vnc password
289 295
    vnc_bind_address = instance.hvparams[constants.HV_VNC_BIND_ADDRESS]
290 296
    if vnc_bind_address:
291
      kvm_cmd.extend(['-usbdevice', 'tablet'])
292 297
      if utils.IsValidIP(vnc_bind_address):
293 298
        if instance.network_port > constants.VNC_BASE_PORT:
294 299
          display = instance.network_port - constants.VNC_BASE_PORT
......
784 789
                                   (disk_type,
785 790
                                    constants.HT_KVM_VALID_DISK_TYPES))
786 791

  
792
    mouse_type = hvparams[constants.HV_USB_MOUSE]
793
    if mouse_type and mouse_type not in ('mouse', 'tablet'):
794
      raise errors.HypervisorError("Invalid usb mouse type %s specified for"
795
                                   " the KVM hyervisor. Please choose"
796
                                   " 'mouse' or 'tablet'" % mouse_type)
797

  
787 798
  def ValidateParameters(self, hvparams):
788 799
    """Check the given parameters for validity.
789 800

  

Also available in: Unified diff