Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to wait for network on startup #11335

Merged
merged 1 commit into from Jan 4, 2017

Conversation

verybadsoldier
Copy link
Contributor

Makes Kodi wait for a network interface to become available on startup.

Description

This is a successor to #11277 which made Kodi wait for network after waking up. As requested, this PR also makes Kodi wait right on startup for a network interface.

Please review especially:

  • Is the invocation of CNetwork::WaitForNet in CApplication::Initialize at the right place? It is important to do before the database initialization I think, but should it be after g_peripherals.Initialise()?
  • The setting to configure this is powermanagement.waitfornetwork. Maybe it should better be now something like network.waitfornetwork as it is not specifc to waking up now anymore?

Motivation and Context

When using MySQL it often is a problem that the network interface is not available yet when Kodi starts and then fails to initialize the database because of the missing connection to MySQL.

How Has This Been Tested?

I started Kodi several times and observed the log outputs.

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed

@t4-ravenbird
Copy link
Contributor

Again, this is redundant functionality that is already present in the wake-on-access module - https://github.com/xbmc/xbmc/blob/master/xbmc/network/WakeOnAccess.cpp#L242
(Same situation as #11277 )
The solutions are not identical of course, but overlapping, and it is strange to reinvent the wheel instead of adapting the existing.

@verybadsoldier
Copy link
Contributor Author

In my opinion there really is not so much similarity between the two. The only overlapping functionality is that both things are waiting for some kind of network connection. But even this differs as one is waiting for an IP being able to reach another IP taking the subnet into account while the other one is just waiting for an interface being connected.

@FernetMenta FernetMenta added Type: Improvement non-breaking change which improves existing functionality v18 Leia labels Jan 3, 2017
@FernetMenta
Copy link
Contributor

I agree that this functionality here is different to wake-on-lan. There may be some duplicate or similar loc but this can be cleaned up at a later time if it really makes sense.

jenkins build this please

@FernetMenta FernetMenta merged commit 2255184 into xbmc:master Jan 4, 2017
@verybadsoldier verybadsoldier deleted the wait_net_on_startup branch January 4, 2017 11:50
@MartijnKaijser MartijnKaijser modified the milestone: L 18.0-alpha1 Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement non-breaking change which improves existing functionality v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants