Changeset 34335 in vbox
- Timestamp:
- Nov 24, 2010 5:49:09 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r34330 r34335 1226 1226 PDRVINTNET pThis = PDMINS_2_DATA(pDrvIns, PDRVINTNET); 1227 1227 bool f; 1228 bool fIgnoreConnectFailure; 1228 1229 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 1229 1230 … … 1275 1276 "QuietlyIgnoreTrunkWirePromisc\0" 1276 1277 "IgnoreTrunkHostPromisc\0" 1278 "IgnoreConnectFailure\0" 1277 1279 "QuietlyIgnoreTrunkHostPromisc\0" 1278 1280 "IsService\0")) … … 1436 1438 /** @todo flags for not sending to the host and for setting the trunk-wire 1437 1439 * connection in promiscuous mode. */ 1440 1441 1442 /** @cfgm{IgnoreConnectFailure, boolean, false} 1443 * When set only raise a runtime error if we cannot connect to the internal 1444 * network. */ 1445 rc = CFGMR3QueryBoolDef(pCfg, "IgnoreConnectFailure", &fIgnoreConnectFailure, false); 1446 if (RT_FAILURE(rc)) 1447 return PDMDRV_SET_ERROR(pDrvIns, rc, 1448 N_("Configuration error: Failed to get the \"IgnoreConnectFailure\" value")); 1449 if (f) 1450 OpenReq.fFlags |= INTNET_OPEN_FLAGS_IGNORE_PROMISC; 1438 1451 1439 1452 … … 1539 1552 if (RT_FAILURE(rc)) 1540 1553 { 1541 PDMDrvHlpVMSetRuntimeError (pDrvIns, 0 /*fFlags*/, "HostIfNotConnecting", 1542 N_ ("Cannot connect to the network interface '%s'. The virtual " 1543 "network card will appear to work but the guest will not " 1544 "be able to connect. Please choose a different network in the " 1545 "network settings"), OpenReq.szTrunk); 1546 1547 return VERR_PDM_NO_ATTACHED_DRIVER; 1554 if (fIgnoreConnectFailure) 1555 { 1556 /* 1557 * During VM restore it is fatal if the network is not available because the 1558 * VM settings are locked and the user has no chance to fix network settings. 1559 * Therefore don't abort but just raise a runtime warning. 1560 */ 1561 PDMDrvHlpVMSetRuntimeError (pDrvIns, 0 /*fFlags*/, "HostIfNotConnecting", 1562 N_ ("Cannot connect to the network interface '%s'. The virtual " 1563 "network card will appear to work but the guest will not " 1564 "be able to connect. Please choose a different network in the " 1565 "network settings"), OpenReq.szTrunk); 1566 1567 return VERR_PDM_NO_ATTACHED_DRIVER; 1568 } 1569 else 1570 { 1571 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 1572 N_("Failed to open/create the internal network '%s'"), pThis->szNetwork); 1573 } 1548 1574 } 1549 1575 -
trunk/src/VBox/Main/ConsoleImpl.cpp
r34331 r34335 3874 3874 AssertRelease(pInst); 3875 3875 3876 rcRet = pThis->configNetwork(pszDevice, uInstance, uLun, aNetworkAdapter, pCfg, pLunL0, pInst, true); 3876 rcRet = pThis->configNetwork(pszDevice, uInstance, uLun, aNetworkAdapter, pCfg, pLunL0, pInst, 3877 true /*fAttachDetach*/, false /*fIgnoreConnectFailure*/); 3877 3878 3878 3879 /* -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r34331 r34335 1674 1674 * Configure the network card now 1675 1675 */ 1676 bool fIgnoreConnectFailure = pConsole->mMachineState == MachineState_Restoring; 1676 1677 rc = pConsole->configNetwork(pszAdapterName, 1677 1678 ulInstance, … … 1681 1682 pLunL0, 1682 1683 pInst, 1683 false /*fAttachDetach*/); 1684 false /*fAttachDetach*/, 1685 fIgnoreConnectFailure); 1684 1686 if (RT_FAILURE(rc)) 1685 1687 return rc; … … 3203 3205 * be attached/detached after/before 3204 3206 * configuration. 3207 * @param fIgnoreConnectFailure 3208 * True if connection failures should be ignored 3209 * (makes only sense for bridged/host-only networks). 3205 3210 * 3206 3211 * @note Locks this object for writing. … … 3213 3218 PCFGMNODE pLunL0, 3214 3219 PCFGMNODE pInst, 3215 bool fAttachDetach) 3220 bool fAttachDetach, 3221 bool fIgnoreConnectFailure) 3216 3222 { 3217 3223 AutoCaller autoCaller(this); … … 3734 3740 InsertConfigString(pCfg, "Trunk", pszTrunk); 3735 3741 InsertConfigInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); 3742 InsertConfigInteger(pCfg, "IgnoreConnectFailure", (uint64_t)fIgnoreConnectFailure); 3736 3743 char szNetwork[INTNET_MAX_NETWORK_NAME]; 3737 3744 RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s", pszHifName); … … 4051 4058 InsertConfigString(pCfg, "Trunk", pszTrunk); 4052 4059 InsertConfigString(pCfg, "Network", szNetwork); 4060 InsertConfigInteger(pCfg, "IgnoreConnectFailure", (uint64_t)fIgnoreConnectFailure); 4053 4061 networkName = Bstr(szNetwork); 4054 4062 trunkName = Bstr(pszTrunk); -
trunk/src/VBox/Main/include/ConsoleImpl.h
r34331 r34335 508 508 int configNetwork(const char *pszDevice, unsigned uInstance, unsigned uLun, 509 509 INetworkAdapter *aNetworkAdapter, PCFGMNODE pCfg, 510 PCFGMNODE pLunL0, PCFGMNODE pInst, bool fAttachDetach); 510 PCFGMNODE pLunL0, PCFGMNODE pInst, 511 bool fAttachDetach, bool fIgnoreConnectFailure); 511 512 512 513 static DECLCALLBACK(int) configGuestProperties(void *pvConsole);
Note:
See TracChangeset
for help on using the changeset viewer.