On Mon, Jan 16, 2017 at 07:27:21PM +0000, Peter Maydell wrote:
> On 16 January 2017 at 19:25, Eduardo Habkost <ehabk...@redhat.com> wrote:
> > On Mon, Jan 16, 2017 at 10:53:07AM -0800, Alistair Francis wrote:
> >> On Sun, Jan 15, 2017 at 11:59 PM, Thomas Huth <th...@redhat.com> wrote:
> >> > But I think the users also expect the "-kernel" parameter to be working,
> >> > so I think we should add the loader code in null-machine.c anyway.
> >>
> >> I agree that uses probably expect the '-kernel' option to work as well.
> >
> > So, is it possible to write a generic load_kernel() function that
> > simply reuses the generic-loader code?
> 
> No, because users expect -kernel to actually load a Linux kernel
> (meaning with the calling conventions etc the kernel requires),
> whereas generic-loader is just "load a binary blob and start there".

I don't mean a generic function that works for all machines and
architectures, but a generic function that is good enough for
"-machine none". Isn't "load a binary blob and start there"
exactly what machine_none_load_kernel() in this patch does?

> (-kernel is arch-specific and messy and doesn't behave the same
> way on all targets either :-()

I assume this means the kernel loading code used by "-machine
none" will eventually need to call a arch-specific hook, then.
But while we don't have arch-specific hooks implemented, isn't an
implementation based on generic-loader good enough for some
cases?

-- 
Eduardo

Reply via email to