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