Changeset 228
- Timestamp:
- 11/13/08 16:36:52 (8 weeks ago)
- Location:
- one/branches/DEVELOPMENT/VirtualNetworkManager
- Files:
-
- 3 modified
-
include/Attribute.h (modified) (2 diffs)
-
src/common/Attribute.cc (modified) (1 diff)
-
src/vm/VirtualMachine.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
one/branches/DEVELOPMENT/VirtualNetworkManager/include/Attribute.h
r218 r228 81 81 82 82 /** 83 * Replaces the attribute value from a string.84 */85 virtual void replace(const string& sattr) = 0;86 87 /**88 83 * Returns the attribute type 89 84 */ … … 219 214 /** 220 215 * Replace the value of the given attribute with the provided map 221 */ 222 void replace(const string& sattr); 216 */ 217 void replace(const map<string,string>& attr); 218 223 219 224 220 /** -
one/branches/DEVELOPMENT/VirtualNetworkManager/src/common/Attribute.cc
r218 r228 90 90 /* -------------------------------------------------------------------------- */ 91 91 92 void VectorAttribute::replace(const string& sattr)92 void VectorAttribute::replace(const map<string,string>& attr) 93 93 { 94 attribute_value.erase(attribute_value.begin(),attribute_value.end()); 95 96 unmarshall(sattr); 94 attribute_value = attr; 97 95 } 98 96 -
one/branches/DEVELOPMENT/VirtualNetworkManager/src/vm/VirtualMachine.cc
r227 r228 305 305 VirtualNetwork * vn; 306 306 VectorAttribute * nic; 307 308 ostringstream new_nic; 307 map<string,string> new_nic; 309 308 310 309 string ip; … … 312 311 string bridge; 313 312 string network; 313 314 ostringstream vnid; 314 315 315 316 //Set a name if the VM has not got one … … 337 338 num_nics = vm_template.get("NIC",nics); 338 339 339 for(int i=0; i<num_nics; i++, new_nic.str(""))340 for(int i=0; i<num_nics; i++,vnid.str("")) 340 341 { 342 new_nic.erase(new_nic.begin(),new_nic.end()); 343 341 344 nic = dynamic_cast<VectorAttribute * >(nics[i]); 342 345 … … 366 369 367 370 vn->unlock(); 371 372 vnid << vn->get_oid(); 373 374 new_nic.insert(make_pair("NETWORK",network)); 375 new_nic.insert(make_pair("MAC" ,mac)); 376 new_nic.insert(make_pair("BRIDGE" ,bridge)); 377 new_nic.insert(make_pair("VNID" ,vnid.str())); 378 new_nic.insert(make_pair("IP" ,ip)); 368 379 369 new_nic << "NETWORK=" << network << "," << 370 "MAC=" << mac << "," << 371 "BRIDGE=" << bridge << "," << 372 "VNID=" << vn->get_oid() << "," << 373 "IP=" << ip; 374 375 nic->replace(new_nic.str()); 380 nic->replace(new_nic); 376 381 377 382 }
