
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1264722331 28800 # Node ID 5b37fac8372729a7da9817a8fc0661159fc710b8 # Parent 0273f86ebd7b6e54ec606d0a2a9aa54ce40246f1 Add support for defining a net device with the target device set Also provide template RASDs with the VirtualDevice attribute exposed. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 0273f86ebd7b -r 5b37fac83727 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Jan 28 15:45:31 2010 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Jan 28 15:45:31 2010 -0800 @@ -546,6 +546,7 @@ const char *net_type, const char *net_name, uint64_t num_nics, + const char *device, const char *model, struct inst_list *list) { @@ -565,6 +566,10 @@ (CMPIValue *)&num_nics, CMPI_uint64); if (model != NULL) + CMSetProperty(inst, "VirtualDevice", + (CMPIValue *)device, CMPI_chars); + + if (model != NULL) CMSetProperty(inst, "ResourceSubType", (CMPIValue *)model, CMPI_chars); @@ -584,6 +589,7 @@ CMPIStatus s = {CMPI_RC_OK, NULL}; int i,j; const char *type[] = {"network", "bridge", "user"}; + const char *device[] = {"vtap1", NULL}; const char *model[] = {"e1000", NULL}; const char *name[] = {NULL, "br0", NULL}; @@ -622,6 +628,7 @@ type[i], name[i], num_nics, + device[j], model[j], list); if (s.rc != CMPI_RC_OK) diff -r 0273f86ebd7b -r 5b37fac83727 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Thu Jan 28 15:45:31 2010 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Thu Jan 28 15:45:31 2010 -0800 @@ -752,6 +752,13 @@ dev->dev.net.type = strdup(USER_TYPE); } else return "Invalid Network Type specified"; + + free(dev->dev.net.device); + if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK) + dev->dev.net.device = NULL; + else + dev->dev.net.device = strdup(val); + free(dev->dev.net.model); if (cu_get_str_prop(inst, "ResourceSubType", &val) != CMPI_RC_OK)