]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: block: rename and refactor qemuBuildGlusterDriveJSON
authorPeter Krempa <pkrempa@redhat.com>
Fri, 7 Jul 2017 16:00:04 +0000 (18:00 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 14 Jul 2017 14:05:46 +0000 (16:05 +0200)
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

index 73f20906026bf63893fdcd4d556cf745c9543a65..ccaf3261101d6c87d933beb86cc937f88edfd519 100644 (file)
@@ -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;