Merge branch 'hotfix-3.0.1' into develop
Remove the unneeded workaround
Use select() in main_loop
Do not leak sockets to child processes
Do not leak auxiliary /dev/null descriptors
Do not leak pipe fds to child X
Merge pull request #218 from amonakov/blocking-sockets

Use blocking sockets
Fix -Wunused-parameter warnings (Closes GH-210)

In the past, configuration functions needed argc/argv, but this is not
true these days. Get rid of it.

In sw_bbswitch.c, one could check whether the card is a nvidia one, but
bbswitch does a good job at reporting errors when detection fails, so
just ignore the info parameter.
optirun: add missing free of bbcfg (GH-210)

This also solves a -Wunused-parameter warning.
bumblebee.conf: Remove unused/ignored "Module" key

The module name is parsed from [driver-MODULENAME], the Module key
itself does not have any effect.
optirun: Set VGL_READBACK=pbo option for virtualgl

This seems to increase performance for some machines and was the default
when using Bumblebee 2.4. To reset this, simply run optirun with:

    VGL_READBACK= optirun glxspheres
xorg.conf.nvidia: Added "UseDisplayDevice" "none"

As the presence of both ConnectedMonitor and this one doesn't hurt, either on newer (>=304.22) and older (<304.22) driver, added this line to make Bumblebee working on some Kepler configurations.

This closes GH-199.
Add udev rule to prevent nvidia card from randomly waking

If a user has udev, install it in /lib/udev/rules.d (if you are a
packager) or /etc/udev/rules.d (if you are a user). (GH-144)
README: spelling, switcheroo, nvidia udev
Install 99-remove-nvidia-dev.rules, distribute and update docs
Adds a fix for two nvidia cards (similar to Optimus technology).

Now it seems to be working on a Macbook Pro 5,1 with the following VGA:
  * GeForce 9400 M (int.)
  * GeForce 9600 M GT (dis.)

Changes pci_find_gfx_by_vendor's interface so it now uses a numeric
index, to keep track of both graphic cards if they are from the same
vendor.

Besides, we now print (with LOG_DEBUG level) the PCI Bus ID of each card
and how we categorized them (discrete/integrated).
Merge pull request #260 from ssaavedra/develop

Add support for dual-nvidia setups such as MBP2009

"Early 2009 Macbook Pro 17" (MacbookPro 5,1)" which is not Optimus.
xorg.conf.nouveau: fix for not starting Xorg 1.13
scripts/upstart: change start/stop dependencies

Reported by Robin Battey
(https://lists.launchpad.net/bumblebee/msg00181.html):

    The upstart script starts on runlevel 2345, and stops on runlevel 016.
    However, the hybrid-detect task that runs upon starting lightdm (from
    the nvidia-current package in x-updates) changes the graphics settings
    in a way that, at least on this system, causes the graphical
    environment to fail. (The VT changes but you see no video, however
    from the sounds of the system it's clear that the graphical
    environment is running in some framebuffer *somewhere* just not
    attached to the screen -- I expect it's running on the wrong GPU.)
    The solution is to have the bumblebeed service start when the
    login-session-start (for the usual graphical login) and
    desktop-session-start (for those running "startx") events occur, which
    is *after* the display manager is running.
optirun: split virtualgl off

Trivial change, move code to run_virtualgl, passing argc and argv. Add
declaration for variables "r" and "exitcode" and use that in run_app. This
prepares for supporting other backends.