Commit e955ae3d authored by Leigh B Stoller's avatar Leigh B Stoller

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/users/tarunp/emulab-devel into rspec

parents 023101a7 fb827d0a
......@@ -195,7 +195,7 @@ int parse_advertisement(tb_pgraph &pg, tb_sgraph &sg, char *filename) {
* All done, clean up memory
*/
// XMLPlatformUtils::Terminate();
free(rspecParser);
delete rspecParser;
return 0;
}
......
......@@ -201,7 +201,7 @@ int parse_request(tb_vgraph &vg, char *filename) {
* All done, clean up memory
*/
// XMLPlatformUtils::Terminate();
free(rspecParser);
delete rspecParser;
return 0;
}
......@@ -710,7 +710,10 @@ bool populate_link (DOMElement* elt,
/*
* Pull the links from the vtop file, and populate assign's own data sturctures
*/
bool populate_links(DOMElement *root, tb_vgraph &vg, map< pair<string, string>, pair<string, string> >* fixed_interfaces) {
bool
populate_links(DOMElement *root,
tb_vgraph &vg,
map< pair<string, string>, pair<string, string> >*fixed_interfaces) {
bool is_ok = true;
/*
......@@ -720,7 +723,7 @@ bool populate_links(DOMElement *root, tb_vgraph &vg, map< pair<string, string>,
DOMNodeList *links = root->getElementsByTagName(XStr("link").x());
int linkCount = links->getLength();
XMLDEBUG("Found " << links->getLength() << " links in rspec" << endl);
for (size_t i = 0; i < linkCount; i++) {
for (int i = 0; i < linkCount; i++) {
DOMNode *link = links->item(i);
DOMElement *elt = dynamic_cast<DOMElement*>(link);
is_ok &= populate_link(elt, vg, fixed_interfaces);
......@@ -742,7 +745,7 @@ bool populate_vclass (struct vclass vclass, tb_vgraph& vg)
vclass_map[name] = v;
}
for (int i = 0; i < vclass.physicalTypes.size(); i++) {
for (unsigned int i = 0; i < vclass.physicalTypes.size(); i++) {
fstring physType = XStr(vclass.physicalTypes[i].c_str()).f();
v->add_type(physType);
vclasses[name].push_back(physType);
......@@ -758,7 +761,7 @@ bool populate_vclasses (DOMElement* root, tb_vgraph& vg)
bool isOk = true;
vector<struct vclass> vclasses = rspecParser->readVClasses(root);
cerr << "Found " << vclasses.size() << " vclasses." << endl;
for (int i = 0; i < vclasses.size(); i++) {
for (unsigned int i = 0; i < vclasses.size(); i++) {
isOk &= populate_vclass(vclasses[i], vg);
}
return isOk;
......@@ -777,7 +780,7 @@ DOMElement* appendChildTagWithData (DOMElement* parent,
string generate_virtualNodeId (string virtual_id)
{
std:ostringstream oss;
std::ostringstream oss;
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);
......@@ -787,7 +790,7 @@ string generate_virtualNodeId (string virtual_id)
string generate_virtualIfaceId (string lan_name, int interface_number)
{
std:ostringstream oss;
std::ostringstream oss;
oss << lan_name << ":" << interface_number;
return oss.str();
}
......
......@@ -28,7 +28,7 @@ rspec_parser :: rspec_parser (int type)
rspec_parser :: ~rspec_parser ()
{
free(this->emulabExtensions);
delete this->emulabExtensions;
}
struct link_interface rspec_parser :: getIface (const DOMElement* tag)
......
......@@ -99,12 +99,11 @@ rspec_parser_v2 :: readLinkCharacteristics (const DOMElement* link,
bool hasBandwidth, hasLatency, hasPacketLoss;
count = properties->getLength();
// if (count == 1) {
DOMElement* property = dynamic_cast<DOMElement*>(properties->item(0));
strBw = this->getAttribute(property, "capacity", hasBandwidth);
strLat = this->getAttribute(property, "latency", hasLatency);
strLoss = this->getAttribute(property, "packet_loss", hasPacketLoss);
// }
// Read only from the first property and ignore the rest
DOMElement* property = dynamic_cast<DOMElement*>(properties->item(0));
strBw = this->getAttribute(property, "capacity", hasBandwidth);
strLat = this->getAttribute(property, "latency", hasLatency);
strLoss = this->getAttribute(property, "packet_loss", hasPacketLoss);
int bandwidth = 0, latency = 0;
float packetLoss = 0.0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment