Blame SOURCES/libvirt-util-storage-make-virStorageSourceParseBackingJSONGlusterHost-universal.patch

6d3351
From 963c75c28dcda3f5a01df2d13d0a42186adbc2de Mon Sep 17 00:00:00 2001
6d3351
Message-Id: <963c75c28dcda3f5a01df2d13d0a42186adbc2de@dist-git>
6d3351
From: Peter Krempa <pkrempa@redhat.com>
6d3351
Date: Tue, 20 Jun 2017 10:22:37 +0200
6d3351
Subject: [PATCH] util: storage: make
6d3351
 virStorageSourceParseBackingJSONGlusterHost universal
6d3351
6d3351
The same json strucutre is used for NBD and sheepdog volumes for
6d3351
specifying of the host. Rename the function and fix up error messages to
6d3351
be more universal.
6d3351
6d3351
(cherry picked from commit 6402f402d4577b5eacf00debe5e59c328bb58f75)
6d3351
6d3351
https://bugzilla.redhat.com/show_bug.cgi?id=1461638
6d3351
6d3351
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6d3351
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6d3351
---
6d3351
 src/util/virstoragefile.c | 12 ++++++------
6d3351
 1 file changed, 6 insertions(+), 6 deletions(-)
6d3351
6d3351
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
6d3351
index c86cd2fc0a..b8aced5055 100644
6d3351
--- a/src/util/virstoragefile.c
6d3351
+++ b/src/util/virstoragefile.c
6d3351
@@ -2800,8 +2800,8 @@ virStorageSourceParseBackingJSONUri(virStorageSourcePtr src,
6d3351
 
6d3351
 
6d3351
 static int
6d3351
-virStorageSourceParseBackingJSONGlusterHost(virStorageNetHostDefPtr host,
6d3351
-                                            virJSONValuePtr json)
6d3351
+virStorageSourceParseBackingJSONSocketAddress(virStorageNetHostDefPtr host,
6d3351
+                                              virJSONValuePtr json)
6d3351
 {
6d3351
     const char *type = virJSONValueObjectGetString(json, "type");
6d3351
     const char *hostname = virJSONValueObjectGetString(json, "host");
6d3351
@@ -2822,7 +2822,7 @@ virStorageSourceParseBackingJSONGlusterHost(virStorageNetHostDefPtr host,
6d3351
         if (!hostname) {
6d3351
             virReportError(VIR_ERR_INVALID_ARG, "%s",
6d3351
                            _("missing hostname for tcp backing server in "
6d3351
-                             "JSON backing definition for gluster volume"));
6d3351
+                             "JSON backing volume definition"));
6d3351
             return -1;
6d3351
         }
6d3351
 
6d3351
@@ -2835,7 +2835,7 @@ virStorageSourceParseBackingJSONGlusterHost(virStorageNetHostDefPtr host,
6d3351
         if (!socket) {
6d3351
             virReportError(VIR_ERR_INVALID_ARG, "%s",
6d3351
                            _("missing socket path for udp backing server in "
6d3351
-                             "JSON backing definition for gluster volume"));
6d3351
+                             "JSON backing volume definition"));
6d3351
             return -1;
6d3351
         }
6d3351
 
6d3351
@@ -2902,8 +2902,8 @@ virStorageSourceParseBackingJSONGluster(virStorageSourcePtr src,
6d3351
     src->nhosts = nservers;
6d3351
 
6d3351
     for (i = 0; i < nservers; i++) {
6d3351
-        if (virStorageSourceParseBackingJSONGlusterHost(src->hosts + i,
6d3351
-                                                        virJSONValueArrayGet(server, i)) < 0)
6d3351
+        if (virStorageSourceParseBackingJSONSocketAddress(src->hosts + i,
6d3351
+                                                          virJSONValueArrayGet(server, i)) < 0)
6d3351
             return -1;
6d3351
     }
6d3351
 
6d3351
-- 
6d3351
2.13.1
6d3351