Simplify an if statement

Signed-off-by: John Else <john.else@citrix.com>
CA-140331: Relax merging of pci databases

Allow subdevices to be merged into the primary database even if the
device names do not match.

Signed-off-by: John Else <john.else@citrix.com>
Add another Pci_db merging test

Signed-off-by: John Else <john.else@citrix.com>
CA-140545: wrapper should exit after launching vncterm

To avoid an instance of fe hanging around for each vncterm we launch,
fork vncterm and exit rather than calling exec.

This means that the script has to write the child pid ($!) rather than
its own pid ($$) to xenstore.

This commit also removes the exec of xenstore-write in the xiu branch,
since it should return straight away.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #1828 from johnelse/ca-140331-xs64bit

CA-140331: Relax merging of pci databases
Merge pull request #1831 from johnelse/ca-140545-xs64bit

CA-140545: wrapper should exit after launching vncterm
Revert "Ca 137813: Temporarily enable core dumps for v6d"
Merge pull request #1833 from xapi-project/revert-1802-ca-137813

Revert "Ca 137813: Temporarily enable core dumps for v6d"
Revert "CA-140545: wrapper should exit after launching vncterm"
Merge pull request #1834 from xapi-project/revert-1831-ca-140545-xs64bit

Revert "CA-140545: wrapper should exit after launching vncterm"
Add 'xe vdi-export' for symmetry with 'xe vdi-import'

  xe vdi-export uuid=<VDI> filename=<filename>

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit c1f8bf5d78ecee215d1336937059e97f0f0b007c)
xe vdi-{export,import}: display a progress bar if "--progress" is given

Note we now send 'PrintStderr' commands to the CLI while it is busy
downloading or uploading disk images. A multithreaded CLI is necessary
for this to work.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 752287c3ebdc4e7a2085c14b8fa41ca237a1d66f)
{import,export}_raw_vdi use vhd-tool via vhd_tool_wrapper

This allows both functions to use O_DIRECT.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 7de0edee16116204619d6634fc22bd4d8af5b745)

Conflicts:
	ocaml/xapi/OMakefile
	ocaml/xapi/import_raw_vdi.ml
{import,export}_raw_vdi: update Task.progress

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit b89c237fb27c29b369ea37559f7a91133eef80f3)
VDI.export: allow the user to specify a format; currently either 'raw' or 'vhd'

The HTTP handler accepts an additional argument:

  GET /export_raw_vdi?vdi=<vdi>&format=<raw|vhd>...

The content-disposition HTTP header is used to suggest a useful filename, and
the content-type HTTP header is set to either application/octet-stream or
application/vhd.

The CLI accepts an optional argument:

  xe vdi-export uuid=<uuid> filename=<filename> [format=(raw|vhd)]

.vhd format export will require a newer vhd-tool (>= 0.6.5)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 59fa5ee62bbc6e05939b2b0538ff15aae4ea6d6b)
import_raw_vdi: normalise whitespace

$ camlp4o -printer o -no_comments ocaml/xapi/import_raw_vdi.ml | md5sum
e74faa7367f4c06d818a04fd87dfeeb5
$ git checkout HEAD^
$ camlp4o -printer o -no_comments ocaml/xapi/import_raw_vdi.ml | md5sum
e74faa7367f4c06d818a04fd87dfeeb5

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 6c16a13da45adae59e557a4f9e9543911b530804)

Conflicts:
	ocaml/xapi/import_raw_vdi.ml
import_raw_vdi: support importing vhd-format data

This requires vhd-tool >= 0.6.6

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 99abc50518d5bb76f6b9f93927865f7273d1acb4)

Conflicts:
	ocaml/xapi/import_raw_vdi.ml
xe vdi-import: add support for [type=(raw|vhd)]

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit be7acec752d6439acfbb8ba5ab4951a677fc7e1b)
VDI.export: add /dev/mapper to the vhd parent search path

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 7f60bff7f25325d97d23ff14b82ce8ea0e6b386b)
VDI.export: add a 'base' argument to export only VDI differences

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 62590b892b74ae0facb67123fc9e7cb8f3ca78d2)