Fix SMAPIv1 backwards compatibility on pool slaves
Fix SMAPIv1 backwards compatibility on pool slaves

The two facts:
  Only the master should list the SM plugins directly.
  When the proxies are being started up on the master, the SM database
    records haven't been created.

Imply that we should query Sm.* when running on the master, but use
the SM database records on the slave.

Signed-off-by: David Scott <63c9eb0ea83039690fefa11afe17873ba8278a56@eu.citrix.com>

agimofcarmen/xen-api,salvocambria/xen-api,cheng-z/xen-api,koushikcgit/xen-api,guard163/xen-api,robertbreker/xen-api,cheng--zhang/xen-api,rafalmiel/xen-api,guard163/xen-api,srowe/xen-api,cheng-z/xen-api,simonjbeaumont/xen-api,salvocambria/xen-api,cheng-z/xen-api,robertbreker/xen-api,Frezzle/xen-api,agimofcarmen/xen-api,srowe/xen-api,simonjbeaumont/xen-api,salvocambria/xen-api,jjd27/xen-api,koushikcgit/xen-api,salvocambria/xen-api,vasilenkomike/xen-api,robertbreker/xen-api,huizh/xen-api,huizh/xen-api,vasilenkomike/xen-api,vasilenkomike/xen-api,simonjbeaumont/xen-api,thomassa/xen-api,agimofcarmen/xen-api,Frezzle/xen-api,salvocambria/xen-api,anoobs/xen-api,anoobs/xen-api,euanh/xen-api,jjd27/xen-api,djs55/xen-api,cheng--zhang/xen-api,anoobs/xen-api,robertbreker/xen-api,agimofcarmen/xen-api,vasilenkomike/xen-api,cheng--zhang/xen-api,anoobs/xen-api,thomassa/xen-api,simonjbeaumont/xen-api,cheng-z/xen-api,jjd27/xen-api,srowe/xen-api,djs55/xen-api,guard163/xen-api,huizh/xen-api,simonjbeaumont/xen-api,koushikcgit/xen-api,rafalmiel/xen-api,cheng--zhang/xen-api,agimofcarmen/xen-api,koushikcgit/xen-api,djs55/xen-api,srowe/xen-api,huizh/xen-api,huizh/xen-api,euanh/xen-api,jjd27/xen-api,euanh/xen-api,Frezzle/xen-api,salvocambria/xen-api,robertbreker/xen-api,guard163/xen-api,djs55/xen-api,cheng-z/xen-api,djs55/xen-api,koushikcgit/xen-api,djs55/xen-api,anoobs/xen-api,thomassa/xen-api,rafalmiel/xen-api,srowe/xen-api,guard163/xen-api,rafalmiel/xen-api,Frezzle/xen-api,simonjbeaumont/xen-api,cheng-z/xen-api,rafalmiel/xen-api,euanh/xen-api,robertbreker/xen-api,koushikcgit/xen-api,jjd27/xen-api,cheng--zhang/xen-api,Frezzle/xen-api,vasilenkomike/xen-api,thomassa/xen-api,vasilenkomike/xen-api,agimofcarmen/xen-api,cheng--zhang/xen-api,euanh/xen-api,rafalmiel/xen-api,anoobs/xen-api,euanh/xen-api,jjd27/xen-api,cheng--zhang/xen-api,thomassa/xen-api,guard163/xen-api,cheng-z/xen-api,thomassa/xen-api,huizh/xen-api