device: use the REMOVED reason when unmanaging the device while quitting

With the final removal the reason of NOW_UNMANAGED causes the cleanup on the
device to be run, which downs the device:

  #0  nm_platform_link_set_down (self=0x555555a29bb0, ifindex=1711) at platform/nm-platform.c:1111
  #1  0x00005555555d6ccf in nm_device_take_down (self=self@entry=0x555555c07c70, block=block@entry=1) at devices/nm-device.c:8175
  #2  0x00005555555df0c7 in _set_state_full (self=0x555555c07c70, state=NM_DEVICE_STATE_UNMANAGED, reason=NM_DEVICE_STATE_REASON_NOW_UNMANAGED, quitting=quitting@entry=0) at devices/nm-device.c:9825
  #3  0x00005555555dfa97 in nm_device_state_changed (self=<optimized out>, state=<optimized out>, reason=<optimized out>) at devices/nm-device.c:10084
  #4  0x00005555555e472c in nm_device_set_unmanaged_flags (self=<optimized out>, flag=flag@entry=NM_UNMANAGED_INTERNAL, unmanaged=unmanaged@entry=1, reason=reason@entry=NM_DEVICE_STATE_REASON_NOW_UNMANAGED)
      at devices/nm-device.c:8745
  #5  0x00005555555e54a9 in nm_device_set_unmanaged_quitting (self=<optimized out>) at devices/nm-device.c:8806
  #6  0x000055555565b1aa in remove_device (manager=manager@entry=0x555555a4a2c0, device=0x555555c07c70, quitting=quitting@entry=1, allow_unmanage=allow_unmanage@entry=1) at nm-manager.c:833
  #7  0x0000555555660b81 in nm_manager_stop (self=0x555555a4a2c0) at nm-manager.c:4389
  #8  0x00005555555b3f9b in main (argc=1, argv=0x7fffffffdba8) at main.c:493
This commit is contained in:
Lubomir Rintel 2016-01-14 12:01:54 +01:00
parent cdc8a92b37
commit 3e2fce288a

View file

@ -8808,7 +8808,7 @@ nm_device_set_unmanaged_quitting (NMDevice *self)
nm_device_set_unmanaged_flags (self,
NM_UNMANAGED_INTERNAL,
TRUE,
NM_DEVICE_STATE_REASON_NOW_UNMANAGED);
NM_DEVICE_STATE_REASON_REMOVED);
}
/*****************************************************************************/