[libvirt] [PATCH 10/10] qemu: block: rename and refactor qemuBuildGlusterDriveJSON

Peter Krempa pkrempa at redhat.com
Mon Jul 10 12:07:42 UTC 2017


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 73f209060..ccaf32611 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;

-- 
2.12.2




More information about the libvir-list mailing list