|
From: | Li Guang |
Subject: | Re: [Qemu-devel] [PATCH] hw/misc/blob-loader: add a generic blob loader |
Date: | Mon, 06 Jan 2014 12:22:57 +0800 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.16) Gecko/20120421 Iceape/2.0.11 |
Peter Crosthwaite wrote:
On Mon, Jan 6, 2014 at 1:55 PM, Li Guang<address@hidden> wrote:Li Guang wrote:Paolo Bonzini wrote:Il 02/01/2014 11:51, Peter Crosthwaite ha scritto:No, please use "realize" and avoid init. This way you can use an Error* to report the error. Also, the actual load_image_targphys call probably should be done in a reset handler, not at realize time.Ok I think that settles it. The actual blobbing needs to happen at reset time. Perhaps the correct approach is to do as much as possible (file-path / address sanitsation etc) at realize time, then only the actual blob load happens at reset. Going on what Paolo said, I think for this device ::init is actually a nop.Yeah, also because init is in fact a legacy interface to realize. PaoloOk, thanks!Sorry, seems load blob at reset handler can't do the right job, while the same action can play very well at init or realize.What's the exact problem with the reset idea?
code snippet: static void blob_loader_reset(DeviceState *dev) { BlobLoaderState *s = BLOB_LOADER(dev); if (load_image_targphys(s->file, s->hwaddr, MAX_BLOB_SIZE) < 0) { error_report("can't load %s\n", s->file); exit(1); } } if it is device reset handler, no result, kernel doesn't find and parse blob, if it is called at device realize phase, it works. Thanks!
any suggestion to figure out this problem? Thanks!
[Prev in Thread] | Current Thread | [Next in Thread] |