aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_dom_compat_linux.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-02-24 15:30:19 +0000
committerKeir Fraser <keir@xensource.com>2007-02-24 15:30:19 +0000
commit159ce02013e3d50d3f54ce16e9ceb3bb0164b7c8 (patch)
treea8c12b077d222d9a7e37f2f867eb71a3f1a3b31e /tools/libxc/xc_dom_compat_linux.c
parente0b421d24279d3cce426c0df4bf6d8734c6ce325 (diff)
downloadxen-159ce02013e3d50d3f54ce16e9ceb3bb0164b7c8.tar.gz
xen-159ce02013e3d50d3f54ce16e9ceb3bb0164b7c8.tar.bz2
xen-159ce02013e3d50d3f54ce16e9ceb3bb0164b7c8.zip
libxc: Code format cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/libxc/xc_dom_compat_linux.c')
-rw-r--r--tools/libxc/xc_dom_compat_linux.c125
1 files changed, 67 insertions, 58 deletions
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index c387cb88fe..d19a57d6b9 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -22,103 +22,112 @@
/* ------------------------------------------------------------------------ */
static int xc_linux_build_internal(struct xc_dom_image *dom,
- int xc_handle, uint32_t domid,
- unsigned int mem_mb,
- unsigned long flags,
- unsigned int store_evtchn,
- unsigned long *store_mfn,
- unsigned int console_evtchn,
- unsigned long *console_mfn)
+ int xc_handle, uint32_t domid,
+ unsigned int mem_mb,
+ unsigned long flags,
+ unsigned int store_evtchn,
+ unsigned long *store_mfn,
+ unsigned int console_evtchn,
+ unsigned long *console_mfn)
{
int rc;
- if (0 != (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)))
- goto out;
- if (0 != (rc = xc_dom_parse_image(dom)))
- goto out;
- if (0 != (rc = xc_dom_mem_init(dom, mem_mb)))
- goto out;
- if (0 != (rc = xc_dom_boot_mem_init(dom)))
- goto out;
- if (0 != (rc = xc_dom_build_image(dom)))
- goto out;
+ if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 )
+ goto out;
+ if ( (rc = xc_dom_parse_image(dom)) != 0 )
+ goto out;
+ if ( (rc = xc_dom_mem_init(dom, mem_mb)) != 0 )
+ goto out;
+ if ( (rc = xc_dom_boot_mem_init(dom)) != 0 )
+ goto out;
+ if ( (rc = xc_dom_build_image(dom)) != 0 )
+ goto out;
dom->flags = flags;
dom->console_evtchn = console_evtchn;
dom->xenstore_evtchn = store_evtchn;
rc = xc_dom_boot_image(dom);
- if (0 != rc)
- goto out;
+ if ( rc != 0 )
+ goto out;
*console_mfn = xc_dom_p2m_host(dom, dom->console_pfn);
*store_mfn = xc_dom_p2m_host(dom, dom->xenstore_pfn);
- out:
+ out:
return rc;
}
int xc_linux_build_mem(int xc_handle, uint32_t domid,
- unsigned int mem_mb,
- const char *image_buffer,
- unsigned long image_size,
- const char *initrd,
- unsigned long initrd_len,
- const char *cmdline,
- const char *features,
- unsigned long flags,
- unsigned int store_evtchn,
- unsigned long *store_mfn,
- unsigned int console_evtchn, unsigned long *console_mfn)
+ unsigned int mem_mb,
+ const char *image_buffer,
+ unsigned long image_size,
+ const char *initrd,
+ unsigned long initrd_len,
+ const char *cmdline,
+ const char *features,
+ unsigned long flags,
+ unsigned int store_evtchn,
+ unsigned long *store_mfn,
+ unsigned int console_evtchn, unsigned long *console_mfn)
{
struct xc_dom_image *dom;
int rc;
xc_dom_loginit();
dom = xc_dom_allocate(cmdline, features);
- if (0 != (rc = xc_dom_kernel_mem(dom, image_buffer, image_size)))
- goto out;
- if (initrd)
- if (0 != (rc = xc_dom_ramdisk_mem(dom, initrd, initrd_len)))
- goto out;
+ if ( (rc = xc_dom_kernel_mem(dom, image_buffer, image_size)) != 0 )
+ goto out;
+ if ( initrd && ((rc = xc_dom_ramdisk_mem(dom, initrd, initrd_len)) != 0) )
+ goto out;
rc = xc_linux_build_internal(dom, xc_handle, domid,
- mem_mb, flags,
- store_evtchn, store_mfn,
- console_evtchn, console_mfn);
+ mem_mb, flags,
+ store_evtchn, store_mfn,
+ console_evtchn, console_mfn);
- out:
+ out:
xc_dom_release(dom);
return rc;
}
int xc_linux_build(int xc_handle, uint32_t domid,
- unsigned int mem_mb,
- const char *image_name,
- const char *initrd_name,
- const char *cmdline,
- const char *features,
- unsigned long flags,
- unsigned int store_evtchn,
- unsigned long *store_mfn,
- unsigned int console_evtchn, unsigned long *console_mfn)
+ unsigned int mem_mb,
+ const char *image_name,
+ const char *initrd_name,
+ const char *cmdline,
+ const char *features,
+ unsigned long flags,
+ unsigned int store_evtchn,
+ unsigned long *store_mfn,
+ unsigned int console_evtchn, unsigned long *console_mfn)
{
struct xc_dom_image *dom;
int rc;
xc_dom_loginit();
dom = xc_dom_allocate(cmdline, features);
- if (0 != (rc = xc_dom_kernel_file(dom, image_name)))
- goto out;
- if (initrd_name && strlen(initrd_name))
- if (0 != (rc = xc_dom_ramdisk_file(dom, initrd_name)))
- goto out;
+ if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
+ goto out;
+ if ( initrd_name && strlen(initrd_name) &&
+ ((rc = xc_dom_ramdisk_file(dom, initrd_name)) != 0) )
+ goto out;
rc = xc_linux_build_internal(dom, xc_handle, domid,
- mem_mb, flags,
- store_evtchn, store_mfn,
- console_evtchn, console_mfn);
+ mem_mb, flags,
+ store_evtchn, store_mfn,
+ console_evtchn, console_mfn);
- out:
+ out:
xc_dom_release(dom);
return rc;
}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */