CA-41553: Fix logic bugs in vm_install_real and do some code cleanup
CA-41553: Fix logic bugs in vm_install_real and do some code cleanup

There were two logic bugs in vm_install_real

* When user create a VM based on a snapshot (which is also considered as a template from XenServer point of view), and neither sr-name-lable or sr-uuid is specified (neither is wanted any way), the code will fail if the pool doesn't have default SR set (which is not necessary as well).  This is the problem spot in CA-41553.

* When both sr-uuid and sr-name-lable are specified in command line at the same time

  - If there is some contradiction, say the SR with sr-uuid doesn't have the name as specified in sr-name-label, XenServer will only take sr-name-label into consideration and ignore sr-uuid without a warning
  - If sr-name-label corresponding to several SRs in the system, instead of using the sr-uuid information to restrict the candidate to one, XenServer will simply fail and complain "Multiple SRs with that name-label found".

Signed-off-by: Zheng Li <fff69bf00b8ec5b6098a1768eaaaa75f40b8795d@eu.citrix.com>

djs55/xcp-rrdd,djs55/squeezed,koushikcgit/xcp-rrdd,robhoes/squeezed,djs55/xcp-networkd,simonjbeaumont/xcp-rrdd,koushikcgit/xcp-networkd,johnelse/xcp-rrdd,koushikcgit/xcp-rrdd,koushikcgit/xcp-networkd,sharady/xcp-networkd,simonjbeaumont/xcp-rrdd,koushikcgit/xcp-rrdd,sharady/xcp-networkd,djs55/xcp-rrdd,johnelse/xcp-rrdd,djs55/xcp-networkd