# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1246480792 25200
# Node ID 4ea22198d1848b0097e81268dcedc940f2fb9be5
# Parent b1a29661b142f455bcbb9b4d21ae2cb7c038f5e8
Be sure to support "user" type interfaces
This patch is to fix a regression found by running the NetworkPort -
03_user_netport.py test.
Also be sure to generate a template NetRASD for the user type.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r b1a29661b142 -r 4ea22198d184 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Tue Jun 30 14:33:31 2009 -0700
+++ b/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 13:39:52 2009 -0700
@@ -578,9 +578,9 @@
const char *id;
CMPIStatus s = {CMPI_RC_OK, NULL};
int i,j;
- const char *type[] = {"network", "bridge"};
+ const char *type[] = {"network", "bridge",
"user"};
const char *model[] = {"e1000", NULL};
- const char *name[] = {NULL, "br0"};
+ const char *name[] = {NULL, "br0", NULL};
switch (template_type) {
case SDC_RASD_MIN:
@@ -609,7 +609,7 @@
}
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < 3; i++) {
for (j = 0; j < 2; j++) {
s = set_net_props(template_type,
ref,
diff -r b1a29661b142 -r 4ea22198d184 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Jun 30 14:33:31 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Wed Jul 01 13:39:52 2009 -0700
@@ -61,6 +61,7 @@
#define DEFAULT_XEN_WEIGHT 1024
#define BRIDGE_TYPE "bridge"
#define NETWORK_TYPE "network"
+#define USER_TYPE "user"
const static CMPIBroker *_BROKER;
@@ -585,7 +586,8 @@
}
dev->dev.net.source = strdup(network);
-
+ } else if (STREQC(val, USER_TYPE)) {
+ dev->dev.net.type = strdup(USER_TYPE);
} else
return "Invalid Network Type specified";
free(dev->dev.net.model);