CA-202385: SR assert_operation_valid: only run relevant checks
CA-202385: SR assert_operation_valid: only run relevant checks

In Xapi_sr_operations.assert_operation_valid, we know which operation we're
trying to perform, so don't bother checking errors that would occur for other
operations. That's a waste of energy.

Since some of the checks involve expensive operations, this can improve
performance. Measurements confirm that the duration of a vdi-create operation
when there are 16,000 VDIs is reduced from 4.8 to 3.3 seconds, i.e. a 30%
improvement.

Signed-off-by: Jonathan Davies <d3af50858a27f644d377a39d1fbd399608163688@citrix.com>

Frezzle/xen-api,euanh/xen-api,thomassa/xen-api,rafalmiel/xen-api,euanh/xen-api,jjd27/xen-api,rafalmiel/xen-api,srowe/xen-api,jjd27/xen-api,Frezzle/xen-api,thomassa/xen-api,jjd27/xen-api,srowe/xen-api,srowe/xen-api,thomassa/xen-api,thomassa/xen-api,srowe/xen-api,Frezzle/xen-api,euanh/xen-api,jjd27/xen-api,rafalmiel/xen-api,rafalmiel/xen-api,euanh/xen-api,jjd27/xen-api,euanh/xen-api,euanh/xen-api,rafalmiel/xen-api,jjd27/xen-api,rafalmiel/xen-api,Frezzle/xen-api,thomassa/xen-api,srowe/xen-api,Frezzle/xen-api,thomassa/xen-api