return ret;
}
+
+static virJSONValuePtr
+qemuBlockStorageSourceGetSshProps(virStorageSourcePtr src)
+{
+ virJSONValuePtr serverprops;
+ virJSONValuePtr ret = NULL;
+ const char *username = NULL;
+
+ if (src->nhosts != 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("sheepdog protocol accepts only one host"));
+ return NULL;
+ }
+
+ serverprops = qemuBlockStorageSourceBuildJSONInetSocketAddress(&src->hosts[0]);
+ if (!serverprops)
+ return NULL;
+
+ if (src->auth)
+ username = src->auth->username;
+
+ ignore_value(virJSONValueObjectCreate(&ret,
+ "s:driver", "ssh",
+ "s:path", src->path,
+ "a:server", serverprops,
+ "S:user", username,
+ NULL));
+
+ return ret;
+}
+
+
/**
* qemuBlockStorageSourceGetBackendProps:
* @src: disk source
break;
case VIR_STORAGE_NET_PROTOCOL_SSH:
+ if (!(fileprops = qemuBlockStorageSourceGetSshProps(src)))
+ return NULL;
+ break;
+
case VIR_STORAGE_NET_PROTOCOL_NONE:
case VIR_STORAGE_NET_PROTOCOL_LAST:
break;