CP-4147: Allow disabling USB emulation on QEMU

By default, the toolstack will instruct QEMU to emulate a USB hub and
a USB tablet device for HVM guests. It does that by passing the
following parameters to QEMU: "-usb -usbdevice tablet".

This patch allows the disabling of USB emulation via a configurable
key in the VM record. When set, the toolstack will not pass any USB
emulation instructions to QEMU, therefore disabling the emulation.
For example, one can set the key as follows:
xe vm-param-set uuid=<vm-uuid> platform:nousb=true

Signed-off-by: John Else <john.else@citrix.com>
CP-4145: Allow configuration of QEMU parallel port emulation

By default the toolstack does not instruct QEMU at all about parallel
port emulation. This causes QEMU to emulate a parallel port by default.
This commit allows for a "parallel" key to be specified in the platform
VM record parameter. The string used as this key will be passed to QEMU
as "-parallel <string>". For example, one can disable the parallel
port emulation completely by issuing:
xe vm-param-set uuid=<vm-uuid> platform:parallel=none

Signed-off-by: John Else <john.else@citrix.com>
Reduce duplication/hardcoding related to platform flags

Signed-off-by: John Else <john.else@citrix.com>
CP-4147: Change the USB emulation platform flag semantics

Instead of having a single flag, "nousb", which turns off all USB
emulation, we now have two flags:

  - "usb", which controls USB emulation
  - "usb_tablet", which controls USB emulation, as long as USB emulation
    is turned on

xapi defaults to both keys being true, whereas xenopsd defaults to both
keys being false.

Signed-off-by: John Else <john.else@citrix.com>
Refactor out the platformdata checks

Signed-off-by: John Else <john.else@citrix.com>
CP-4145: Only allow parallel port devices to be passed through to qemu

Signed-off-by: John Else <john.else@citrix.com>
Move a function to test_common

Signed-off-by: John Else <john.else@citrix.com>
Add unit tests for the platformdata checks

Signed-off-by: John Else <john.else@citrix.com>