Changeset 28128 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 9, 2010 8:42:36 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl2.cpp
r28111 r28128 47 47 #endif 48 48 #include <iprt/file.h> 49 50 #include <limits.h>51 49 52 50 #include <VBox/vmapi.h> … … 193 191 } 194 192 195 /* 193 /** 196 194 * Simple class for storing network boot information. 197 195 */ 198 struct BootNic { 196 struct BootNic 197 { 199 198 ULONG mInstance; 200 199 unsigned mPciDev; … … 203 202 bool operator < (const BootNic &rhs) const 204 203 { 205 int lval = mBootPrio ? mBootPrio : INT_MAX;206 int rval = rhs.mBootPrio ? rhs.mBootPrio : INT_MAX;204 ULONG lval = mBootPrio - 1; /* 0 will wrap around and get the lowest priority. */ 205 ULONG rval = rhs.mBootPrio - 1; 207 206 return lval < rval; /* Zero compares as highest number (lowest prio). */ 208 207 } … … 1468 1467 rc = CFGMR3InsertNode(pDevices, "virtio-net", &pDevVirtioNet); RC_CHECK(); 1469 1468 #endif /* VBOX_WITH_VIRTIO */ 1470 std::list<BootNic> ll Nics;1469 std::list<BootNic> llBootNics; 1471 1470 for (ULONG ulInstance = 0; ulInstance < SchemaDefs::NetworkAdapterCount; ++ulInstance) 1472 1471 { … … 1548 1547 } 1549 1548 #endif 1550 /* 1549 /* 1551 1550 * Collect information needed for network booting and add it to the list. 1552 1551 */ … … 1559 1558 hrc = networkAdapter->COMGETTER(BootPriority)(&nic.mBootPrio); H(); 1560 1559 1561 ll Nics.push_back(nic);1560 llBootNics.push_back(nic); 1562 1561 1563 1562 /* … … 1639 1638 * Build network boot information and transfer it to the BIOS. 1640 1639 */ 1641 if (pNetBootCfg && !llNics.empty()) /* NetBoot node doesn't exist for EFI! */ 1642 { 1643 llNics.sort(); /* Sort the list by boot priority. */ 1644 1645 PCFGMNODE pNetBtDevCfg; 1640 if (pNetBootCfg && !llBootNics.empty()) /* NetBoot node doesn't exist for EFI! */ 1641 { 1642 llBootNics.sort(); /* Sort the list by boot priority. */ 1643 1646 1644 char achBootIdx[] = "0"; 1647 1645 unsigned uBootIdx = 0; 1648 1646 1649 std::list<BootNic>::iterator it; 1650 1651 for (it = llNics.begin(); it != llNics.end(); ++it) 1647 for (std::list<BootNic>::iterator it = llBootNics.begin(); it != llBootNics.end(); ++it) 1652 1648 { 1653 1649 /* A NIC with priority 0 is only used if it's first in the list. */ … … 1655 1651 break; 1656 1652 1653 PCFGMNODE pNetBtDevCfg; 1657 1654 achBootIdx[0] = '0' + uBootIdx++; /* Boot device order. */ 1658 1655 rc = CFGMR3InsertNode(pNetBootCfg, achBootIdx, &pNetBtDevCfg); RC_CHECK();
Note:
See TracChangeset
for help on using the changeset viewer.