debuggers.hg

changeset 22292:ffe0cdb77a7b

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@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Ian Campbell <ian.campbell@citrix.com>
date Mon Oct 18 16:52:37 2010 +0100 (2010-10-18)
parents 490b7420deba
children 7bf2ba59c737
files tools/console/daemon/io.c tools/libxc/xc_misc.c tools/libxc/xenctrl.h tools/libxl/libxl.c tools/python/xen/lowlevel/xc/xc.c
line diff
     1.1 --- a/tools/console/daemon/io.c	Mon Oct 18 16:43:58 2010 +0100
     1.2 +++ b/tools/console/daemon/io.c	Mon Oct 18 16:52:37 2010 +0100
     1.3 @@ -887,7 +887,7 @@ static void handle_hv_logs(void)
     1.4  	if ((port = xc_evtchn_pending(xce_handle)) == -1)
     1.5  		return;
     1.6  
     1.7 -	if (xc_readconsolering(xch, &bufptr, &size, 0, 1, &index) == 0 && size > 0) {
     1.8 +	if (xc_readconsolering(xch, bufptr, &size, 0, 1, &index) == 0 && size > 0) {
     1.9  		int logret;
    1.10  		if (log_time_hv)
    1.11  			logret = write_with_timestamp(log_hv_fd, buffer, size,
     2.1 --- a/tools/libxc/xc_misc.c	Mon Oct 18 16:43:58 2010 +0100
     2.2 +++ b/tools/libxc/xc_misc.c	Mon Oct 18 16:52:37 2010 +0100
     2.3 @@ -22,13 +22,12 @@
     2.4  #include <xen/hvm/hvm_op.h>
     2.5  
     2.6  int xc_readconsolering(xc_interface *xch,
     2.7 -                       char **pbuffer,
     2.8 +                       char *buffer,
     2.9                         unsigned int *pnr_chars,
    2.10                         int clear, int incremental, uint32_t *pindex)
    2.11  {
    2.12      int ret;
    2.13      DECLARE_SYSCTL;
    2.14 -    char *buffer = *pbuffer;
    2.15      unsigned int nr_chars = *pnr_chars;
    2.16  
    2.17      sysctl.cmd = XEN_SYSCTL_readconsole;
     3.1 --- a/tools/libxc/xenctrl.h	Mon Oct 18 16:43:58 2010 +0100
     3.2 +++ b/tools/libxc/xenctrl.h	Mon Oct 18 16:52:37 2010 +0100
     3.3 @@ -729,7 +729,7 @@ int xc_physdev_pci_access_modify(xc_inte
     3.4                                   int enable);
     3.5  
     3.6  int xc_readconsolering(xc_interface *xch,
     3.7 -                       char **pbuffer,
     3.8 +                       char *buffer,
     3.9                         unsigned int *pnr_chars,
    3.10                         int clear, int incremental, uint32_t *pindex);
    3.11  
     4.1 --- a/tools/libxl/libxl.c	Mon Oct 18 16:43:58 2010 +0100
     4.2 +++ b/tools/libxl/libxl.c	Mon Oct 18 16:52:37 2010 +0100
     4.3 @@ -3464,7 +3464,7 @@ int libxl_xen_console_read_line(libxl_ct
     4.4      int ret;
     4.5  
     4.6      memset(cr->buffer, 0, cr->size);
     4.7 -    ret = xc_readconsolering(ctx->xch, &cr->buffer, &cr->count,
     4.8 +    ret = xc_readconsolering(ctx->xch, cr->buffer, &cr->count,
     4.9                               cr->clear, cr->incremental, &cr->index);
    4.10      if (ret < 0) {
    4.11          LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "reading console ring buffer");
     5.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Mon Oct 18 16:43:58 2010 +0100
     5.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Mon Oct 18 16:52:37 2010 +0100
     5.3 @@ -1116,7 +1116,7 @@ static PyObject *pyxc_readconsolering(Xc
     5.4           !str )
     5.5          return NULL;
     5.6  
     5.7 -    ret = xc_readconsolering(self->xc_handle, &str, &count, clear,
     5.8 +    ret = xc_readconsolering(self->xc_handle, str, &count, clear,
     5.9                               incremental, &index);
    5.10      if ( ret < 0 )
    5.11          return pyxc_error_to_exception(self->xc_handle);
    5.12 @@ -1133,7 +1133,7 @@ static PyObject *pyxc_readconsolering(Xc
    5.13  
    5.14          str = ptr + count;
    5.15          count = size - count;
    5.16 -        ret = xc_readconsolering(self->xc_handle, &str, &count, clear,
    5.17 +        ret = xc_readconsolering(self->xc_handle, str, &count, clear,
    5.18                                   1, &index);
    5.19          if ( ret < 0 )
    5.20              break;