From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M8Y2X-0007ao-B9 for qemu-devel@nongnu.org; Mon, 25 May 2009 07:08:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M8Y2S-0007Yy-0z for qemu-devel@nongnu.org; Mon, 25 May 2009 07:08:21 -0400 Received: from [199.232.76.173] (port=58158 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8Y2R-0007Yt-V5 for qemu-devel@nongnu.org; Mon, 25 May 2009 07:08:15 -0400 Received: from mx2.redhat.com ([66.187.237.31]:41346) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M8Y2R-0002lx-Do for qemu-devel@nongnu.org; Mon, 25 May 2009 07:08:15 -0400 Message-ID: <4A1A7C1A.9050406@redhat.com> Date: Mon, 25 May 2009 14:08:10 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 3/4] raw-posix: split hdev drivers References: <20090525075949.GC2936@lst.de> In-Reply-To: <20090525075949.GC2936@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Christoph Hellwig wrote: > Instead of declaring one BlockDriver for all host devices declared one > for each type: a generic one for normal disk devices, a Linux floppy > driver and a CDROM driver for Linux and FreeBSD. This gets rid of a lot > of messy ifdefs and switching based on the type in the various removal > device methods. > > block.c grows a new method to find the correct host device driver based > on OS-sepcific criteria. I would love to move this into some OS-dependant > file but I don't think we have a place where it fits nicely yet. > > Add a ->probe_host_device() which accepts the filename (or maybe an fd) as a parameter. First pass does a ->probe_host_device() for all drivers that support it, second pass tries ->probe(). btw, ->probe_host_device() should use ioctls to identify the device, not the device name, which is controlled by udev (on Linux) and therefore nonstandard. -- error compiling committee.c: too many arguments to function