sheep: get object size correctly

For backend store, the object size is determined by copy_policy.

Also add a helper to get store object size for future use.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: fix cluster_notify_vdi_add

We should set copy_policy too for snapshot vdi

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: rework cow object handling

cow handling should be handled in the gateway instead of backend store because
copy-on-write's copy(read) and write should be object type agnostic. With this
patch, we can add cow capability to erasured vdi.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: don't set copies unnecessarily

For gateway request, we don't need to set copy number.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: cleanup preallocate

Since trim/untrim is removed from sheep, we don't need to extend buffer.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: fix default_create_and_write()

Cluster snapshot's create request will have copy_policy set in the sd_req but
without vdi registered. So we have to pass copy_policy down and check it in the
default_create_and_write.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
dog/farm: fix copy_policy for cluster snapshot operation

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: set SD_FLAG_CMD_WRITE in sd_init_req

It is easy to forget to set SD_FLAG_CMD_WRITE for write and create and hard
to debug, so set it directly in sd_init_req().

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/functional: make snapshot related tests to work with erasure code

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
dog: print warning when checking erasured vdi

This is left for a future work

Signed-off-by: Liu Yuan <namei.unix@gmail.com>