diff -c -r1.72 xend_internal.c
*** src/xend_internal.c 10 Nov 2006 11:13:01 -0000 1.72
--- src/xend_internal.c 10 Nov 2006 22:24:39 -0000
***************
*** 1698,1735 ****
if (drvType)
free(drvType);
} else if (sexpr_lookup(node, "device/vif")) {
! const char *tmp2;
!
! tmp = sexpr_node(node, "device/vif/bridge");
! tmp2 = sexpr_node(node, "device/vif/script");
! if ((tmp != NULL) || (strstr(tmp2, "bridge"))) {
virBufferVSprintf(&buf, " \n");
! if (tmp != NULL)
! virBufferVSprintf(&buf, " \n",
! tmp);
! tmp = sexpr_node(node, "device/vif/vifname");
! if (tmp != NULL)
! virBufferVSprintf(&buf, " \n",
! tmp);
! tmp = sexpr_node(node, "device/vif/mac");
! if (tmp != NULL)
! virBufferVSprintf(&buf, " \n",
! tmp);
! tmp = sexpr_node(node, "device/vif/ip");
! if (tmp != NULL)
! virBufferVSprintf(&buf, " \n",
! tmp);
if (tmp2 != NULL)
! virBufferVSprintf(&buf, " \n",
tmp2);
- virBufferAdd(&buf, " \n", 17);
} else {
! char serial[1000];
!
! TODO sexpr2string(node, serial, 1000);
! virBufferVSprintf(&buf, "\n",
! serial);
}
}
}
--- 1698,1732 ----
if (drvType)
free(drvType);
} else if (sexpr_lookup(node, "device/vif")) {
! tmp = sexpr_node(node, "device/vif/script");
! if (tmp && strstr(tmp, "bridge")) {
! const char *tmp2;
virBufferVSprintf(&buf, " \n");
!
! tmp2 = sexpr_node(node, "device/vif/bridge");
if (tmp2 != NULL)
! virBufferVSprintf(&buf, " \n",
tmp2);
} else {
! virBufferVSprintf(&buf, " \n");
}
+ if (tmp)
+ virBufferVSprintf(&buf, " \n",
+ tmp);
+
+ tmp = sexpr_node(node, "device/vif/vifname");
+ if (tmp)
+ virBufferVSprintf(&buf, " \n",
+ tmp);
+ tmp = sexpr_node(node, "device/vif/mac");
+ if (tmp)
+ virBufferVSprintf(&buf, " \n",
+ tmp);
+ tmp = sexpr_node(node, "device/vif/ip");
+ if (tmp)
+ virBufferVSprintf(&buf, " \n",
+ tmp);
+ virBufferAdd(&buf, " \n", 17);
}
}
diff -c -r1.45 xml.c
*** src/xml.c 10 Nov 2006 11:13:01 -0000 1.45
--- src/xml.c 10 Nov 2006 22:24:41 -0000
***************
*** 1113,1118 ****
--- 1116,1122 ----
xmlChar *source = NULL;
xmlChar *mac = NULL;
xmlChar *script = NULL;
+ xmlChar *ip = NULL;
int typ = 0;
type = xmlGetProp(node, BAD_CAST "type");
***************
*** 1139,1144 ****
--- 1143,1155 ----
} else if ((script == NULL) &&
(xmlStrEqual(cur->name, BAD_CAST "script"))) {
script = xmlGetProp(cur, BAD_CAST "path");
+ } else if ((ip == NULL) &&
+ (xmlStrEqual(cur->name, BAD_CAST "ip"))) {
+ /* XXX in future expect to need to have > 1 ip
+ address element - eg ipv4 & ipv6. For now
+ xen only supports a single address though
+ so lets ignore that complication */
+ ip = xmlGetProp(cur, BAD_CAST "address");
}
}
cur = cur->next;
***************
*** 1155,1160 ****
--- 1166,1173 ----
}
if (script != NULL)
virBufferVSprintf(buf, "(script '%s')", script);
+ if (ip != NULL)
+ virBufferVSprintf(buf, "(ip '%s')", ip);
if (hvm)
virBufferAdd(buf, "(type ioemu)", 12);
***************
*** 1165,1170 ****
--- 1178,1185 ----
xmlFree(source);
if (script != NULL)
xmlFree(script);
+ if (ip != NULL)
+ xmlFree(ip);
return (0);
}
diff -c -r1.2 sexpr2xml-fv-v2.xml
*** tests/sexpr2xmldata/sexpr2xml-fv-v2.xml 9 Oct 2006 14:32:07 -0000 1.2
--- tests/sexpr2xmldata/sexpr2xml-fv-v2.xml 10 Nov 2006 22:24:41 -0000
***************
*** 29,36 ****
-
--- 29,36 ----
+
diff -c -r1.2 sexpr2xml-fv.xml
*** tests/sexpr2xmldata/sexpr2xml-fv.xml 9 Oct 2006 14:32:07 -0000 1.2
--- tests/sexpr2xmldata/sexpr2xml-fv.xml 10 Nov 2006 22:24:41 -0000
***************
*** 23,30 ****
-
--- 23,30 ----
+