[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] raw-posix: split hdev drivers
From: |
Christoph Hellwig |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] raw-posix: split hdev drivers |
Date: |
Mon, 25 May 2009 14:33:52 +0200 |
User-agent: |
Mutt/1.3.28i |
On Mon, May 25, 2009 at 02:08:10PM +0300, Avi Kivity 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().
Yeah, we could probably do that. That means we could also move the
is_windows_drive into raw-win32.c.
> 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.
At least the /dev/cdrom name is a symbolic overload in qemu and should
always resolve to a cdrom device, if it's for some reason not present
in the host namespace we need to do similar hacks as the windows raw
driver.