From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IqbDg-0000ca-Ca for mharc-grub-devel@gnu.org; Fri, 09 Nov 2007 16:16:52 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IqbDe-0000cH-Sf for grub-devel@gnu.org; Fri, 09 Nov 2007 16:16:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IqbDd-0000bt-Ek for grub-devel@gnu.org; Fri, 09 Nov 2007 16:16:50 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IqbDd-0000bq-AQ for grub-devel@gnu.org; Fri, 09 Nov 2007 16:16:49 -0500 Received: from smtp-vbr12.xs4all.nl ([194.109.24.32]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IqbDc-00036W-TQ for grub-devel@gnu.org; Fri, 09 Nov 2007 16:16:49 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr12.xs4all.nl (8.13.8/8.13.8) with ESMTP id lA9LGl9x038925 for ; Fri, 9 Nov 2007 22:16:48 +0100 (CET) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <4720F3CA.7070804@t-online.de> <20071109205638.GB23437@thorin> Mail-Copies-To: mgerards@xs4all.nl Date: Fri, 09 Nov 2007 22:17:19 +0100 In-Reply-To: <20071109205638.GB23437@thorin> (Robert Millan's message of "Fri, 9 Nov 2007 21:56:38 +0100") Message-ID: <87bqa3jezk.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: [PATCH] Add host open devicename check X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2007 21:16:51 -0000 Robert Millan writes: > On Thu, Oct 25, 2007 at 09:51:38PM +0200, Christian Franke wrote: >> static grub_err_t >> -grub_host_open (const char *name __attribute((unused)), grub_disk_t disk) >> +grub_host_open (const char *name, grub_disk_t disk) >> { >> + if (grub_strcmp(name, "host")) >> + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk"); >> + > > I would test for (disk->id == GRUB_DISK_DEVICE_HOST_ID) instead. Faster, > and also cleaner/simpler IMHO. It's not possible unfortunately :-(. This information is about to be filled in in this same function. Besides that, you have grub_disk_dev in mind. -- Marco