# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1245858951 25200
# Node ID 983e35ff6034988d958ec4425d3419906b5c516a
# Parent 3fa64e808da1d96eeb7e58f6f0532a4c00deba4b
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 3fa64e808da1 -r 983e35ff6034 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Jun 12 15:11:51 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Wed Jun 24 08:55:51 2009 -0700
@@ -537,6 +537,7 @@
{
const char *val = NULL;
const char *msg = NULL;
+ char *network = NULL;
if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {
val = _net_rand_mac();
@@ -561,8 +562,14 @@
if (val == NULL)
return "No NetworkPool specified and no default available";
+ network = name_from_pool_id(val);
+ if (network == NULL) {
+ msg = "PoolID specified is not formatted properly";
+ goto out;
+ }
+
free(dev->dev.net.source);
- dev->dev.net.source = name_from_pool_id(val);
+ dev->dev.net.source = strdup(network);
free(dev->dev.net.model);
if (cu_get_str_prop(inst, "ResourceSubType", &val) != CMPI_RC_OK)
@@ -571,6 +578,7 @@
dev->dev.net.model = strdup(val);
out:
+ free(network);
return msg;
}