ia64/xen-unstable

changeset 5333:fa735bb2f79a

bitkeeper revision 1.1681 (42a4172fYhXBx6d4aXa2ofB5qVB2Ww)

xc_gnttab.c, xc_evtchn.c:
Cleanup error message printing and error exit code path.
xc_vmx_build.c, xc_private.c, xc_plan9_build.c, xc_linux_build.c:
Cleanup error message printing.
Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon Jun 06 09:28:15 2005 +0000 (2005-06-06)
parents 02d4d4ab41ce
children 4736c86802ad
files tools/libxc/xc_evtchn.c tools/libxc/xc_gnttab.c tools/libxc/xc_linux_build.c tools/libxc/xc_plan9_build.c tools/libxc/xc_private.c tools/libxc/xc_vmx_build.c
line diff
     1.1 --- a/tools/libxc/xc_evtchn.c	Mon Jun 06 08:57:47 2005 +0000
     1.2 +++ b/tools/libxc/xc_evtchn.c	Mon Jun 06 09:28:15 2005 +0000
     1.3 @@ -19,15 +19,16 @@ static int do_evtchn_op(int xc_handle, e
     1.4  
     1.5      if ( mlock(op, sizeof(*op)) != 0 )
     1.6      {
     1.7 -        PERROR("Could not lock memory for Xen hypercall");
     1.8 -        goto out1;
     1.9 +        PERROR("do_evtchn_op: op mlock failed");
    1.10 +        goto out;
    1.11      }
    1.12  
    1.13 -    if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 )
    1.14 -        goto out2;
    1.15 +    if ((ret = do_xen_hypercall(xc_handle, &hypercall)) < 0)
    1.16 +        ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret);
    1.17  
    1.18 - out2: (void)munlock(op, sizeof(*op));
    1.19 - out1: return ret;
    1.20 +    (void)munlock(op, sizeof(*op));
    1.21 + out:
    1.22 +    return ret;
    1.23  }
    1.24  
    1.25  
     2.1 --- a/tools/libxc/xc_gnttab.c	Mon Jun 06 08:57:47 2005 +0000
     2.2 +++ b/tools/libxc/xc_gnttab.c	Mon Jun 06 09:28:15 2005 +0000
     2.3 @@ -26,18 +26,16 @@ do_gnttab_op( int xc_handle,
     2.4  
     2.5      if ( mlock(op, sizeof(*op)) != 0 )
     2.6      {
     2.7 -        PERROR("Could not lock memory for Xen hypercall");
     2.8 -        goto out1;
     2.9 +        PERROR("do_gnttab_op: op mlock failed");
    2.10 +        goto out;
    2.11      }
    2.12  
    2.13      if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 )
    2.14 -    {
    2.15 -        printf("do_gnttab_op: hypercall returned error %d\n", ret);
    2.16 -        goto out2;
    2.17 -    }
    2.18 +        ERROR("do_gnttab_op: HYPERVISOR_grant_table_op failed: %d", ret);
    2.19  
    2.20 - out2: (void)munlock(op, sizeof(*op));
    2.21 - out1: return ret;
    2.22 +    (void)munlock(op, sizeof(*op));
    2.23 + out:
    2.24 +    return ret;
    2.25  }
    2.26  
    2.27  
     3.1 --- a/tools/libxc/xc_linux_build.c	Mon Jun 06 08:57:47 2005 +0000
     3.2 +++ b/tools/libxc/xc_linux_build.c	Mon Jun 06 09:28:15 2005 +0000
     3.3 @@ -193,7 +193,7 @@ static int setup_guest(int xc_handle,
     3.4      }
     3.5  
     3.6      (load_funcs.loadimage)(image, image_size, xc_handle, dom, page_array,
     3.7 -			   &dsi);
     3.8 +                           &dsi);
     3.9  
    3.10      /* Load the initial ramdisk image. */
    3.11      if ( initrd_len != 0 )
    3.12 @@ -466,7 +466,7 @@ int xc_linux_build(int xc_handle,
    3.13  
    3.14      if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
    3.15      {   
    3.16 -        PERROR("Unable to mlock ctxt");
    3.17 +        PERROR("xc_linux_build: ctxt mlock failed");
    3.18          return 1;
    3.19      }
    3.20  
     4.1 --- a/tools/libxc/xc_plan9_build.c	Mon Jun 06 08:57:47 2005 +0000
     4.2 +++ b/tools/libxc/xc_plan9_build.c	Mon Jun 06 09:28:15 2005 +0000
     4.3 @@ -434,7 +434,7 @@ xc_plan9_build(int xc_handle,
     4.4  
     4.5  	DPRINTF(("xc_get_tot_pages returns %ld pages\n", tot_pages));
     4.6  	if (mlock(&st_ctxt, sizeof (st_ctxt))) {
     4.7 -		PERROR("Unable to mlock ctxt");
     4.8 +		PERROR("xc_plan9_build: ctxt mlock failed");
     4.9  		return 1;
    4.10  	}
    4.11  
     5.1 --- a/tools/libxc/xc_private.c	Mon Jun 06 08:57:47 2005 +0000
     5.2 +++ b/tools/libxc/xc_private.c	Mon Jun 06 09:28:15 2005 +0000
     5.3 @@ -122,7 +122,7 @@ static int flush_mmu_updates(int xc_hand
     5.4  
     5.5      if ( mlock(mmu->updates, sizeof(mmu->updates)) != 0 )
     5.6      {
     5.7 -        PERROR("Could not lock pagetable update array");
     5.8 +        PERROR("flush_mmu_updates: mmu updates mlock failed");
     5.9          err = 1;
    5.10          goto out;
    5.11      }
    5.12 @@ -226,7 +226,7 @@ int xc_get_pfn_list(int xc_handle,
    5.13  
    5.14      if ( mlock(pfn_buf, max_pfns * sizeof(unsigned long)) != 0 )
    5.15      {
    5.16 -        PERROR("Could not lock pfn list buffer");
    5.17 +        PERROR("xc_get_pfn_list: pfn_buf mlock failed");
    5.18          return -1;
    5.19      }    
    5.20  
     6.1 --- a/tools/libxc/xc_vmx_build.c	Mon Jun 06 08:57:47 2005 +0000
     6.2 +++ b/tools/libxc/xc_vmx_build.c	Mon Jun 06 09:28:15 2005 +0000
     6.3 @@ -529,7 +529,7 @@ int xc_vmx_build(int xc_handle,
     6.4  
     6.5      if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
     6.6      {   
     6.7 -        PERROR("Unable to mlock ctxt");
     6.8 +        PERROR("xc_vmx_build: ctxt mlock failed");
     6.9          return 1;
    6.10      }
    6.11