xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Simon Horman <horms@verge.net.au>, xen-devel@lists.xen.org
Subject: Re: [PATCH 4/4] kexec/xen: directly load images images into Xen
Date: Mon, 7 Oct 2013 10:36:19 +0100	[thread overview]
Message-ID: <52528093.90005@citrix.com> (raw)
In-Reply-To: <20131004213341.GI3626@debian70-amd64.local.net-space.pl>

On 04/10/13 22:33, Daniel Kiper wrote:
> On Fri, Sep 20, 2013 at 02:16:38PM +0100, David Vrabel wrote:
>> From: David Vrabel <david.vrabel@citrix.com>
>>
>> Xen 4.4 has an improvided kexec hypercall ABI that allows images to be
>> loaded and executed without any kernel involvement.  Use the API
>> provided by libxc to load images when running in a Xen guest.
>>
>> Support for loading images via the kexec_load syscall in non-upstream
>> ("classic") Xen kernels is no longer supported.
>>
>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> 
> [...]
> 
>> --- /dev/null
>> +++ b/kexec/kexec-xen.c
[...]
>> +int xen_kexec_unload(uint64_t kexec_flags)
>> +{
>> +	xc_interface *xch;
>> +	uint8_t type;
>> +	int ret;
>> +
>> +	xch = xc_interface_open(NULL, NULL, 0);
>> +	if (!xch)
>> +		return -1;
>> +
>> +	type = kexec_flags & KEXEC_TYPE_CRASH;
> 
> Why? Could not we unload normal kexec images?

This is correct but could be

  type = kexec_flags & KEXEC_TYPE_CRASH ? KEXEC_TYPE_CRASH
          : KEXEC_TYPE_DEFAULT

for clarity.

>> @@ -928,6 +938,10 @@ static int kexec_loaded(void)
>>  	char *p;
>>  	char line[3];
>>
>> +	/* No way to tell if an image is loaded under Xen, assume it is. */
>> +	if (xen_present())
>> +		return 1;
>> +
> 
> Why? I think that we should have relevant machanism to do that.

Because it's not needed.  There's no point in checking if an image a
loaded before trying to exec it because you can just try the exec and
have that fail.

I'm not going to add a sub-op for this just because one particular tool
mistakenly thinks it needs to check in advance.

David

  parent reply	other threads:[~2013-10-07  9:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 13:16 [PATCHv5 0/4] kexec-tools: add support for Xen 4.4 David Vrabel
2013-09-20 13:16 ` [PATCH 1/4] kexec/xen: require libxc from " David Vrabel
2013-09-20 13:16 ` [PATCH 2/4] kexec/xen: use libxc to get location of crash notes David Vrabel
2013-09-20 13:16 ` [PATCH 3/4] kexec/xen: switch to use xc_kexec_get_range for get_xen_vmcoreinfo David Vrabel
2013-09-20 13:16 ` [PATCH 4/4] kexec/xen: directly load images images into Xen David Vrabel
2013-10-04 21:33   ` Daniel Kiper
2013-10-06 14:55     ` Andrew Cooper
2013-10-07  7:22       ` Daniel Kiper
2013-10-07  9:36     ` David Vrabel [this message]
2013-10-07 10:46       ` Daniel Kiper
  -- strict thread matches above, loose matches on Subject: below --
2013-11-06 14:55 [PATCHv7 0/4] kexec-tools: add support for Xen 4.4 David Vrabel
2013-11-06 14:55 ` [PATCH 4/4] kexec/xen: directly load images images into Xen David Vrabel
     [not found] ` <1383749722-12091-5-git-send-email-david.vrabel@citrix.com>
2013-11-07 20:36   ` Don Slutz
2013-11-19  1:20   ` Simon Horman
     [not found]   ` <20131119012014.GC17628@verge.net.au>
2013-11-19  8:28     ` Daniel Kiper
     [not found]     ` <20131119082827.GC30799@olila.local.net-space.pl>
2013-11-19  9:19       ` Simon Horman
     [not found] <1381251574-30255-1-git-send-email-david.vrabel@citrix.com>
2013-10-08 16:59 ` David Vrabel
     [not found] <1379683127-14349-1-git-send-email-david.vrabel@citrix.com>
2013-09-20 13:18 ` David Vrabel
     [not found] <1361469460-18771-1-git-send-email-david.vrabel@citrix.com>
2013-02-21 17:57 ` David Vrabel
     [not found] ` <1361469460-18771-5-git-send-email-david.vrabel@citrix.com>
2013-03-12 11:29   ` Daniel Kiper

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=52528093.90005@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=daniel.kiper@oracle.com \
    --cc=horms@verge.net.au \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).