direct-io.hg

changeset 15265:634b7f7f8584

[IA64] When a domU is destroyed, it will fall into NVRAM saving
path. But if there is no NVRAM file for the domU, the save operation
would fail. Then domU blocked by Xend's exception. This patch fixs
that issue.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
author kfraser@localhost.localdomain
date Tue Jun 12 11:32:03 2007 +0100 (2007-06-12)
parents e1c54c14220a
children b515e66234e8
files tools/libxc/ia64/xc_ia64_hvm_build.c
line diff
     1.1 --- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Tue Jun 12 11:29:27 2007 +0100
     1.2 +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Tue Jun 12 11:32:03 2007 +0100
     1.3 @@ -712,11 +712,15 @@ int xc_ia64_save_to_nvram(int xc_handle,
     1.4  	xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
     1.5  
     1.6  	if ( !IS_VALID_NVRAM_FD(nvram_fd) )
     1.7 -	{
     1.8  		PERROR("Nvram not be initialized. Nvram save fail!\n");
     1.9 -		return -1;
    1.10 -	}
    1.11 -	return copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd);	
    1.12 +	else
    1.13 +		copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd);	
    1.14 +	
    1.15 +	// although save to nvram maybe fail, we don't return any error number
    1.16 +	// to Xend. This is quite logical because damage of NVRAM on native would 
    1.17 +	// not block OS's executive path. Return error number will cause an exception 
    1.18 +	// of Xend and block XenU when it destroy.
    1.19 +	return 0;
    1.20  }
    1.21  
    1.22  #define NVRAM_FILE_PATH	"/usr/lib/xen/boot/nvram_"
    1.23 @@ -862,7 +866,10 @@ setup_guest(int xc_handle, uint32_t dom,
    1.24  		nvram_start = 0;
    1.25  	else
    1.26  		if ( copy_from_nvram_to_GFW(xc_handle, dom, (int)nvram_fd ) == -1 )
    1.27 +		{
    1.28  			nvram_start = 0;
    1.29 +			close(nvram_fd);
    1.30 +		}
    1.31  
    1.32      vcpus = domctl.u.getdomaininfo.max_vcpu_id + 1;
    1.33