Re-use some code, and fix lookup of content_id in vdi_info_from_db

Signed-off-by: John Else <john.else@citrix.com>
Fix vdi_info.snapshot_of for SMAPIv1

SMAPI snapshot_of should be the parent's uuid, not its database
reference.

Signed-off-by: John Else <john.else@citrix.com>
Add snapshot setters to SMAPI

SMAPI now includes:

VDI.set_is_a_snapshot
VDI.set_snapshot_time
VDI.set_snapshot_of

For SMAPIv1, we just set the new values in xapi's database. For SMAPIv2,
these fields will be implemented by the backend.

Signed-off-by: John Else <john.else@citrix.com>
Remove some unused code

This hasn't been used since the api.hg days...

Signed-off-by: John Else <john.else@citrix.com>
Add SMAPI call SR.update_snapshot_info

Signed-off-by: John Else <john.else@citrix.com>
Move a comment to the line it refers to

Signed-off-by: John Else <john.else@citrix.com>
CA-78901: Fix snapshot info for SXM'ed snapshot disks

Once we have copied all snapshot disks to the remote SR and mirrors are
running for all live VDIs, rebuild the snapshot tree on the remote SR
for each live VDI.

Signed-off-by: John Else <john.else@citrix.com>
Add remote SR/VDI to mirror_record type

Signed-off-by: John Else <john.else@citrix.com>
Ignore Unknown_RPC exceptions in update_snapshot_info

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

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

Signed-off-by: John Else <john.else@citrix.com>
Better logging for update_snapshot_info_src

Signed-off-by: John Else <john.else@citrix.com>
Add SMAPI call update_snapshot_info_dest

Signed-off-by: John Else <john.else@citrix.com>
Rearrange snapshot updating SMAPI code

- Implement SR.update_snapshot_info_dest
- Call the above from SR.update_snapshot_info_src
- Remove VDI.set_snapshot_of, VDI.set_snapshot_time,
  VDI.set_is_a_snapshot from SMAPI

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