aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_dom_binloader.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-28 09:30:19 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-28 09:30:19 +0100
commit5cc436c1d2b3b0be3f42104582f53eec3969b43a (patch)
tree1e30ade146ee7287c486d1309b5d3d2c69a2d9b9 /tools/libxc/xc_dom_binloader.c
parent7f9a888af4b65cb8c22cea3c8295d30d0fedd623 (diff)
downloadxen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.tar.gz
xen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.tar.bz2
xen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.zip
libxc: eliminate static variables, use xentoollog; API change
This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_dom_binloader.c')
-rw-r--r--tools/libxc/xc_dom_binloader.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xc_dom_binloader.c
index e887620659..77002b49c3 100644
--- a/tools/libxc/xc_dom_binloader.c
+++ b/tools/libxc/xc_dom_binloader.c
@@ -143,20 +143,20 @@ static int xc_dom_parse_bin_kernel(struct xc_dom_image *dom)
if ( !image_info )
return -EINVAL;
- xc_dom_printf("%s: multiboot header fields\n", __FUNCTION__);
- xc_dom_printf(" flags: 0x%" PRIx32 "\n", image_info->flags);
- xc_dom_printf(" header_addr: 0x%" PRIx32 "\n", image_info->header_addr);
- xc_dom_printf(" load_addr: 0x%" PRIx32 "\n", image_info->load_addr);
- xc_dom_printf(" load_end_addr: 0x%" PRIx32 "\n", image_info->load_end_addr);
- xc_dom_printf(" bss_end_addr: 0x%" PRIx32 "\n", image_info->bss_end_addr);
- xc_dom_printf(" entry_addr: 0x%" PRIx32 "\n", image_info->entry_addr);
+ DOMPRINTF("%s: multiboot header fields", __FUNCTION__);
+ DOMPRINTF(" flags: 0x%" PRIx32 "", image_info->flags);
+ DOMPRINTF(" header_addr: 0x%" PRIx32 "", image_info->header_addr);
+ DOMPRINTF(" load_addr: 0x%" PRIx32 "", image_info->load_addr);
+ DOMPRINTF(" load_end_addr: 0x%" PRIx32 "", image_info->load_end_addr);
+ DOMPRINTF(" bss_end_addr: 0x%" PRIx32 "", image_info->bss_end_addr);
+ DOMPRINTF(" entry_addr: 0x%" PRIx32 "", image_info->entry_addr);
/* Check the flags */
if ( (image_info->flags & FLAGS_MASK) != FLAGS_REQUIRED )
{
- xc_dom_panic(XC_INVALID_KERNEL,
+ xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
"%s: xen_bin_image_table flags required "
- "0x%08" PRIx32 " found 0x%08" PRIx32 "\n",
+ "0x%08" PRIx32 " found 0x%08" PRIx32 "",
__FUNCTION__, FLAGS_REQUIRED, image_info->flags & FLAGS_MASK);
return -EINVAL;
}
@@ -166,7 +166,7 @@ static int xc_dom_parse_bin_kernel(struct xc_dom_image *dom)
((char *) image_info - image) <
(image_info->header_addr - image_info->load_addr) )
{
- xc_dom_panic(XC_INVALID_KERNEL, "%s: Invalid header_addr.",
+ xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: Invalid header_addr.",
__FUNCTION__);
return -EINVAL;
}
@@ -175,21 +175,21 @@ static int xc_dom_parse_bin_kernel(struct xc_dom_image *dom)
load_end_addr = image_info->load_end_addr ?: start_addr + image_size;
bss_end_addr = image_info->bss_end_addr ?: load_end_addr;
- xc_dom_printf("%s: calculated addresses\n", __FUNCTION__);
- xc_dom_printf(" start_addr: 0x%" PRIx32 "\n", start_addr);
- xc_dom_printf(" load_end_addr: 0x%" PRIx32 "\n", load_end_addr);
- xc_dom_printf(" bss_end_addr: 0x%" PRIx32 "\n", bss_end_addr);
+ DOMPRINTF("%s: calculated addresses", __FUNCTION__);
+ DOMPRINTF(" start_addr: 0x%" PRIx32 "", start_addr);
+ DOMPRINTF(" load_end_addr: 0x%" PRIx32 "", load_end_addr);
+ DOMPRINTF(" bss_end_addr: 0x%" PRIx32 "", bss_end_addr);
if ( (start_addr + image_size) < load_end_addr )
{
- xc_dom_panic(XC_INVALID_KERNEL, "%s: Invalid load_end_addr.\n",
+ xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: Invalid load_end_addr.",
__FUNCTION__);
return -EINVAL;
}
if ( bss_end_addr < load_end_addr)
{
- xc_dom_panic(XC_INVALID_KERNEL, "%s: Invalid bss_end_addr.\n",
+ xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: Invalid bss_end_addr.",
__FUNCTION__);
return -EINVAL;
}
@@ -217,7 +217,7 @@ static int xc_dom_parse_bin_kernel(struct xc_dom_image *dom)
dom->guest_type = "xen-3.0-x86_32";
if ( strstr(dom->xen_caps, "xen-3.0-x86_32p") )
{
- xc_dom_printf("%s: PAE fixup\n", __FUNCTION__);
+ DOMPRINTF("%s: PAE fixup", __FUNCTION__);
dom->guest_type = "xen-3.0-x86_32p";
dom->parms.pae = 2;
}
@@ -250,10 +250,10 @@ static int xc_dom_load_bin_kernel(struct xc_dom_image *dom)
text_size = load_end_addr - image_info->load_addr;
bss_size = bss_end_addr - load_end_addr;
- xc_dom_printf("%s: calculated sizes\n", __FUNCTION__);
- xc_dom_printf(" skip: 0x%" PRIx32 "\n", skip);
- xc_dom_printf(" text_size: 0x%" PRIx32 "\n", text_size);
- xc_dom_printf(" bss_size: 0x%" PRIx32 "\n", bss_size);
+ DOMPRINTF("%s: calculated sizes", __FUNCTION__);
+ DOMPRINTF(" skip: 0x%" PRIx32 "", skip);
+ DOMPRINTF(" text_size: 0x%" PRIx32 "", text_size);
+ DOMPRINTF(" bss_size: 0x%" PRIx32 "", bss_size);
dest = xc_dom_vaddr_to_ptr(dom, dom->kernel_seg.vstart);
memcpy(dest, image + skip, text_size);