Fix build break

Change-Id: I5b7e0c0b09e97cbdc80636c4a55177a82ac5936b
Merge "Fix build break"
Add env var ANDROID_TMP to override /tmp/android location.

This is needed if there's already a /tmp/android which the current user
can't access on the system. It would prevent the emulator from starting
with a cryptic error message:

NAND: could not create temp file for system NAND disk image: Permission deniedemulator: User-config was not changed.

SDK Bug: 3154431

Change-Id: Iefe7fd6a5139da545aaef5670fb7f42d210d0edc
Merge "Add env var ANDROID_TMP to override /tmp/android location."
Update android/utils/ with misc. new features.

This introduces a few new features to android/utils/ that will
be used in later patches.

+ <android/utils/assert.h> to handle assertions
+ <android/utils/vector.h> to handle dynamic arrays
+ <android/utils/reflist.h> slightly updated (more docs)
+ <android/utils/refset.h> implements a set of pointers

Change-Id: Iebc14cfefd1c0e8aaecda9958a980d40f0be610a
Merge "Update android/utils/ with misc. new features."
Implementation of event loop abstraction.

This patch adds "android/looper.h" which provides an

abstraction for event loops:
 - android/looper-qemu.c implements it on top of the QEMU main event loop.
 - android/looper-generic.c implements it on top of an IoLooper object.

The main idea is to move the UI-related code to use the abstraction
to handle timers and asynchronous (network) i/o.

NOTE: Code compiles but has not been heavily tested.

Change-Id: Ib6820c1b9a9950dc22449a332bc1b066a07af203
Merge "Implementation of event loop abstraction."
Allow safe deletion during iteration of an ARefSet.

+ make AREFSET_FOREACH take the name of an existing type variable
  which avoids an annoying type-cast in each statement.

Change-Id: Icf9d886601a9876fa29c15eb0e60a9bf6c8ec163
Merge "Allow safe deletion during iteration of an ARefSet."
Fix generic looper implementation

+ allow looper_run() to return a value that indicates why
  it exited.

+ add looper_runWithDeadline() and looper_runWithTimeout()
  in the case where you want to run only for a limited time.

  looper_runWithTimeout(looper,0) can be used to poll the
  event state and return asap after firing all the callbacks.

+ fix iolooper_modify()

Change-Id: Iba3b0385a7fd8d90f4f3334ebf313e79267f7b3d
Introduce asynchronous operation helpers.

<android/async-utils.h> contains generic helpers to read, write
and connect to sockets.

<android/async-console.h> contains a helper class to connect
to Android console port asynchronously.

Change-Id: I5d0a49a770ad974c5d4382438d75e9eb624368d1
Parallelize -list-cores implementation.

Modify the implementation of list_cores() to perform all 16
connection requests in parallel, using a generic looper and
and asyncConsoleConnector per probed port, with a global
timeout of half a second.

This is also a demonstration of the new asynchronous helpers.

Change-Id: Ib09adf44b00d0694ec29d7ed0b26b44eef77f88a
Merge "Fix generic looper implementation"
Merge "Introduce asynchronous operation helpers."
Merge "Parallelize -list-cores implementation."
Replacement of padding with ftruncate.

Also stored some other parameters, speculatively.

Guard ftruncate and lseek against EINTR

Change-Id: I4237640318564db6c375a90415097c00e4fcafaa
Implement sock_address_list_create2 routine.

This routine takes socket address in the form of [host:]port and creates array of SockAddress for it.

Change-Id: Ib2d4c1035d109d9d3df100961c4eec728d15e485
Merge "Implement sock_address_list_create2 routine."
Separate main.c used to build the emulator from main-ui.c used to build the UI

Change-Id: I1c7baeaa8447fe1df895869bfb6b74631b765845