Remove some obsolete FIST points (resubmit)

Resubmit of 91e03ab1a0718c6caf5a18bfc25c99d374dcc337, which
was reverted.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CA-101785: Check for "disable_pv_vnc" in other_config before setting
vncterm

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
CP-4500: Added handler skeleton for /export_raw_vdi

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-4500: Move helper functions to shared import/export code

Moved some functions in import_raw_vdi.ml into shared module importexport.ml
ready for implementing export_raw_vdi:

    * return_302_redirect
    * vdi_of_req

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-4500: Implemented export_raw_vdi.

This can be called via HTTP at <host>/export_raw_vdi?vdi=<vdi-uuid> using, for
example, curl and is the counterpart to import_raw_vdi.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-4350: Add unit test for apply_edition_with_rollback

Signed-off-by: John Else <john.else@citrix.com>
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>
XOP-311, SCTX-942, CA-88975: Modifications for VM Shutdown
	First attempt to perform a clean_shutdown
	If clean_shutdown fails, then perform a hard_shutdown

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@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>
Adding warn level logging when unable to perform clean_shutdown

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
CA-100489: xenopsd: ignore errors in PCI.unplug when VM does not exist

This makes it consistent with VIF.unplug and VBD.unplug, and prevents xenopsd
from spinning in VM.shutdown with PCI devices present.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
rrdd: improve logging of metrics-parsing errors

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
CA-104483: rrdd: ensure plugins' checksums change

Previously, rrdd only checked whether the plugin's checksum is different from the first one it saw for that plugin. This had the effect that, if the checksum changed at least once since rrdd was started, the data was always deemed to be fresh. The logic was flawed: Hashtbl.replace was only called when the entry wasn't previously in the hashtable.

Instead, this patch checks the current checksum against the most recently seen one. The effect of this is that data is only deemed fresh if it has been updated recently.

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Merge pull request #1167 from robhoes/ca100489

CA-100489: xenopsd: ignore errors in PCI.unplug when VM does not exist