# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1287417157 -3600
# Node ID ffe0cdb77a7b3c90bf91d6db4559e6f29b201c3b
# Parent 490b7420deba4de382559d2bee3b881caa4c4f21
libxc: remove unnecessary double indirection from xc_readconsolering
The double indirection has been unnecessary since 9867:ec61a8c25429,
there is no possibility of the buffer being reallocated now.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
tools/console/daemon/io.c | 2 +-
tools/libxc/xc_misc.c | 3 +--
tools/libxc/xenctrl.h | 2 +-
tools/libxl/libxl.c | 2 +-
tools/python/xen/lowlevel/xc/xc.c | 4 ++--
5 files changed, 6 insertions(+), 7 deletions(-)
diff -r 490b7420deba -r ffe0cdb77a7b tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Mon Oct 18 16:43:58 2010 +0100
+++ b/tools/console/daemon/io.c Mon Oct 18 16:52:37 2010 +0100
@@ -887,7 +887,7 @@ static void handle_hv_logs(void)
if ((port = xc_evtchn_pending(xce_handle)) == -1)
return;
- if (xc_readconsolering(xch, &bufptr, &size, 0, 1, &index) == 0 && size
> 0) {
+ if (xc_readconsolering(xch, bufptr, &size, 0, 1, &index) == 0 && size >
0) {
int logret;
if (log_time_hv)
logret = write_with_timestamp(log_hv_fd, buffer, size,
diff -r 490b7420deba -r ffe0cdb77a7b tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c Mon Oct 18 16:43:58 2010 +0100
+++ b/tools/libxc/xc_misc.c Mon Oct 18 16:52:37 2010 +0100
@@ -22,13 +22,12 @@
#include <xen/hvm/hvm_op.h>
int xc_readconsolering(xc_interface *xch,
- char **pbuffer,
+ char *buffer,
unsigned int *pnr_chars,
int clear, int incremental, uint32_t *pindex)
{
int ret;
DECLARE_SYSCTL;
- char *buffer = *pbuffer;
unsigned int nr_chars = *pnr_chars;
sysctl.cmd = XEN_SYSCTL_readconsole;
diff -r 490b7420deba -r ffe0cdb77a7b tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Mon Oct 18 16:43:58 2010 +0100
+++ b/tools/libxc/xenctrl.h Mon Oct 18 16:52:37 2010 +0100
@@ -729,7 +729,7 @@ int xc_physdev_pci_access_modify(xc_inte
int enable);
int xc_readconsolering(xc_interface *xch,
- char **pbuffer,
+ char *buffer,
unsigned int *pnr_chars,
int clear, int incremental, uint32_t *pindex);
diff -r 490b7420deba -r ffe0cdb77a7b tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Mon Oct 18 16:43:58 2010 +0100
+++ b/tools/libxl/libxl.c Mon Oct 18 16:52:37 2010 +0100
@@ -3464,7 +3464,7 @@ int libxl_xen_console_read_line(libxl_ct
int ret;
memset(cr->buffer, 0, cr->size);
- ret = xc_readconsolering(ctx->xch, &cr->buffer, &cr->count,
+ ret = xc_readconsolering(ctx->xch, cr->buffer, &cr->count,
cr->clear, cr->incremental, &cr->index);
if (ret < 0) {
LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "reading console ring buffer");
diff -r 490b7420deba -r ffe0cdb77a7b tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Mon Oct 18 16:43:58 2010 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c Mon Oct 18 16:52:37 2010 +0100
@@ -1116,7 +1116,7 @@ static PyObject *pyxc_readconsolering(Xc
!str )
return NULL;
- ret = xc_readconsolering(self->xc_handle, &str, &count, clear,
+ ret = xc_readconsolering(self->xc_handle, str, &count, clear,
incremental, &index);
if ( ret < 0 )
return pyxc_error_to_exception(self->xc_handle);
@@ -1133,7 +1133,7 @@ static PyObject *pyxc_readconsolering(Xc
str = ptr + count;
count = size - count;
- ret = xc_readconsolering(self->xc_handle, &str, &count, clear,
+ ret = xc_readconsolering(self->xc_handle, str, &count, clear,
1, &index);
if ( ret < 0 )
break;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|