From: Vivek Goyal <vgoyal@redhat.com>
To: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>, Simon Horman <horms@verge.net.au>,
Kexec Mailing List <kexec@lists.infradead.org>,
WANG Chao <chaowang@redhat.com>
Subject: Re: [PATCH] kexec: Provide an option to use new kexec system call
Date: Mon, 18 Aug 2014 10:53:47 -0400 [thread overview]
Message-ID: <20140818145347.GC4745@redhat.com> (raw)
In-Reply-To: <20140814024629.GA12702@dhcp-16-105.nay.redhat.com>
On Thu, Aug 14, 2014 at 10:46:29AM +0800, Baoquan He wrote:
> On 08/13/14 at 11:06am, Vivek Goyal wrote:
> > +/* New file based kexec system call related code */
> > +static int do_kexec_file_load(int fileind, int argc, char **argv,
> > + unsigned long flags) {
> > +
> > + char *kernel;
>
> ........
>
> > + kernel_fd = open(kernel, O_RDONLY);
> > + if (kernel_fd == -1) {
> > + fprintf(stderr, "Failed to open file %s:%s\n", kernel,
> > + strerror(errno));
> > + return -1;
> > + }
> > +
> > + /* slurp in the input kernel */
> > + kernel_buf = slurp_decompress_file(kernel, &kernel_size);
> > +
> > + for (i = 0; i < file_types; i++) {
> > + if (file_type[i].probe(kernel_buf, kernel_size) >= 0)
> > + break;
> > + }
> > +
> > + if (i == file_types) {
> > + fprintf(stderr, "Cannot determine the file type " "of %s\n",
> > + kernel);
> > + return -1;
> > + }
> > +
> > + ret = file_type[i].load(argc, argv, kernel_buf, kernel_size, &info);
> > + if (ret < 0) {
> > + fprintf(stderr, "Cannot load %s\n", kernel);
> > + return ret;
> > + }
> > +
> > + if (!is_kexec_file_load_implemented()) {
>
> Hi Vivek,
>
> Can we put this check earlier, maybe before kernel file openning? Since
> if this syscall is not implemented, we don't have to do the opening or
> loading things.
>
Ok, will do it.
Thanks
Vivek
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
prev parent reply other threads:[~2014-08-18 14:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-13 15:06 [PATCH] kexec: Provide an option to use new kexec system call Vivek Goyal
2014-08-14 2:46 ` Baoquan He
2014-08-18 14:53 ` Vivek Goyal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140818145347.GC4745@redhat.com \
--to=vgoyal@redhat.com \
--cc=bhe@redhat.com \
--cc=chaowang@redhat.com \
--cc=dyoung@redhat.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox