qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block/dmg: make it modular if using additional


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] block/dmg: make it modular if using additional library
Date: Wed, 11 Mar 2015 13:17:34 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Mar 10, 2015 at 05:38:32PM +0300, Michael Tokarev wrote:
> 10.03.2015 17:07, Kevin Wolf wrote:
> > Am 10.03.2015 um 15:01 hat Michael Tokarev geschrieben:
> []
> >> That might be useful if module loading will be modified a bit,
> >> like by loadin modules on demand only.  Something like this,
> >> search a "foo" block driver in the registered list, found ->
> >> use it, if not, try to open block-foo.so (maybe after looking
> >> in the "available" internal list before that) and look up in
> >> the registered list again.
> >>
> >> That will make it more useful.
> > 
> > The problem with that would be that format probing wouldn't work any
> > more for drivers that aren't loaded yet.
> 
> Probing needed -> run the current "load everything" sequence (maybe
> limiting stuff being loaded to "block" system when other systems
> will be there) before actual probing.  That should fix both worlds.
> 
> Alternatively, and this might be even better alternative actually,
> the more I think about it, is to have a single probe function
> which recognizes all known formats, no matter if the particular
> driver is being built or not.  This routine will be significantly
> simpler thant the combined "probe" functionality, it might know
> much more formats even if a given format is not supported, etc,
> So that format probing will be its own code which will trigger
> (attempt) to load a detected driver.

Or something like /usr/share/magic or /lib/modules/$(uname
-r)/modules.alias could be used for probing.

For example:
be32 at 0 == "QFI\xfb" load qcow2
le32 at 0 == "QED\x00" load qed
contains "version=2\n" load vmdk
contains "version=1\n" load vmdk

QEMU's probe engine matches the rules and loads appropriate modules.

Your suggestions are better though because they are simpler and less
hassle.  In any case, we can solve the probing problem.

Stefan

Attachment: pgpq5k4akuW_A.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]