[Gluster-devel] [PATCH v5 3/4] qemu: Fix nbd, rbd, sheepdog to initialize defaults for new host members.
Harsh Prateek Bora
harsh at linux.vnet.ibm.com
Thu Nov 22 18:10:40 UTC 2012
struct _virDomainDiskHostDef recently got new members to support transport
and socket attributes. Consumers of this struct therefore needs to initialize
default values for them. This patch initializes default values for transport
and socket for nbd, rbd and sheepdog storage backends.
Signed-off-by: Harsh Prateek Bora <harsh at linux.vnet.ibm.com>
---
src/qemu/qemu_command.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index a377744..af2fcd5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1940,6 +1940,10 @@ static int qemuAddRBDHost(virDomainDiskDefPtr disk, char *hostport)
disk->hosts[disk->nhosts-1].name = strdup(hostport);
if (!disk->hosts[disk->nhosts-1].name)
goto no_memory;
+
+ disk->hosts[disk->nhosts-1].transport = VIR_DOMAIN_DISK_PROTO_TRANS_TCP;
+ disk->hosts[disk->nhosts-1].socket = NULL;
+
return 0;
no_memory:
@@ -7087,6 +7091,8 @@ qemuParseCommandLineDisk(virCapsPtr caps,
virReportOOMError();
goto cleanup;
}
+ def->hosts->transport = VIR_DOMAIN_DISK_PROTO_TRANS_TCP;
+ def->hosts->socket = NULL;
VIR_FREE(def->src);
def->src = NULL;
} else if (STRPREFIX(def->src, "rbd:")) {
@@ -7145,6 +7151,8 @@ qemuParseCommandLineDisk(virCapsPtr caps,
virReportOOMError();
goto cleanup;
}
+ def->hosts->transport = VIR_DOMAIN_DISK_PROTO_TRANS_TCP;
+ def->hosts->socket = NULL;
def->src = strdup(vdi);
if (!def->src) {
@@ -8848,6 +8856,9 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
VIR_FREE(hosts);
goto no_memory;
}
+ first_rbd_disk->hosts[first_rbd_disk->nhosts].transport = VIR_DOMAIN_DISK_PROTO_TRANS_TCP;
+ first_rbd_disk->hosts[first_rbd_disk->nhosts].socket = NULL;
+
first_rbd_disk->nhosts++;
token = strtok_r(NULL, ",", &saveptr);
}
--
1.7.11.7
More information about the Gluster-devel
mailing list