From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Iqspx-000386-GK for mharc-grub-devel@gnu.org; Sat, 10 Nov 2007 11:05:33 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iqspv-000366-Rc for grub-devel@gnu.org; Sat, 10 Nov 2007 11:05:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iqspr-000312-8l for grub-devel@gnu.org; Sat, 10 Nov 2007 11:05:31 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iqspq-00030p-WD for grub-devel@gnu.org; Sat, 10 Nov 2007 11:05:27 -0500 Received: from smtp-vbr4.xs4all.nl ([194.109.24.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iqspq-0000mX-Eg for grub-devel@gnu.org; Sat, 10 Nov 2007 11:05:26 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr4.xs4all.nl (8.13.8/8.13.8) with ESMTP id lAAG5NFu090132 for ; Sat, 10 Nov 2007 17:05:24 +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> <87bqa3jezk.fsf@xs4all.nl> <20071109212508.GE23437@thorin> Mail-Copies-To: mgerards@xs4all.nl Date: Sat, 10 Nov 2007 17:05:57 +0100 In-Reply-To: <20071109212508.GE23437@thorin> (Robert Millan's message of "Fri, 9 Nov 2007 22:25:08 +0100") Message-ID: <87mytmgk62.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: Sat, 10 Nov 2007 16:05:32 -0000 Robert Millan writes: > On Fri, Nov 09, 2007 at 10:17:19PM +0100, Marco Gerards wrote: >> 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. > > Still seems like an ugly hack to me. Oh well :-/ It isn't. The driver gets a string that it can use to determine if it has control over this disk or not. `grub_disk_t disk' is there to be filled in if it has, it isn't initialised yet. -- Marco