# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1259698253 28800
# Node ID aee47d55aec26aadecf3b0f0a753c16a23b8cefb
# Parent e684978394c4d7afb4febff2b51d1bcb4d1854b0
Assign default IPv4 or IPv6 address depending on the flag.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r e684978394c4 -r aee47d55aec2 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Dec 01 12:10:52 2009 -0800
+++ b/src/Virt_VirtualSystemManagementService.c Tue Dec 01 12:10:53 2009 -0800
@@ -970,6 +970,7 @@
const char *val;
const char *msg = NULL;
const char *keymap;
+ bool ipv6 = false;
int ret;
if (cu_get_str_prop(inst, "ResourceSubType", &val) != CMPI_RC_OK)
{
@@ -980,8 +981,14 @@
/* FIXME: Add logic to prevent address:port collisions */
if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {
+ CU_DEBUG("no graphics port defined, giving default");
+ if (cu_get_bool_prop(inst, "IsIPv6Only", &ipv6) !=
CMPI_RC_OK)
+ ipv6 = false;
+ if (ipv6)
+ dev->dev.graphics.host = strdup("[::1]");
+ else
+ dev->dev.graphics.host = strdup("127.0.0.1");
dev->dev.graphics.port = strdup("-1");
- dev->dev.graphics.host = strdup("127.0.0.1");
} else {
ret = parse_vnc_address(val,
&dev->dev.graphics.host,