Received: from list by lists.gnu.org with archive (Exim 4.71) id 1U2Jrd-00072V-0x for mharc-grub-devel@gnu.org; Mon, 04 Feb 2013 06:05:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2JrZ-00071x-84 for grub-devel@gnu.org; Mon, 04 Feb 2013 06:05:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2JrW-0008Bh-Fi for grub-devel@gnu.org; Mon, 04 Feb 2013 06:05:25 -0500 Received: from mmserver.massimo-maggi.eu ([94.23.66.90]:34917 helo=mmserver.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2JrW-0008Ba-4j for grub-devel@gnu.org; Mon, 04 Feb 2013 06:05:22 -0500 Received: from [IPv6:2001:b05:f:ffff::25] (unknown [IPv6:2001:b05:f:ffff::25]) by mmserver.localdomain (Postfix) with ESMTPSA id D7B2F3C0 for ; Mon, 4 Feb 2013 12:05:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=massimo-maggi.eu; s=mmserver; t=1359975921; bh=1g8p/6n4dKQA1o0lETkWDChft5aDfmvXfL1RCUfVbfM=; h=Date:From:To:Subject:References:In-Reply-To; b=EejSWu0Veag3cyy9tCdslWJ0f2c8OYafPGO6lgqtnvCa/p9weURWyQaOMXGZDtS4g Y2sSW5qJhrc3jEjRarqbL//kwJ14eXQwBUoWIeUoCGrHeoWFj7WHFThwCnPYFZsXUw hhGIxx+UQisyCJKUIPCez6IbpJxhve9ANtdfwA/I= Message-ID: <510F96B1.6080509@massimo-maggi.eu> Date: Mon, 04 Feb 2013 12:08:33 +0100 From: Massimo Maggi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130128 Thunderbird/17.0.2 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: [PATCH 1/5] Fix reporting of RAIDZ vdevs in zfsinfo References: In-Reply-To: X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2EPNXUEMFSSFBHGDPCBDU" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 94.23.66.90 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 11:05:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2EPNXUEMFSSFBHGDPCBDU Content-Type: multipart/mixed; boundary="------------070208040701040406040102" This is a multi-part message in MIME format. --------------070208040701040406040102 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Author: Massimo Maggi --- grub-core/fs/zfs/zfsinfo.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/grub-core/fs/zfs/zfsinfo.c b/grub-core/fs/zfs/zfsinfo.c index fdb587a..c96bf21 100644 --- a/grub-core/fs/zfs/zfsinfo.c +++ b/grub-core/fs/zfs/zfsinfo.c @@ -132,21 +132,31 @@ print_vdev_info (char *nvlist, int tab) grub_free (path); return GRUB_ERR_NONE; } + char is_mirror=3D(grub_strcmp(type,VDEV_TYPE_MIRROR) =3D=3D 0); + char is_raidz=3D(grub_strcmp(type,VDEV_TYPE_RAIDZ) =3D=3D 0); - if (grub_strcmp (type, VDEV_TYPE_MIRROR) =3D=3D 0) + if (is_mirror || is_raidz) { int nelm, i; nelm =3D grub_zfs_nvlist_lookup_nvlist_array_get_nelm (nvlist, ZPOOL_CONFIG_CHILDREN); + if(is_mirror){ + grub_puts_ (N_("This VDEV is a mirror")); + } + else if(is_raidz){ + grub_uint64_t parity; + grub_zfs_nvlist_lookup_uint64(nvlist,"nparity",&parity); + grub_printf_ (N_("This VDEV is a RAIDZ%llu\n"),(unsigned long long)parity); + } print_tabs (tab); if (nelm <=3D 0) { - grub_puts_ (N_("Incorrect mirror")); + grub_puts_ (N_("Incorrect VDEV")); return GRUB_ERR_NONE; } - grub_printf_ (N_("Mirror with %d children\n"), nelm); + grub_printf_ (N_("VDEV with %d children\n"), nelm); print_state (nvlist, tab); for (i =3D 0; i < nelm; i++) { @@ -162,14 +172,14 @@ print_vdev_info (char *nvlist, int tab) total element number. And the number itself is fine, only the element isn't. */ - grub_printf_ (N_("Mirror element number %d isn't correct\n"), i);= + grub_printf_ (N_("VDEV element number %d isn't correct\n"), i); continue; } /* TRANSLATORS: it's the element carying the number %d, not total element number. This is used in enumeration "Element number 1", "Element number 2", ... */ - grub_printf_ (N_("Mirror element number %d:\n"), i); + grub_printf_ (N_("VDEV element number %d:\n"), i); print_vdev_info (child, tab + 1); grub_free (child); --=20 1.8.1.1 --------------070208040701040406040102 Content-Type: text/plain; charset=ISO-8859-1; name="Attached Message Part" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Attached Message Part" --------------070208040701040406040102-- ------enig2EPNXUEMFSSFBHGDPCBDU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRD5ayAAoJEEO073X3hHDOA2QH/Aiz8YT2M6UCeGWBfG0Q0bm3 nSu8B3qtxN2F5Sn414d3s2nZtxymLAedy9GyGjSmnAueRUht/IFNDmYuYQ5iP1Wj UKwjNFs2S4U+Hr7iOtAcLNDWzMSlziB/gd6tCGEDdGdPnPrlDtU2xsCQxDsdW1+8 BTjotJ9wv7DfMNSxYJIM+zrXgcNNj7JqKPSEg2tm6Hj3BbmsmJ6aQPoF0vO5Q8Mn ByalBnyO2Y2IHRbQ48DvMb+5KnOPum/n0evPf4DH/6W7ixHNbzItEnuiRmre3RoT zV91uljfKtjb6pSumqtpOJLMxNJjEe1qdPc/nvKojvdz5VqEJE3oZ3AGDm3b8lw= =Ni/+ -----END PGP SIGNATURE----- ------enig2EPNXUEMFSSFBHGDPCBDU--