diff options
author | avg <avg@FreeBSD.org> | 2012-10-06 19:25:40 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2012-10-06 19:25:40 +0000 |
commit | e94fd6dd0bd4747f0f1cc7da1ee1c718aee4a146 (patch) | |
tree | e351a317091dcf1c1c01982160a44f593bdcef3e | |
parent | 457ded9997f94bfa47db9f77bed1c32d3c6fee00 (diff) | |
download | FreeBSD-src-e94fd6dd0bd4747f0f1cc7da1ee1c718aee4a146.zip FreeBSD-src-e94fd6dd0bd4747f0f1cc7da1ee1c718aee4a146.tar.gz |
zfs boot: chose a "first" pool if none is explicitly requested
MFC after: 8 days
-rw-r--r-- | sys/boot/zfs/zfs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c index 6c964b0..eb8833f 100644 --- a/sys/boot/zfs/zfs.c +++ b/sys/boot/zfs/zfs.c @@ -513,7 +513,10 @@ zfs_dev_open(struct open_file *f, ...) dev = va_arg(args, struct zfs_devdesc *); va_end(args); - spa = spa_find_by_guid(dev->pool_guid); + if (dev->pool_guid == 0) + spa = STAILQ_FIRST(&zfs_pools); + else + spa = spa_find_by_guid(dev->pool_guid); if (!spa) return (ENXIO); rv = zfs_spa_init(spa); @@ -627,7 +630,10 @@ zfs_fmtdev(void *vdev) if (dev->d_type != DEVT_ZFS) return (buf); - spa = spa_find_by_guid(dev->pool_guid); + if (dev->pool_guid == 0) + spa = STAILQ_FIRST(&zfs_pools); + else + spa = spa_find_by_guid(dev->pool_guid); if (spa == NULL) { printf("ZFS: can't find pool by guid\n"); return (buf); |