]> xenbits.xensource.com Git - xcp/xen-api.git/commit
CA-41553: Fix logic bugs in vm_install_real and do some code cleanup
authorZheng Li <zheng.li@eu.citrix.com>
Wed, 26 Jan 2011 17:39:04 +0000 (17:39 +0000)
committerZheng Li <zheng.li@eu.citrix.com>
Wed, 26 Jan 2011 17:39:04 +0000 (17:39 +0000)
commitbe8b660876b31357bb076b37b8e1d417c3c72c6c
tree8872b2304c03276ef2a80381376151b26428979d
parent4e99cc89d52da302c93f345df3be4978723ade41
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 <zheng.li@eu.citrix.com>
ocaml/xapi/cli_operations.ml