Remove dead code: remove the ability to use a daemonised SMAPIv1 plugin

No-one was using this and we don't want to promote the use of the
old storage interface.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Remove dead code: xapi doesn't need to create "qemu frontends"

All such logic is now in xenopsd.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[sm] allow xapi to use SMAPIv2 services in domain 0

If the driver domain for an SR is dom0, then xapi first looks for
a registered SMAPIv1 plugin. If one isn't found then it attempts
to contact an SMAPIv2 service over a unix domain socket.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] add SR.create to the SMAPIv2

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Supportability: [sm-cli] add "query" subcommand

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] make Query more regular: in a module with a "dbg" argument

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Supportability: [sm-cli] add sr-create

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] improve the Unimplemented exception by adding a function name argument

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Supportability: [sm-cli] add '-v' for verbose; sr-create and sr-attach

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Supportability: [sm-cli] add sr-detach

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] enhance the exception Sr_not_attached by adding the SR

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] enhance the Sr_attached exception by adding the SR

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] enhance the Vdi_does_not_exist exception by adding the VDI

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Supporability: [sm-cli] add vdi-{attach,activate,deactivate,detach}

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Component testing: [smtest] allow the local SMAPIv2 Unix domain socket to be specified

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] use the feature flags from query in the allowed-operations

Whenever an SMAPIv2 backend is registered with storage_mux, the features
are queried and cached. On PBD.{plug,unplug} the SR's allowed_operations
are recomputed.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] if the storage service has failed, call SR.reset instead of failing to start

This will forget all SR state and set the PBD.currently_attached=false.

This isn't ideal as some VMs may still be running using resources from this SR.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[SMAPIv2] the VDI.allowed_operations should check the SMAPIv2 capabilities too

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[sm] register SMAPIv2 plugins in the SM table on PBD.plug

Unlike the SMAPIv1 plugins, the v2 ones may be hidden away in offline
driver domain VMs making them hard to query. Instead we re-query
their capabilities at PBD.plug time.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[sm] don't rely on the SM backend deleting the VDI record from the database

Only an SMAPIv1 plugin can do this, so we need to be able to delete these ourselves.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>