Need for KEXEC_PRESERVE_CONTEXT flag ?

Indraneel Mukherjee indro.ml at gmail.com
Sun Jun 21 14:54:05 EDT 2009


On Sun, Jun 21, 2009 at 10:47 PM, Neil Horman <nhorman at redhat.com> wrote:

> On Fri, Jun 19, 2009 at 12:00:44PM +0530, Indraneel Mukherjee wrote:
> > Hi,
> >
> > The file kernel/kexec.c (~ line 1001 in linux-2.6.30) has this code
> >
> > ------snip----
> >
> >  if (flags & KEXEC_PRESERVE_CONTEXT)
> >             image->preserve_context = 1;
> >
> > ------snip----
> >
> > Will this ever be true? The flag KEXEC_PRESERVE_CONTEXT is not even
> defined
> > in kexec-tools-2.0.0.
> >
> > Consequently, all the code inside the condition
>  if(image->preserve_context)
> >   is also useless?
> >
> > Am i missing something here?
> >
> Yes, the code you're looking at in the first definition is part of the
> kernel,
> while you're looking for the definition of KEXEC_PRESERVE_CONTEXT in the
> kexec-tools userspace code.  You need to look for the definition of
> KEXEC_PRESERVE_CONTEXT in the kernel code (you'll find it in
> include/linux/kexec.h).


I've seen that bit.  I was only trying to understand that code & figure out
when does it ever gets executed. My guess is that kexec-tools is the only
user of all the code in kernel/kexec.c. So, i started wondering if
kexec-tools never sets the flag KEXEC_PRESERVE_CONTEXT, then why was that
code even written?
Ans that means we've got some untested code in the kernel :) ?

Regards,
Indro



 kexec-tools might use it one day, but not using it
> doesn't mean we should remove it from the kernel.
>

>
> Neil
>
> > Regards,
> > Indro
>
> > _______________________________________________
> > kexec mailing list
> > kexec at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/kexec
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20090622/67c17dc5/attachment.html>


More information about the kexec mailing list