diff options
author | Micael Karlberg <[email protected]> | 2010-03-02 10:20:45 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-03-02 10:20:45 +0000 |
commit | 4ce2c1bd3ed90e6f1c208b4749ee33ae4ee9d723 (patch) | |
tree | 3fda614a8776f47ea56338513040bed107eb41d7 /lib/snmp/src/manager/snmpm_net_if.erl | |
parent | 72fbfd173f2f60bb1b12f826adf41ad9f8fa255e (diff) | |
download | otp-4ce2c1bd3ed90e6f1c208b4749ee33ae4ee9d723.tar.gz otp-4ce2c1bd3ed90e6f1c208b4749ee33ae4ee9d723.tar.bz2 otp-4ce2c1bd3ed90e6f1c208b4749ee33ae4ee9d723.zip |
Merge from dev branch: OTP-8480 & OTP-8481.
Diffstat (limited to 'lib/snmp/src/manager/snmpm_net_if.erl')
-rw-r--r-- | lib/snmp/src/manager/snmpm_net_if.erl | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/lib/snmp/src/manager/snmpm_net_if.erl b/lib/snmp/src/manager/snmpm_net_if.erl index ad39157721..07156dacd9 100644 --- a/lib/snmp/src/manager/snmpm_net_if.erl +++ b/lib/snmp/src/manager/snmpm_net_if.erl @@ -441,7 +441,7 @@ handle_info(Info, State) -> %% Returns: any (ignored by gen_server) %%-------------------------------------------------------------------- terminate(Reason, #state{log = Log, irgc = IrGcRef}) -> - ?vdebug("terminate: ~p",[Reason]), + ?vdebug("terminate: ~p", [Reason]), irgc_stop(IrGcRef), %% Close logs do_close_log(Log), @@ -462,22 +462,59 @@ do_close_log(_) -> %% Returns: {ok, NewState} %%---------------------------------------------------------------------- +code_change({down, _Vsn}, OldState, downgrade_to_pre_4_14) -> + ?d("code_change(down, downgrade_to_pre_4_14) -> entry with" + "~n OldState: ~p", [OldState]), + #state{server = Server, + note_store = NoteStore, + sock = Sock, + mpd_state = MpdState, + log = {OldLog, Type}, + irb = IRB, + irgc = IRGC} = OldState, + NewLog = snmp_log:downgrade(OldLog), + State = + {state, Server, NoteStore, Sock, MpdState, {NewLog, Type}, IRB, IRGC}, + {ok, State}; + code_change({down, _Vsn}, OldState, downgrade_to_pre_4_16) -> - ?d("code_change(down) -> entry", []), + ?d("code_change(down, downgrade_to_pre_4_16) -> entry with" + "~n OldState: ~p", [OldState]), {OldLog, Type} = OldState#state.log, NewLog = snmp_log:downgrade(OldLog), State = OldState#state{log = {NewLog, Type}}, {ok, State}; % upgrade +code_change(_Vsn, OldState, upgrade_from_pre_4_14) -> + ?d("code_change(up, upgrade_from_pre_4_14) -> entry with" + "~n OldState: ~p", [OldState]), + {state, Server, NoteStore, Sock, MpdState, {OldLog, Type}, IRB, IRGC} = + OldState, + NewLog = snmp_log:upgrade(OldLog), + State = #state{server = Server, + note_store = NoteStore, + sock = Sock, + mpd_state = MpdState, + log = {NewLog, Type}, + irb = IRB, + irgc = IRGC, + filter = ?DEFAULT_FILTER_MODULE}, + {ok, State}; + code_change(_Vsn, OldState, upgrade_from_pre_4_16) -> - ?d("code_change(up) -> entry", []), + ?d("code_change(up, upgrade_from_pre_4_16) -> entry with" + "~n OldState: ~p", [OldState]), {OldLog, Type} = OldState#state.log, NewLog = snmp_log:upgrade(OldLog), State = OldState#state{log = {NewLog, Type}}, {ok, State}; code_change(_Vsn, State, _Extra) -> + ?d("code_change -> entry with" + "~n Vsn: ~p" + "~n State: ~p" + "~n Extra: ~p", [_Vsn, State, _Extra]), {ok, State}. |