search for: lenbuf

Displaying 15 results from an estimated 15 matches for "lenbuf".

Did you mean: evbuf
2009 Nov 25
1
[PATCH] daemon/Win32: Use xdr_u_int for PortableXDR compatibility.
...changed, 8 insertions(+), 8 deletions(-) diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 67206d0..f31f1f2 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -311,7 +311,7 @@ main (int argc, char *argv[]) XDR xdr; uint32_t len = GUESTFS_LAUNCH_FLAG; xdrmem_create (&xdr, lenbuf, sizeof lenbuf, XDR_ENCODE); - xdr_uint32_t (&xdr, &len); + xdr_u_int (&xdr, &len); if (xwrite (sock, lenbuf, sizeof lenbuf) == -1) exit (EXIT_FAILURE); diff --git a/daemon/proto.c b/daemon/proto.c index 4106d92..2231037 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @...
2009 Aug 20
1
[PATCH libguestfs] daemon: diagnose socket write failure
...insertions(+), 3 deletions(-) diff --git a/daemon/proto.c b/daemon/proto.c index 9b33902..c2dd50c 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -495,8 +495,10 @@ send_chunk (const guestfs_chunk *chunk) xdr_uint32_t (&xdr, &len); xdr_destroy (&xdr); - (void) xwrite (sock, lenbuf, 4); - (void) xwrite (sock, buf, len); + int err = (xwrite (sock, lenbuf, 4) == 0 + && xwrite (sock, buf, len) == 0 ? 0 : -1); + if (err) + fprintf (stderr, "send_chunk: write failed\n"); - return 0; + return err; } -- 1.6.4.378.g88f2f
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...hat com mailing list.\n" "\n", vmchannel); - exit (1); + exit (EXIT_FAILURE); } /* Send the magic length message which indicates that @@ -304,7 +304,7 @@ main (int argc, char *argv[]) xdr_uint32_t (&xdr, &len); if (xwrite (sock, lenbuf, sizeof lenbuf) == -1) - exit (1); + exit (EXIT_FAILURE); xdr_destroy (&xdr); @@ -312,14 +312,14 @@ main (int argc, char *argv[]) if (!dont_fork) { if (daemon (0, 1) == -1) { perror ("daemon"); - exit (1); + exit (EXIT_FAILURE); } } /* E...
2014 May 15
2
Re: guestfsd crashes when the handle is closed
...xb76fb3a8 in main_loop (_sock=_sock@entry=3) at proto.c:112* xdr = {x_op = XDR_DECODE, x_ops = 0xb753db00 <xdrmem_ops>, x_public = 0x0, x_private = 0xbba929d8 ".0", x_base = 0xbba929b0 "", x_handy = 0} buf = <optimized out> lenbuf = "\000\000\000(" len = 40 hdr = {prog = 536933877, vers = 4, proc = GUESTFS_PROC_INTERNAL_AUTOSYNC, direction = GUESTFS_DIRECTION_CALL, serial = 1192960, progress_hint = 0, optargs_bitmask = 0, status = GUESTFS_STATUS_OK} *#2 0xb76d3190 in...
2014 May 15
2
Re: guestfsd crashes when the handle is closed
Hello, So in ubuntu1204 guest This is what i got : *(gdb)* bt full * #0* 0x005a9fc0 in exit () from /lib/i386-linux-gnu/libc.so.6 No symbol table info available. * #1* 0x0805f7dd in ?? () No symbol table info available. * #2* 0x0804aedf in ?? () No symbol table info available. *#3* 0x005904d3 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6 No symbol
2009 Sep 17
1
[PATCH] 'len' should be an unsigned 32 bit int.
...n all platforms we support. --- daemon/proto.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/daemon/proto.c b/daemon/proto.c index d935ded..431f219 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -45,7 +45,7 @@ main_loop (int _sock) XDR xdr; char *buf; char lenbuf[4]; - unsigned len; + uint32_t len; struct guestfs_message_header hdr; struct timeval start_t, end_t; int64_t start_us, end_us, elapsed_us; -- 1.6.2.5
2013 Mar 07
3
[PATCH 0/3] protocol: Abstract out socket operations.
I've been taking a long hard look at the protocol layer. It has evolved over a long time without any particular direction, and the result is, to say the least, not very organized. These patches take a first step at cleaning up the mess by abstracting out socket operations from the rest of the code. The purpose of this is to allow us to slot in a different connection layer under the
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...estfs redhat com mailing list.\n" "\n"); - perror (channel); - exit (EXIT_FAILURE); + error (EXIT_FAILURE, errno, "open: %s", channel); } } } @@ -353,10 +353,8 @@ main (int argc, char *argv[]) xdrmem_create (&xdr, lenbuf, sizeof lenbuf, XDR_ENCODE); xdr_u_int (&xdr, &len); - if (xwrite (sock, lenbuf, sizeof lenbuf) == -1) { - perror ("xwrite"); - exit (EXIT_FAILURE); - } + if (xwrite (sock, lenbuf, sizeof lenbuf) == -1) + error (EXIT_FAILURE, errno, "xwrite"); xdr_d...
2013 Mar 07
4
[PATCH 0/4] Small refactorings of the protocol layer.
As the start of work to add remote support, I'm taking a close look at the protocol layer in the library. These are some small cleanups. Rich.
2016 Apr 04
0
[PATCH 2/2] Use 'error' function for fprintf followed by exit.
...p;xdr, &err)) + error (EXIT_FAILURE, 0, "failed to encode error message body"); len = xdr_getpos (&xdr); xdr_destroy (&xdr); @@ -320,14 +311,10 @@ send_error (int errnum, char *msg) xdr_u_int (&xdr, &len); xdr_destroy (&xdr); - if (xwrite (sock, lenbuf, 4) == -1) { - fprintf (stderr, "guestfsd: xwrite failed\n"); - exit (EXIT_FAILURE); - } - if (xwrite (sock, buf, len) == -1) { - fprintf (stderr, "guestfsd: xwrite failed\n"); - exit (EXIT_FAILURE); - } + if (xwrite (sock, lenbuf, 4) == -1) + error (EXIT_FAIL...
2012 Nov 20
52
[PATCH RFC] stubdom: Change vTPM shared page ABI
Since the vTPM implementations are being incorproated into Xen and possibly upstream Linux, I would like to see if this protocol change could be added before we have significant legacy implementations. If not, I still think it would be useful as either a v2 or negotiated protocol change. The current vTPM protocol is a copy of the network protocol. This was likely done for ease of implementation,
2012 Jan 24
14
[PATCH 00/14] Run the daemon under valgrind and fix resultant errors.
This patch series lets you run the daemon under valgrind. Many errors were found and fixed. With the complete series applied, valgrind doesn't show any errors.
2010 Aug 31
13
[PATCH v2] Add progress bars
This is an updated and extended version of the original patch: https://www.redhat.com/archives/libguestfs/2010-August/msg00163.html This adds OCaml and Perl bindings (both tested), support for progress bars in virt-resize, and adds progress notifications to a number of the simpler commands. Still to do is to add progress messages to more commands. There are still a few commands which would be
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames. Rich.
2016 Mar 07
2
[PATCH v2] Use less stack.
...1d376e 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -596,12 +596,19 @@ send_file_end (int cancel) static int send_chunk (const guestfs_chunk *chunk) { - char buf[GUESTFS_MAX_CHUNK_SIZE + 48]; + const size_t buf_len = GUESTFS_MAX_CHUNK_SIZE + 48; + CLEANUP_FREE char *buf = NULL; char lenbuf[4]; XDR xdr; uint32_t len; - xdrmem_create (&xdr, buf, sizeof buf, XDR_ENCODE); + buf = malloc (buf_len); + if (buf == NULL) { + perror ("malloc"); + return -1; + } + + xdrmem_create (&xdr, buf, buf_len, XDR_ENCODE); if (!xdr_guestfs_chunk (&xdr, (guestfs...