提交 3eafaf67 编写于 作者: P Peter Krempa

qemu: block: rename and refactor qemuBuildGlusterDriveJSON

New name is qemuBlockStorageSourceGetGlusterProps and also hardcode the
protocol name rather than calling the ToString function, since this
function can't be made universal.
上级 7ee3df57
...@@ -503,9 +503,8 @@ qemuBlockStorageSourceBuildHostsJSONSocketAddress(virStorageSourcePtr src, ...@@ -503,9 +503,8 @@ qemuBlockStorageSourceBuildHostsJSONSocketAddress(virStorageSourcePtr src,
static virJSONValuePtr static virJSONValuePtr
qemuBuildGlusterDriveJSON(virStorageSourcePtr src) qemuBlockStorageSourceGetGlusterProps(virStorageSourcePtr src)
{ {
const char *protocol = virStorageNetProtocolTypeToString(src->protocol);
virJSONValuePtr servers = NULL; virJSONValuePtr servers = NULL;
virJSONValuePtr ret = NULL; virJSONValuePtr ret = NULL;
...@@ -519,7 +518,7 @@ qemuBuildGlusterDriveJSON(virStorageSourcePtr src) ...@@ -519,7 +518,7 @@ qemuBuildGlusterDriveJSON(virStorageSourcePtr src)
* {type:"unix", socket:"/tmp/glusterd.socket"}, ...]} * {type:"unix", socket:"/tmp/glusterd.socket"}, ...]}
*/ */
if (virJSONValueObjectCreate(&ret, if (virJSONValueObjectCreate(&ret,
"s:driver", protocol, "s:driver", "gluster",
"s:volume", src->volume, "s:volume", src->volume,
"s:path", src->path, "s:path", src->path,
"a:server", servers, NULL) < 0) "a:server", servers, NULL) < 0)
...@@ -555,7 +554,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src) ...@@ -555,7 +554,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src)
case VIR_STORAGE_TYPE_NETWORK: case VIR_STORAGE_TYPE_NETWORK:
switch ((virStorageNetProtocol) src->protocol) { switch ((virStorageNetProtocol) src->protocol) {
case VIR_STORAGE_NET_PROTOCOL_GLUSTER: case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
if (!(fileprops = qemuBuildGlusterDriveJSON(src))) if (!(fileprops = qemuBlockStorageSourceGetGlusterProps(src)))
goto cleanup; goto cleanup;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册