From: Peter Krempa Date: Fri, 7 Jul 2017 16:00:04 +0000 (+0200) Subject: qemu: block: rename and refactor qemuBuildGlusterDriveJSON X-Git-Tag: v3.6.0-rc1~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eafaf672cabf61b9d8fef58d56ba862fe3c600a;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 73f2090602..ccaf326110 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -503,9 +503,8 @@ qemuBlockStorageSourceBuildHostsJSONSocketAddress(virStorageSourcePtr src, static virJSONValuePtr -qemuBuildGlusterDriveJSON(virStorageSourcePtr src) +qemuBlockStorageSourceGetGlusterProps(virStorageSourcePtr src) { - const char *protocol = virStorageNetProtocolTypeToString(src->protocol); virJSONValuePtr servers = NULL; virJSONValuePtr ret = NULL; @@ -519,7 +518,7 @@ qemuBuildGlusterDriveJSON(virStorageSourcePtr src) * {type:"unix", socket:"/tmp/glusterd.socket"}, ...]} */ if (virJSONValueObjectCreate(&ret, - "s:driver", protocol, + "s:driver", "gluster", "s:volume", src->volume, "s:path", src->path, "a:server", servers, NULL) < 0) @@ -555,7 +554,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src) case VIR_STORAGE_TYPE_NETWORK: switch ((virStorageNetProtocol) src->protocol) { case VIR_STORAGE_NET_PROTOCOL_GLUSTER: - if (!(fileprops = qemuBuildGlusterDriveJSON(src))) + if (!(fileprops = qemuBlockStorageSourceGetGlusterProps(src))) goto cleanup; break;