UPSTREAM: bearer-qmi: use complete_connect() in in all steps of the attempt

The connect_cleanup() method takes care of cleaning up the ongoing
connect cancellables stored in the MMBearerQmi private data. Not using
it would lead to assert failures when disposing the bearer object.

  0x00007ca75b4dea3f ( - pthread_kill.c: 44)     __pthread_kill_implementation
  0x00007ca75b493c6c ( - raise.c: 26)    raise
  0x00007ca75b47f462 ( - abort.c: 79)    abort
  0x00007ca75bca4688 ( - gtestutils.c: 3450)      g_assertion_message
  0x00007ca75bca46fc ( - gtestutils.c: 3476)      g_assertion_message_expr
  0x00005785d2f5aec4 (ModemManager - mm-bearer-qmi.c: 2974)       dispose
  0x00007ca75ba4cd0b ( - gobject.c: 3891)      g_object_unref
  0x00007ca75bc7c834 ( - glist.c: 1092)   g_list_foreach
  0x00007ca75bc7c834 ( - glist.c: 246)    g_list_free_full
  0x00005785d2f071a7 (ModemManager - mm-bearer-list.c: 456)       dispose
  0x00007ca75ba4cd0b ( - gobject.c: 3891)      g_object_unref
  0x00005785d2f0cf5f (ModemManager - mm-broadband-modem.c: 13420) dispose
  0x00007ca75ba4cb6f ( - gobject.c: 1448)      g_object_run_dispose
  0x00005785d2f20ae1 (ModemManager - mm-device.c: 418)    clear_modem
  0x00005785d2f20d9d (ModemManager - mm-device.c: 461)    modem_valid
  0x00007ca75ba4820e ( - gclosure.c: 832)      g_closure_invoke
  0x00007ca75ba5cd00 ( - gsignal.c: 3812)      signal_emit_unlocked_R
  0x00007ca75ba5dd8b ( - gsignal.c: 3565)      g_signal_emit_valist
  0x00007ca75ba5e1d5 ( - gsignal.c: 3622)      g_signal_emit
  0x00007ca75ba51c6a ( - gobject.c: 1428)      g_object_dispatch_properties_changed
  0x00007ca75ba4d159 ( - gobject.c: 1552)      g_object_notify_by_spec_internal
  0x00005785d2efdf62 (ModemManager - mm-base-modem.c: 1783)       base_modem_invalid_idle
  0x00007ca75bc807a4 ( - gmain.c: 3460)   g_main_dispatch
  0x00007ca75bc807a4 ( - gmain.c: 4200)   g_main_context_dispatch
  0x00007ca75bc80ac3 ( - gmain.c: 4276)   g_main_context_iterate
  0x00007ca75bc80d41 ( - gmain.c: 4479)   g_main_loop_run
  0x00005785d2ef07df (ModemManager - main.c: 236) main
  0x00007ca75b47f6c5 ( - libc_start_call_main.h: 58)     __libc_start_call_main
  0x00007ca75b47f781 ( - libc-start.c: 389)      __libc_start_main_impl
  0x00005785d2ef0130 (ModemManager + 0x000b1130)  _start

(cherry picked from commit b4285e93888de5bbfb13e6e76333c9f750d34fa8)

TEST=CQ passes

Change-Id: I874f998981b5e8a34048edd9703c16a8aad3af6a
Reviewed-by: Eric Caruso <>
Tested-by: Aleksander Morgado <>
Commit-Queue: Aleksander Morgado <>
1 file changed
tree: d1f34dbcab1a636d52186938e596002831b9f796
  1. build-aux/
  2. cli/
  3. data/
  4. docs/
  5. examples/
  6. include/
  7. introspection/
  8. libmm-glib/
  9. libqcdm/
  10. po/
  11. src/
  12. test/
  13. tools/
  14. vapi/
  15. .editorconfig
  16. .gitignore
  17. .gitlab-ci.yml
  23. meson_options.txt
  24. NEWS
  25. OWNERS
  26. PRESUBMIT.cfg
  27. README.chromium
  30. unblocked_terms.txt


ModemManager provides a unified high level API for communicating with mobile broadband modems, regardless of the protocol used to communicate with the actual device (Generic AT, vendor-specific AT, QCDM, QMI, MBIM...).


ModemManager is a system daemon and is not meant to be used directly from the command line. However, since it provides a DBus API, it is possible to use ‘dbus-send’ commands or the new ‘mmcli’ command line interface to control it from the terminal. The devices are queried from udev and automatically updated based on hardware events, although a manual re-scan can also be requested to look for RS232 modems.


ModemManager is a DBus system bus activated service (meaning it's started automatically when a request arrives). It is written in C, using glib and gio. Several GInterfaces specify different features that the modems support, including the generic MMIfaceModem3gpp and MMIfaceModemCdma which provide basic operations for 3GPP (GSM, UMTS, LTE) or CDMA (CDMA1x, EV-DO) modems. If a given feature is not available in the modem, the specific interface will not be exported in DBus.


Plugins are loaded on startup, and must implement the MMPlugin interface. It consists of a couple of methods which tell the daemon whether the plugin supports a port and to create custom MMBroadbandModem implementations. It most likely makes sense to derive custom modem implementations from one of the generic classes and just add (or override) operations which are not standard. There are multiple fully working plugins in the plugins/ directory that can be used as an example for writing new plugins. Writing new plugins is highly encouraged! The plugin API is open for changes, so if you're writing a plugin and need to add or change some public method, feel free to suggest it!


The ModemManager and mmcli binaries are both GPLv2+. The libmm-glib library is LGPLv2+.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms, which you can find in the following link:

CoC issues may be raised to the project maintainers at the following address: