search for: xdr_uint32_t

Displaying 20 results from an estimated 21 matches for "xdr_uint32_t".

2009 Nov 25
1
[PATCH] daemon/Win32: Use xdr_u_int for PortableXDR compatibility.
...next part -------------- >From 100fc211d672da2ef0adc81f65ec9903346c6d8c Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones at redhat.com> Date: Wed, 25 Nov 2009 14:45:20 +0000 Subject: [PATCH 3/7] daemon/Win32: Use xdr_u_int for PortableXDR compatibility. PortableXDR didn't support xdr_uint32_t. xdr_u_int is the same type. --- daemon/guestfsd.c | 2 +- daemon/proto.c | 14 +++++++------- 2 files 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,...
2010 Mar 21
0
[PATCH] Mac OS X: 'xdr_uint32_t' is 'xdr_u_int32_t'
...s, logging, etc. http://et.redhat.com/~rjones/virt-top -------------- next part -------------- >From 461d036b1490e6c3bdcb5f6ae745b1ff6be7cbe1 Mon Sep 17 00:00:00 2001 From: Richard Jones <rich at koneko.home.annexia.org> Date: Sun, 21 Mar 2010 20:41:41 +0000 Subject: [PATCH] Mac OS X: 'xdr_uint32_t' is 'xdr_u_int32_t' --- src/guestfs.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index 61e9302..850264e 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -100,6 +100,10 @@ static int qemu_supports (guestfs_h *g, const char...
2017 Apr 19
4
[PATCH v2 0/2] daemon: Move the useful 'is_zero' function into common code.
v1 -> v2: The first patch is the same (the pure refactoring), but in the second patch I implement Eric Blake's suggested version. Rich.
2009 Aug 20
1
[PATCH libguestfs] daemon: diagnose socket write failure
...39;t ignore socket-write error. --- daemon/proto.c | 8 +++++--- 1 files changed, 5 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&qu...
2009 Nov 20
1
[PATCH] daemon/Win32: Use gnulib modules for first porting to Win32.
...ixed are: * No chroot on Windows. * No sync(2) call. * No posix_fallocate call. * No futimes call. * No pread call. * No custom printf format specifiers. * Quite a few problems in guestfsd.c, eg. code to run external commands. * No readlinkat call (use Gnulib {a,x}readlinkat instead?) * No xdr_uint32_t in PortableXDR. * Missing external commands. * Test it. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.re...
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 Mar 29
3
[PATCH 0/2] added filesystem_walk API
The filesystem_walk API parses the FS internals of a partition and returns a list of all the files and directories contained within. It list deleted files and directories as well. For each node, it reports its relative path, its inode and its allocation status. This is the end user API for inspecting a disk partition content. The command can handle filenames with special characters. Example
2017 Apr 19
2
[PATCH] daemon: Move the useful 'is_zero' function into common code.
...r for functions that need a root filesystem mounted. * NB. Cannot be used for FileIn functions. */ diff --git a/lib/guestfs-internal-all.h b/lib/guestfs-internal-all.h index 0c841ff67..4f7433332 100644 --- a/lib/guestfs-internal-all.h +++ b/lib/guestfs-internal-all.h @@ -89,6 +89,24 @@ #define xdr_uint32_t xdr_u_int32_t #endif +/* Return true iff the buffer is all zero bytes. + * + * Note that gcc is smart enough to optimize this properly: + * http://stackoverflow.com/questions/1493936/faster-means-of-checking-for-an-empty-buffer-in-c/1493989#1493989 + */ +static inline int +is_zero (const char *b...
2016 Mar 29
0
[PATCH 1/2] added filesystem_walk0 API
...) + 1; + + xdrmem_create(&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE); + if (!xdr_u_long(&xdr, &len)) + return -1; + if (!xdr_string(&xdr, &node_info->tsk_name, len)) + return -1; + if (!xdr_uint64_t(&xdr, &node_info->tsk_inode)) + return -1; + if (!xdr_uint32_t(&xdr, &node_info->tsk_allocated)) + return -1; + + /* Resize buffer to actual length. */ + len = xdr_getpos(&xdr); + xdr_destroy(&xdr); + if ((buf = realloc(buf, len)) == NULL) + return -1; + + /* Send serialised tsk_node out. */ + if (send_file_write(buf, len) < 0...
2016 Mar 29
0
[PATCH 1/2] added filesystem_walk API
...node *node_info) +{ + size_t len = 0; + CLEANUP_FREE char *buf = NULL; + + if (!xdr_u_long(xdrs, &len)) + return -1; + + buf = safe_malloc(g, len); + + if (!xdr_string(xdrs, &buf, len)) + return -1; + if (!xdr_uint64_t(xdrs, &node_info->tsk_inode)) + return -1; + if (!xdr_uint32_t(xdrs, &node_info->tsk_allocated)) + return -1; + + node_info->tsk_name = safe_strndup(g, buf, len); + + return 0; +} + +/* Free the nodes list. */ +static void +free_nodes(struct guestfs_tsk_node_list *nodes) +{ + uint32_t index = 0; + + for (index = 0; index < nodes->len; in...
2016 Feb 23
3
[PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.
.../guestfs-internal.h | 24 ------------------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/guestfs-internal-all.h b/src/guestfs-internal-all.h index 84b8fd6..af30e58 100644 --- a/src/guestfs-internal-all.h +++ b/src/guestfs-internal-all.h @@ -65,6 +65,32 @@ #define xdr_uint32_t xdr_u_int32_t #endif +/* Macro which compiles the regexp once when the program/library is + * loaded, and frees it when the library is unloaded. + */ +#define COMPILE_REGEXP(name,pattern,options) \ + static void compile_regexp_##name (void) __attribute__((constructor)...
2016 Apr 03
0
[PATCH v2 4/5] appliance: Added filesystem_walk command
...!xdr_int64_t (xdrs, &dirent->tsk_size)) + return -1; + + /* Deserialise filename. */ + if (!xdr_u_long (xdrs, &len)) + return -1; + buf = safe_malloc (g, len); + if (!xdr_string (xdrs, &buf, len)) + return -1; + dirent->tsk_name = safe_strndup(g, buf, len); + + if (!xdr_uint32_t (xdrs, &dirent->tsk_allocated)) + return -1; + + return 0; +} -- 2.8.0.rc3
2016 Mar 29
5
[PATCH 0/2] added filesystem_walk0 low level API
The filesystem_walk0 API parses the FS internals of a partition and returns a list of all the files and directories contained within. It list deleted files and directories as well. For each node, it reports its relative path, its inode and its allocation status. The output is serialised in XDR format and written to the given file. The command is similar to The Sleuth Kit "fls -rp
2016 Apr 03
0
[PATCH v2 3/5] daemon: Added internal_filesystem_walk command
...rn -1; + if (!xdr_int64_t (&xdr, &dirent->tsk_size)) + return -1; + + /* Serialise filename. */ + len = strlen (dirent->tsk_name) + 1; + if (!xdr_u_long (&xdr, &len)) + return -1; + if (!xdr_string (&xdr, &dirent->tsk_name, len)) + return -1; + + if (!xdr_uint32_t (&xdr, &dirent->tsk_allocated)) + return -1; + + /* Resize buffer to actual length. */ + len = xdr_getpos (&xdr); + xdr_destroy (&xdr); + buf = realloc (buf, len); + if (buf == NULL) { + fprintf (stderr, "realloc: %m"); + return -1; + } + + /* Send seria...
2016 Apr 03
7
[PATCH v2 0/5] Added filesystem_walk command
v2: - Increased the amount of collected information from the FS content. - Moved filesystem_walk0 as internal command. - Code improvement based on comments. - Adhere to project's coding style. - Better command documentation. - More robust tests. Patch ready for review, code available at: https://github.com/noxdafox/libguestfs/tree/filesystem_walk Matteo Cafasso (5): generator:
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...har *argv[]) "or on the libguestfs redhat 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...
2016 Apr 04
2
Re: [PATCH v2 3/5] daemon: Added internal_filesystem_walk command
...>tsk_size)) > + return -1; > + > + /* Serialise filename. */ > + len = strlen (dirent->tsk_name) + 1; > + if (!xdr_u_long (&xdr, &len)) > + return -1; > + if (!xdr_string (&xdr, &dirent->tsk_name, len)) > + return -1; > + > + if (!xdr_uint32_t (&xdr, &dirent->tsk_allocated)) > + return -1; > + > + /* Resize buffer to actual length. */ > + len = xdr_getpos (&xdr); > + xdr_destroy (&xdr); > + buf = realloc (buf, len); > + if (buf == NULL) { > + fprintf (stderr, "realloc: %m");...
2016 Apr 04
0
Re: [PATCH v2 3/5] daemon: Added internal_filesystem_walk command
...+ > > + /* Serialise filename. */ > > + len = strlen (dirent->tsk_name) + 1; > > + if (!xdr_u_long (&xdr, &len)) > > + return -1; > > + if (!xdr_string (&xdr, &dirent->tsk_name, len)) > > + return -1; > > + > > + if (!xdr_uint32_t (&xdr, &dirent->tsk_allocated)) > > + return -1; > > + > > + /* Resize buffer to actual length. */ > > + len = xdr_getpos (&xdr); > > + xdr_destroy (&xdr); > > + buf = realloc (buf, len); > > + if (buf == NULL) { > > + fp...
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.
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