VirtualBox

Changeset 54671 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 6, 2015 4:55:29 PM (10 years ago)
Author:
vboxsync
Message:

NAT networks: don't kill VBoxNetDHCP and VBoxNetNAT but send the INATNetworkStartStop event to ask them politely to shutdown

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/NetworkServiceRunner.cpp

    r50213 r54671  
    117117        return VINF_OBJECT_DESTROYED;
    118118
    119     int rc = RTProcTerminate(m->mProcess);
    120     RTProcWait(m->mProcess, RTPROCWAIT_FLAGS_BLOCK, NULL);
    121119    m->mProcess = NIL_RTPROCESS;
    122     return rc;
     120    return VINF_SUCCESS;
    123121}
    124122
  • trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp

    r54504 r54671  
    519519    ComEventTypeArray aVBoxEvents;
    520520    aVBoxEvents.push_back(VBoxEventType_OnHostNameResolutionConfigurationChange);
     521    aVBoxEvents.push_back(VBoxEventType_OnNATNetworkStartStop);
    521522    rc = createNatListener(m_vboxListener, virtualbox, this, aVBoxEvents);
    522523    AssertRCReturn(rc, rc);
     
    596597            fetchAndUpdateDnsInfo();
    597598            break;
     599
     600        case VBoxEventType_OnNATNetworkStartStop:
     601        {
     602            ComPtr <INATNetworkStartStopEvent> pStartStopEvent = pEvent;
     603            BOOL fStart = TRUE;
     604            HRESULT hrc = pStartStopEvent->COMGETTER(StartEvent)(&fStart);
     605            if (!fStart)
     606                shutdown();
     607            break;
     608        }
    598609    }
    599610
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r50494 r54671  
    389389            break;
    390390        }
     391
     392        case VBoxEventType_OnNATNetworkStartStop:
     393        {
     394            ComPtr <INATNetworkStartStopEvent> pStartStopEvent = pEvent;
     395            BOOL fStart = TRUE;
     396            hrc = pStartStopEvent->COMGETTER(StartEvent)(&fStart);
     397            if (!fStart)
     398                shutdown();
     399            break;
     400        }
    391401    }
    392402    return hrc;
     
    784794    ComEventTypeArray aVBoxEvents;
    785795    aVBoxEvents.push_back(VBoxEventType_OnHostNameResolutionConfigurationChange);
     796    aVBoxEvents.push_back(VBoxEventType_OnNATNetworkStartStop);
    786797    rc = createNatListener(m_vboxListener, virtualbox, this, aVBoxEvents);
    787798    AssertRCReturn(rc, rc);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette