[PATCH 0 of 4] Adding a flag to set default VNC Address.

# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1259698246 28800 # Node ID 52c9710d5c2db50b9b869b0a939778b25c94340d # Parent e9dd109e3503bd36bf3a1736a526b057d6316b54 Remove default IPv4 address. Signed-off-by: Sharad Mishra <snmishra@us.ibm.com> diff -r e9dd109e3503 -r 52c9710d5c2d libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Tue Nov 24 16:01:10 2009 -0800 +++ b/libxkutil/device_parsing.c Tue Dec 01 12:10:46 2009 -0800 @@ -452,7 +452,7 @@ goto err; if (gdev->host == NULL) - gdev->host = strdup("127.0.0.1"); + goto err; } vdev->type = CIM_RES_TYPE_GRAPHICS;

# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1259698251 28800 # Node ID 955cc84d7c9a4964240e77e9e83adfccf40ad5c5 # Parent 52c9710d5c2db50b9b869b0a939778b25c94340d Add IPv6 flag to mof file. Signed-off-by: Sharad Mishra <snmishra@us.ibm.com> diff -r 52c9710d5c2d -r 955cc84d7c9a schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Tue Dec 01 12:10:46 2009 -0800 +++ b/schema/ResourceAllocationSettingData.mof Tue Dec 01 12:10:51 2009 -0800 @@ -139,6 +139,9 @@ [Description ("VNC password")] string Password; + + [Description ("Is IPv6 only addressing is to be used")] + boolean IsIPv6Only; }; [Description ("KVM virtual graphics device"), @@ -155,6 +158,9 @@ [Description ("VNC password")] string Password; + + [Description ("Is IPv6 only addressing is to be used")] + boolean IsIPv6Only; }; [Description ("LXC virtual graphics device"), @@ -171,6 +177,9 @@ [Description ("VNC password")] string Password; + + [Description ("Is IPv6 only addressing is to be used")] + boolean IsIPv6Only; }; [Description ("Xen virtual input device"),

# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1259698252 28800 # Node ID e684978394c4d7afb4febff2b51d1bcb4d1854b0 # Parent 955cc84d7c9a4964240e77e9e83adfccf40ad5c5 Set Graphics Template Signed-off-by: Sharad Mishra <snmishra@us.ibm.com> diff -r 955cc84d7c9a -r e684978394c4 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Tue Dec 01 12:10:51 2009 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Dec 01 12:10:52 2009 -0800 @@ -1555,7 +1555,8 @@ const char *id; CMPIStatus s = {CMPI_RC_OK, NULL}; const char *type[] = {"sdl", "vnc"}; - const char *addr[] = {NULL, "127.0.0.1:-1", "[::1]:-1"}; + const char *addr[] = {NULL, "127.0.0.1:-1", "[::1]:-1", + "True", "False"}; int type_ct = 2; int i,j; @@ -1580,7 +1581,7 @@ } for (i = 0; i < type_ct; i++) { - for (j = 1; j < 3; j++){ + for (j = 1; j < 5; j++){ s = set_graphics_props(ref, id, type[i],

# HG changeset patch # User Sharad Mishra <snmishra@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@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,
participants (1)
-
Sharad Mishra