From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 03 of 18] libxc: remove unnecessary double indirection from xc_readconsolering
Date: Tue, 12 Oct 2010 15:16:21 +0100 [thread overview]
Message-ID: <a577eeeb43690b9df6be.1286892981@localhost.localdomain> (raw)
In-Reply-To: <patchbomb.1286892978@localhost.localdomain>
# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1286892401 -3600
# Node ID a577eeeb43690b9df6be4789ced815e0c8e4cf13
# Parent 29a5439889c36e72df0f0828aee8f2b002a545b9
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>
diff -r 29a5439889c3 -r a577eeeb4369 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Tue Oct 12 15:06:41 2010 +0100
+++ b/tools/console/daemon/io.c Tue Oct 12 15:06:41 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 29a5439889c3 -r a577eeeb4369 tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c Tue Oct 12 15:06:41 2010 +0100
+++ b/tools/libxc/xc_misc.c Tue Oct 12 15:06:41 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 29a5439889c3 -r a577eeeb4369 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Tue Oct 12 15:06:41 2010 +0100
+++ b/tools/libxc/xenctrl.h Tue Oct 12 15:06:41 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 29a5439889c3 -r a577eeeb4369 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Tue Oct 12 15:06:41 2010 +0100
+++ b/tools/libxl/libxl.c Tue Oct 12 15:06:41 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 29a5439889c3 -r a577eeeb4369 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Tue Oct 12 15:06:41 2010 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c Tue Oct 12 15:06:41 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;
next prev parent reply other threads:[~2010-10-12 14:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-12 14:16 [PATCH 00 of 18] libxc: preparation for hypercall buffers + random cleanups Ian Campbell
2010-10-12 14:16 ` [PATCH 01 of 18] libxc: flask: use (un)lock pages rather than open coding m(un)lock Ian Campbell
2010-10-12 14:16 ` [PATCH 02 of 18] libxc: pass an xc_interface handle to page locking functions Ian Campbell
2010-10-12 14:16 ` Ian Campbell [this message]
2010-10-12 14:16 ` [PATCH 04 of 18] libxc: use correct size of struct xen_mc Ian Campbell
2010-10-12 14:16 ` [PATCH 05 of 18] libxc: add wrappers for XENMEM {increase, decrease}_reservation and populate_physmap Ian Campbell
2010-10-12 14:16 ` [PATCH 06 of 18] libxc: add xc_domain_memory_exchange_pages to wrap XENMEM_exchange Ian Campbell
2010-10-12 14:16 ` [PATCH 07 of 18] libxc: add xc_domain_add_to_physmap to wrap XENMEM_add_to_physmap Ian Campbell
2010-10-12 14:16 ` [PATCH 08 of 18] libxc: add xc_domain_maximum_gpfn to wrap XENMEM_maximum_gpfn Ian Campbell
2010-10-12 14:16 ` [PATCH 09 of 18] libxc: add xc_machphys_mfn_list to wrap XENMEM_machphys_mfn_list Ian Campbell
2010-10-12 14:16 ` [PATCH 10 of 18] libxc: add xc_maximum_ram_page to wrap XENMEM_maximum_ram_page Ian Campbell
2010-10-12 14:16 ` [PATCH 11 of 18] libxc: update QEMU_TAG and remove compatibility macro Ian Campbell
2010-10-12 14:16 ` [PATCH 12 of 18] libxc: make xc_memory_op library private Ian Campbell
2010-10-12 14:16 ` [PATCH 13 of 18] libxc: make do_memory_op's callers responsible for locking indirect buffers Ian Campbell
2010-10-12 14:16 ` [PATCH 14 of 18] libxc: simplify performance counters API Ian Campbell
2010-10-12 14:16 ` [PATCH 15 of 18] libxc: simplify lock profiling API Ian Campbell
2010-10-12 14:16 ` [PATCH 16 of 18] libxc: drop xc_get_max_pages Ian Campbell
2010-10-12 14:16 ` [PATCH 17 of 18] libxc: do not lock VCPU context in xc_ia64_pv_recv_vcpu_context Ian Campbell
2010-10-12 14:16 ` [PATCH 18 of 18] libxc: use generic xc_get_pfn_list on ia64 Ian Campbell
2010-10-18 16:43 ` [PATCH 00 of 18] libxc: preparation for hypercall buffers + random cleanups Ian Jackson
2010-10-19 8:25 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a577eeeb43690b9df6be.1286892981@localhost.localdomain \
--to=ian.campbell@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.