[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/4] kexec/xen: directly load images images into Xen



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@xxxxxxxxxx>
>>
>> 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@xxxxxxxxxx>
> 
> [...]
> 
>> --- /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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.