From 3eafaf672cabf61b9d8fef58d56ba862fe3c600a Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 7 Jul 2017 18:00:04 +0200 Subject: [PATCH] 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. --- src/qemu/qemu_block.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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;