zfs: Fix spa import procedure for multi-vdev pools

This patch is fixing a bug when using a ZFS pool with more than
a single vdev, i.e. blk device. In other words, it will allow
us to use a ZFS pool with multiple devices, and even add more
devices to an existent pool on-the-fly.

The root:
OSv-specific spa_import_rootpool and spa_generate_rootconf functions
are limited to a single vdev, therefore spa_root_vdev, a structure
keeping root vdev information, would not be aware of additional vdevs
available in the underlying pool.

The problem happens when vdev_mirror_map_alloc asks spa_root_vdev
for these additional vdevs.
It does so by using the function vdev_lookup_top that is intended to
return the requested vdev from spa_root_vdev, however, it will return
NULL when spa_root_vdev isn't aware of the requested vdev.
Consequently, a NULL dereference will always happen, when using a pool
with more than one vdev.

Example:
page fault outside application, addr: 0x0000000000000000
[backtrace]
...
0x00000000002f599b <vdev_config_sync+2427>
...

After investigation, I discovered that spa_import_rootpool and
spa_generate_rootconf should be fixed to generate proper information
about all the vdevs associated with the pool being imported.

Solution was to use FreeBSD-specific procedures for importing the root
pool, then all the vdev children information will be properly added into
the SPA namespace, and pools with more than a single vdev will start
working as expected.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mkfs: Automatic detection and insertion of additional vblk devices

mkfs code is changed to detect additional vblk devices, and insert
them into the vblk devices argument list for the pool creation.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
timer-set: make the assertion in expire() more verbose

This is to help us a bit in diagnosing what's happening when that
assertion fails.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Add missing backtrace line

As explained in issue #380, too often our backtrace results are bogus.

One of the problems was that very often the function itself in which the
crash happened was missing from the backtrace. It turns out that
print_backtrace() function always assumed it should ignore two frames,
for abort() which calls abort("Aborted."). However, when abort(message)
was called directly, and this was often the case, we unnecessarily
ignored one interesting frame.

So in this patch we ignore just the first frame (abort(const char*)),
and later ignore an abort() frame, but only if there is one.

Note that there are still bogus backtrace problems - this is only a
partial solution.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>