[libnbd PATCH] maint: Add git.orderfile
by Eric Blake
Borrow an idea from nbdkit (in turn borrowed from qemu) on making
patches easier to review by sorting diffs based on filename.
---
We can tweak this order if desired, but the order presented here
made enough sense to me.
Makefile.am | 1 +
scripts/git.orderfile | 58 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
create mode 100644 scripts/git.orderfile
diff --git a/Makefile.am b/Makefile.am
index b6cb8fe..588d505 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST = \
.dir-locals.el \
.gitignore \
html/pod.css \
+ scripts/git.orderfile \
$(NULL)
SUBDIRS = \
diff --git a/scripts/git.orderfile b/scripts/git.orderfile
new file mode 100644
index 0000000..261e171
--- /dev/null
+++ b/scripts/git.orderfile
@@ -0,0 +1,58 @@
+# nbd client library in userspace
+# Copyright (C) 2013-2019 Red Hat Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# You can use this to change the ordering of files within patches to
+# make them easier to follow.
+#
+# Use:
+# git diff -O scripts/git.orderfile
+#
+# Or make the change permanently by doing:
+# git config diff.orderFile scripts/git.orderfile
+
+# Documentation.
+docs/*
+*.pod
+
+# Build files.
+configure.ac
+Makefile.am
+
+# Source header files.
+lib/*.h
+common/*.h
+common/*/*.h
+
+# Generator files.
+generator/generator
+generator/*
+
+# Source files.
+lib/*.c
+lib/*
+common/*
+
+# Language bindings.
+python/*
+ocaml/*
+
+# Tests.
+tests/*
+examples/*
+interop/*
+
+# Anything else last.
--
2.20.1
5 years, 4 months
[PATCH libnbd] lib: Kill subprocess in nbd_close.
by Richard W.M. Jones
This is a simple patch which stops nbd_close from waiting too long for
a server subprocess to shut down.
I wanted to send SIGHUP because the server will be able to catch it
and do a clean shutdown if that is required. Is another signal
better?
Is it right to send a signal here?
Rich.
5 years, 4 months
[PATCH libnbd v3 0/2] lib: Implement closure lifetimes.
by Richard W.M. Jones
I think I've addressed everything that was raised in review.
Some of the highlights:
- Callbacks should be freed reliably along all exit paths.
- There's a simple test of closure lifetimes.
- I've tried to use VALID|FREE in all the places where I'm confident
that it's safe and correct to do. There may be more places. Note
this is an optimization and shouldn't affect correctness.
- It's a bit difficult to use VALID|FREE when freeing the debug
callback (because context is not easily available) so I didn't make
that change.
Rich.
5 years, 4 months
[libnbd PATCH] docs: Mention that nbd_close is not thread-safe
by Eric Blake
Closing the handle in one thread while another thread is locked causes
undefined behavior (as closing does not obtain a lock, and can cause
use-after-free or other nasty problems to the thread that does own the
lock). However, it is not sensible to try and obtain a lock in
nbd_close, as POSIX says that it is also undefined for any other
thread to wait on a mutex that has already been destroyed. Therefore,
we don't need to change our code, but merely remind users that
nbd_close is not safe until all other uses of the handle have ceased.
---
generator/generator | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/generator/generator b/generator/generator
index 896ad2a..bdd8fd7 100755
--- a/generator/generator
+++ b/generator/generator
@@ -3532,7 +3532,8 @@ for how to get further details of the error.
Closes the handle and frees any associated resources. The final
status of any command that has not been retired (whether by
C<nbd_aio_command_completed> or by a low-level completion callback
-returning C<1>) is lost.
+returning C<1>) is lost. This function is not safe to call while
+any other thread is still using any C<nbd_*> API on the same handle.
=head1 GETTING THE LATEST ERROR MESSAGE IN THE THREAD
--
2.20.1
5 years, 4 months
[libnbd PATCH] api: Allow completion callbacks to auto-retire
by Eric Blake
When using the nbd_aio_FOO_callback commands, there is nothing further
to be learned about the command by calling nbd_aio_command_completed()
compared to what the callback already had access to. There are still
scenarios where manually retiring the command after the fact is useful
(whether the return was 0 to keep the status unchanged, or -1 to alter
the retirement status to *error), but by allowing a return value of 1,
we can reduce the number of API calls required. We can also
auto-retire the lone NBD_CMD_DISC request, reducing the amount of
special casing in nbd_aio_[peek_]command_completed.
Note that although this is not an API change, it does change ABI, but
that's okay as we have not declared a stable interface yet.
Update a couple of the tests and examples to give this coverage:
examples/glib-main-loop no longer piles up unretired commands, and
tests/server-death shows that even a command stranded by server death
can still be auto-retired.
---
This probably will conflict with Rich's work to improve callbacks to
make it easier to free data on the last use of a callback.
examples/glib-main-loop.c | 6 +++--
generator/generator | 49 ++++++++++++++++++++++-----------------
generator/states-reply.c | 38 ++++++++++++++++++++----------
generator/states.c | 39 +++++++++++++++++++------------
lib/aio.c | 15 ++++--------
tests/server-death.c | 30 +++++++++++++++++++++++-
6 files changed, 116 insertions(+), 61 deletions(-)
diff --git a/examples/glib-main-loop.c b/examples/glib-main-loop.c
index c633c1d..2230077 100644
--- a/examples/glib-main-loop.c
+++ b/examples/glib-main-loop.c
@@ -188,6 +188,8 @@ finalize (GSource *sp)
DEBUG (source, "finalize");
+ assert (nbd_aio_in_flight (source->nbd) == 0);
+ assert (nbd_aio_peek_command_completed (source->nbd) == -1);
nbd_close (source->nbd);
}
@@ -418,7 +420,7 @@ finished_read (void *vp, int64_t rcookie, int *error)
/* Create a writer idle handler. */
g_idle_add (write_data, NULL);
- return 0;
+ return 1;
}
/* This idle callback schedules a write. */
@@ -507,5 +509,5 @@ finished_write (void *vp, int64_t wcookie, int *error)
g_main_loop_quit (loop);
}
- return 0;
+ return 1;
}
diff --git a/generator/generator b/generator/generator
index fdacd71..e0a2805 100755
--- a/generator/generator
+++ b/generator/generator
@@ -1738,9 +1738,9 @@ unique positive 64 bit cookie for this command, or C<-1> on
error. If this command returns a cookie, then C<callback>
will be called when the server is done replying,
although you must still use C<nbd_aio_command_completed> after
-the callback to retire the command. Note that you must ensure
-C<buf> is valid until the command has completed. Other
-parameters behave as documented in C<nbd_pread>.
+the callback to retire the command unless the callback returns C<1>.
+Note that you must ensure C<buf> is valid until the command has
+completed. Other parameters behave as documented in C<nbd_pread>.
The C<callback> function is called with the same C<user_data> passed to
this function, C<cookie> set to the return value of this function,
@@ -1796,8 +1796,8 @@ unique positive 64 bit cookie for this command, or C<-1> on
error. If this command returns a cookie, then C<callback>
will be called when the server is done replying,
although you must still use C<nbd_aio_command_completed> after
-the callback to retire the command. Other parameters behave as
-documented in C<nbd_pread_structured>.
+the callback to retire the command unless the callback returns C<1>.
+Other parameters behave as documented in C<nbd_pread_structured>.
The C<callback> function is called with the same C<user_data> passed to
this function, C<cookie> set to the return value of this function,
@@ -1906,8 +1906,8 @@ unique positive 64 bit cookie for this command, or C<-1> on
error. If this command returns a cookie, then C<callback>
will be called when the server is done replying,
although you must still use C<nbd_aio_command_completed> after
-the callback to retire the command. Other parameters behave as
-documented in C<nbd_flush>.
+the callback to retire the command unless the callback returns C<1>.
+Other parameters behave as documented in C<nbd_flush>.
The C<callback> function is called with the same C<user_data> passed to
this function, C<cookie> set to the return value of this function,
@@ -1949,8 +1949,8 @@ unique positive 64 bit cookie for this command, or C<-1> on
error. If this command returns a cookie, then C<callback>
will be called when the server is done replying,
although you must still use C<nbd_aio_command_completed> after
-the callback to retire the command. Other parameters behave as
-documented in C<nbd_trim>.
+the callback to retire the command unless the callback returns C<1>.
+Other parameters behave as documented in C<nbd_trim>.
The C<callback> function is called with the same C<user_data> passed to
this function, C<cookie> set to the return value of this function,
@@ -1992,8 +1992,8 @@ returns the unique positive 64 bit cookie for this command, or
C<-1> on error. If this command returns a cookie, then C<callback>
will be called when the server is done replying,
although you must still use C<nbd_aio_command_completed> after
-the callback to retire the command. Other parameters behave as
-documented in C<nbd_cache>.
+the callback to retire the command unless the callback returns C<1>.
+Other parameters behave as documented in C<nbd_cache>.
The C<callback> function is called with the same C<user_data> passed to
this function, C<cookie> set to the return value of this function,
@@ -2035,8 +2035,8 @@ unique positive 64 bit cookie for this command, or C<-1> on
error. If this command returns a cookie, then C<callback>
will be called when the server is done replying,
although you must still use C<nbd_aio_command_completed> after
-the callback to retire the command. Other parameters behave as
-documented in C<nbd_zero>.
+the callback to retire the command unless the callback returns C<1>.
+Other parameters behave as documented in C<nbd_zero>.
The C<callback> function is called with the same C<user_data> passed to
this function, C<cookie> set to the return value of this function,
@@ -2090,8 +2090,8 @@ unique positive 64 bit cookie for this command, or C<-1> on
error. If this command returns a cookie, then C<callback>
will be called when the server is done replying,
although you must still use C<nbd_aio_command_completed> after
-the callback to retire the command. Other parameters behave as
-documented in C<nbd_block_status>.
+the callback to retire the command unless the callback returns C<1>.
+Other parameters behave as documented in C<nbd_block_status>.
The C<callback> function is called with the same C<user_data> passed to
this function, C<cookie> set to the return value of this function,
@@ -2267,7 +2267,10 @@ Return true if the command completed. If this function returns
true then the command was successful and it has been retired.
Return false if the command is still in flight. This can also
fail with an error in case the command failed (in this case
-the command is also retired).
+the command is also retired). A command is retired either via
+this command, or by using a completion callback which returns
+C<1> (completion callbacks are registered via
+C<nbd_aio_pread_callback> and similar).
The C<cookie> parameter is the positive unique 64 bit cookie
for the command, as returned by a call such as C<nbd_aio_pread>.";
@@ -2279,10 +2282,11 @@ for the command, as returned by a call such as C<nbd_aio_pread>.";
shortdesc = "check if any command has completed";
longdesc = "\
Return the unique positive 64 bit cookie of the first non-retired but
-completed command, C<0> if no command is awaiting retirement, or C<-1>
-on error. Any cookie returned by this function must still be passed to
-C<nbd_aio_command_completed> to actually retire the command and learn
-whether the command was successful.";
+completed command, C<0> if there are in-flight commands but none of
+them are awaiting retirement, or C<-1> on error including when there
+are no in-flight commands. Any cookie returned by this function must
+still be passed to C<nbd_aio_command_completed> to actually retire
+the command and learn whether the command was successful.";
};
"aio_in_flight", {
@@ -3613,7 +3617,10 @@ for how to get further details of the error.
void nbd_close (struct nbd_handle *nbd);
-Closes the handle frees any associated resources.
+Closes the handle and frees any associated resources. The final
+status of any command that has not been retired (whether by
+C<nbd_aio_command_completed> or by a low-level completion callback
+returning C<1>) is lost.
=head1 GETTING THE LATEST ERROR MESSAGE IN THE THREAD
diff --git a/generator/states-reply.c b/generator/states-reply.c
index 1a0c149..6ea43d5 100644
--- a/generator/states-reply.c
+++ b/generator/states-reply.c
@@ -149,6 +149,7 @@ save_reply_state (struct nbd_handle *h)
REPLY.FINISH_COMMAND:
struct command *prev_cmd, *cmd;
uint64_t cookie;
+ bool retire;
/* NB: This works for both simple and structured replies because the
* handle (our cookie) is stored at the same offset.
@@ -164,6 +165,23 @@ save_reply_state (struct nbd_handle *h)
assert (cmd != NULL);
assert (h->reply_cmd == cmd);
h->reply_cmd = NULL;
+ retire = cmd->type == NBD_CMD_DISC;
+
+ /* Notify the user */
+ if (cmd->cb.callback) {
+ int error = cmd->error;
+
+ assert (cmd->type != NBD_CMD_DISC);
+ switch (cmd->cb.callback (cmd->cb.user_data, cookie, &error)) {
+ case -1:
+ if (error)
+ cmd->error = error;
+ break;
+ case 1:
+ retire = true;
+ break;
+ }
+ }
/* Move it to the end of the cmds_done list. */
if (prev_cmd != NULL)
@@ -171,23 +189,19 @@ save_reply_state (struct nbd_handle *h)
else
h->cmds_in_flight = cmd->next;
cmd->next = NULL;
- if (h->cmds_done_tail != NULL)
- h->cmds_done_tail = h->cmds_done_tail->next = cmd;
+ if (retire)
+ free (cmd);
else {
- assert (h->cmds_done == NULL);
- h->cmds_done = h->cmds_done_tail = cmd;
+ if (h->cmds_done_tail != NULL)
+ h->cmds_done_tail = h->cmds_done_tail->next = cmd;
+ else {
+ assert (h->cmds_done == NULL);
+ h->cmds_done = h->cmds_done_tail = cmd;
+ }
}
h->in_flight--;
assert (h->in_flight >= 0);
- /* Notify the user */
- if (cmd->cb.callback) {
- int error = cmd->error;
-
- if (cmd->cb.callback (cmd->cb.user_data, cookie, &error) == -1 && error)
- cmd->error = error;
- }
-
SET_NEXT_STATE (%.READY);
return 0;
diff --git a/generator/states.c b/generator/states.c
index 69aa431..2d7e197 100644
--- a/generator/states.c
+++ b/generator/states.c
@@ -115,31 +115,40 @@ send_from_wbuf (struct nbd_handle *h)
void abort_commands (struct nbd_handle *h,
struct command **list)
{
- struct command *prev_cmd, *cmd;
+ struct command *next, *cmd;
- for (cmd = *list, prev_cmd = NULL;
- cmd != NULL;
- prev_cmd = cmd, cmd = cmd->next) {
+ for (cmd = *list, *list = NULL; cmd != NULL; cmd = next) {
+ bool retire = cmd->type == NBD_CMD_DISC;
+
+ next = cmd->next;
if (cmd->cb.callback) {
int error = cmd->error ? cmd->error : ENOTCONN;
assert (cmd->type != NBD_CMD_DISC);
- if (cmd->cb.callback (cmd->cb.user_data, cmd->cookie,
- &error) == -1 && error)
- cmd->error = error;
+ switch (cmd->cb.callback (cmd->cb.user_data, cmd->cookie, &error)) {
+ case -1:
+ if (error)
+ cmd->error = error;
+ break;
+ case 1:
+ retire = true;
+ break;
+ }
}
if (cmd->error == 0)
cmd->error = ENOTCONN;
- }
- if (prev_cmd) {
- if (h->cmds_done_tail)
- h->cmds_done_tail->next = *list;
+ if (retire)
+ free (cmd);
else {
- assert (h->cmds_done == NULL);
- h->cmds_done = *list;
+ cmd->next = NULL;
+ if (h->cmds_done_tail)
+ h->cmds_done_tail->next = cmd;
+ else {
+ assert (h->cmds_done == NULL);
+ h->cmds_done = cmd;
+ }
+ h->cmds_done_tail = cmd;
}
- h->cmds_done_tail = prev_cmd;
- *list = NULL;
}
}
diff --git a/lib/aio.c b/lib/aio.c
index 8d7cb8d..5a9841e 100644
--- a/lib/aio.c
+++ b/lib/aio.c
@@ -69,11 +69,12 @@ nbd_unlocked_aio_command_completed (struct nbd_handle *h,
if (cmd->cookie == cookie)
break;
}
- if (!cmd || cmd->type == NBD_CMD_DISC)
+ if (!cmd)
return 0;
type = cmd->type;
error = cmd->error;
+ assert (cmd->type != NBD_CMD_DISC);
/* The spec states that a 0-length read request is unspecified; but
* it is easy enough to treat it as successful as an extension.
*/
@@ -105,16 +106,10 @@ nbd_unlocked_aio_command_completed (struct nbd_handle *h,
int64_t
nbd_unlocked_aio_peek_command_completed (struct nbd_handle *h)
{
- /* Special case NBD_CMD_DISC, as it does not have a user-visible cookie */
- if (h->cmds_done && h->cmds_done->type == NBD_CMD_DISC) {
- struct command *cmd = h->cmds_done;
-
- h->cmds_done = cmd->next;
- free (cmd);
- }
-
- if (h->cmds_done != NULL)
+ if (h->cmds_done != NULL) {
+ assert (h->cmds_done->type != NBD_CMD_DISC);
return h->cmds_done->cookie;
+ }
if (h->cmds_in_flight != NULL || h->cmds_to_issue != NULL) {
set_error (0, "no in-flight command has completed yet");
diff --git a/tests/server-death.c b/tests/server-death.c
index 4093c20..08e5358 100644
--- a/tests/server-death.c
+++ b/tests/server-death.c
@@ -30,6 +30,21 @@
#include <libnbd.h>
+static bool trim_retired;
+static const char *progname;
+
+static int
+callback (void *ignored, int64_t cookie, int *error)
+{
+ if (*error != ENOTCONN) {
+ fprintf (stderr, "%s: unexpected error in trim callback: %s\n",
+ progname, strerror (*error));
+ return 0;
+ }
+ trim_retired = 1;
+ return 1;
+}
+
int
main (int argc, char *argv[])
{
@@ -47,6 +62,8 @@ main (int argc, char *argv[])
"--exit-with-parent", "--filter=delay", "memory",
"size=1m", "delay-reads=5", NULL };
+ progname = argv[0];
+
/* We're going to kill the child, but don't want to wait for a zombie */
if (signal (SIGCHLD, SIG_IGN) == SIG_ERR) {
fprintf (stderr, "%s: signal: %s\n", argv[0], strerror (errno));
@@ -80,11 +97,17 @@ main (int argc, char *argv[])
goto fail;
}
- /* Issue a read that should not complete yet. */
+ /* Issue a read and trim that should not complete yet. Set up the
+ * trim to auto-retire via callback.
+ */
if ((cookie = nbd_aio_pread (nbd, buf, sizeof buf, 0, 0)) == -1) {
fprintf (stderr, "%s: test failed: nbd_aio_pread\n", argv[0]);
goto fail;
}
+ if (nbd_aio_trim_callback (nbd, sizeof buf, 0, callback, NULL, 0) == -1) {
+ fprintf (stderr, "%s: test failed: nbd_aio_trim_callback\n", argv[0]);
+ goto fail;
+ }
if (nbd_aio_peek_command_completed (nbd) != 0) {
fprintf (stderr, "%s: test failed: nbd_aio_peek_command_completed\n",
argv[0]);
@@ -153,6 +176,11 @@ main (int argc, char *argv[])
}
/* With all commands retired, no further command should be pending */
+ if (!trim_retired) {
+ fprintf (stderr, "%s: test failed: nbd_aio_trim_callback not retired\n",
+ argv[0]);
+ goto fail;
+ }
if (nbd_aio_peek_command_completed (nbd) != -1) {
fprintf (stderr, "%s: test failed: nbd_aio_peek_command_completed\n",
argv[0]);
--
2.20.1
5 years, 4 months
[libnbd] ImportError: cannot import name 'Error'
by Richard W.M. Jones
13:38 < mkletzan> rjones: Not sure where to look, but when I do just `import nbd` from python on the clean installation of libnbd, I just get `ImportError: cannot
import name 'Error'`
I can't reproduce it:
$ rpm -q python3-libnbd
python3-libnbd-0.1.8-1.fc30.x86_64
$ python3
Python 3.7.3 (default, May 11 2019, 00:38:04)
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nbd
>>>
Do you know which version of libnbd & python this happens for?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
5 years, 4 months
[libnbd] More thoughts on callbacks and more
by Richard W.M. Jones
More thoughts on callbacks, etc. following on from:
https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00184
Closure lifetimes
-----------------
Closures could have a lifetime if we had a little bit of support from
the C library. We would generate (from C only):
nbd_set_free_<fn>_<closure> (nbd, free_closure);
which calls free_closure (user_data) as soon as the closure will no
longer be called by the library. This function would be used to
decrement the refcount from Python or remove the global root from
OCaml.
Note this is a family of functions, eg:
nbd_set_free_set_debug_callback_debug_fn
corresponding to the debug_fn arg of nbd_set_debug_callback. Luckily
they can all be generated along with the internal machinery to call
them.
Buffer lifetimes
----------------
Similar to the above, persistent buffers (BytesPersist*) can
have lifetimes.
Remove nbd_add_close_callback
-----------------------------
The above changes (actually, just the closure change) lets us remove
nbd_add_close_callback.
Fixing callback / cookie problem
--------------------------------
I think an easier way to fix this would be to simply detect the
problematic situation and queue up the callback to be call the next
time the library is entered. Detecting the situation is fairly easy -
we know the current cookie number, so can check it before we call the
completion function. And calling the deferred callback(s) is easy
from the generated code.
The only questions in my mind are: (1) If this could cause a deadlock
because the caller is waiting for the completion signal before
reentering the library. (2) If there's some implicit guarantee that
we should call the callback as easy as possible after the command
finishes.
I think (1) is not possible in ordinary code since callers must always
enter the main loop after calling one of the nbd_aio_* functions.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
5 years, 4 months
Missing hivex.h error when compiling on macOS 10.14 (Mojave)
by Tim Perfitt
I am attempting to compile Hivex (v1.3.18) and am getting a "handle.c:47:10: fatal error: 'hivex.h' file not found" error. I see that hivex.h is not included in the source and I suspect it is created during the configure phase. Full build log below. Any ideas of how this file is created and why it wasn't created? I was able to compile it before on earlier versions of macOS but it seems that something has changed (it has been over a year since I last compiled it).
mdscentral-6:hivex tperfitt$ CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2 ./configure --disable-perl --disable-python --disable-ruby --without-readline
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for Minix Amsterdam compiler... no
checking for ar... ar
checking for ranlib... ranlib
checking build system type... x86_64-apple-darwin18.6.0
checking host system type... x86_64-apple-darwin18.6.0
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for shared library run path origin... done
checking 32-bit host C ABI... no
checking for the common suffixes of directories in the library search path... lib,lib
checking whether imported symbols can be declared weak... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_kill in -lpthread... yes
checking for multithread API to use... posix
checking for pthread_rwlock_t... yes
checking whether pthread_rwlock_rdlock prefers a writer to a reader... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for _set_invalid_parameter_handler... no
checking for fcntl... yes
checking for symlink... yes
checking for getdtablesize... yes
checking for getprogname... yes
checking for getexecname... no
checking for mprotect... yes
checking for strerror_r... yes
checking for __xpg_strerror_r... no
checking for strndup... yes
checking for vasnprintf... no
checking for snprintf... yes
checking for ftruncate... yes
checking for gettimeofday... yes
checking for isblank... yes
checking for lstat... yes
checking for pipe... yes
checking for pthread_sigmask... yes
checking for setenv... yes
checking for sigaction... yes
checking for sigaltstack... yes
checking for siginterrupt... yes
checking for sleep... yes
checking for catgets... yes
checking for shutdown... yes
checking for usleep... yes
checking for sys/socket.h... yes
checking for unistd.h... (cached) yes
checking for getopt.h... yes
checking for sys/cdefs.h... yes
checking for limits.h... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for sys/mman.h... yes
checking for features.h... no
checking for crtdefs.h... no
checking for arpa/inet.h... yes
checking for sys/stat.h... (cached) yes
checking for sys/time.h... yes
checking for netdb.h... yes
checking for netinet/in.h... yes
checking for semaphore.h... yes
checking for sys/select.h... yes
checking for sys/param.h... yes
checking for sys/wait.h... yes
checking for sys/ioctl.h... yes
checking for sys/uio.h... yes
checking whether // is distinct from /... no
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking for complete errno.h... yes
checking whether strerror_r is declared... yes
checking for strerror_r... (cached) yes
checking whether strerror_r returns char *... no
checking for working fcntl.h... no (bad O_NOATIME)
checking for pid_t... yes
checking for mode_t... yes
checking whether getdtablesize is declared... yes
checking for getopt.h... (cached) yes
checking for getopt_long_only... yes
checking whether getopt is POSIX compatible... no
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... no
checking for wint_t... yes
checking whether wint_t is too small... no
checking for unsigned long long int... yes
checking for long long int... yes
checking whether stdint.h conforms to C99... yes
checking whether stdint.h predates C++11... no
checking whether stdint.h has UINTMAX_WIDTH etc.... no
checking for inttypes.h... (cached) yes
checking whether the inttypes.h PRIxNN macros are broken... no
checking for a sed that does not truncate output... /usr/bin/sed
checking whether malloc, realloc, calloc are POSIX compliant... yes
checking for mmap... yes
checking for MAP_ANONYMOUS... yes
checking whether memchr works... yes
checking for sigset_t... yes
checking for ssize_t... yes
checking for uid_t in sys/types.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for wchar_t... yes
checking whether strerror(0) succeeds... no
checking for C/C++ restrict keyword... __restrict
checking whether strndup is declared... yes
checking whether strnlen is declared... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for intmax_t... yes
checking where to find the exponent in a 'double'... word 1 bit 20
checking whether snprintf returns a byte count as in C99... yes
checking for snprintf... (cached) yes
checking for strnlen... yes
checking for wcslen... yes
checking for wcsnlen... yes
checking for mbrtowc... yes
checking for wcrtomb... yes
checking whether _snprintf is declared... no
checking whether <wchar.h> uses 'inline' correctly... yes
checking whether <sys/socket.h> is self-contained... yes
checking for shutdown... (cached) yes
checking whether <sys/socket.h> defines the SHUT_* macros... yes
checking for struct sockaddr_storage... yes
checking for sa_family_t... yes
checking for struct sockaddr_storage.ss_family... yes
checking if environ is properly declared... no
checking whether stat file-mode macros are broken... no
checking for nlink_t... yes
checking whether getcwd (NULL, 0) allocates memory for result... yes
checking for getcwd with POSIX signature... yes
checking for struct timeval... yes
checking for wide-enough struct timeval.tv_sec member... yes
checking for IPv4 sockets... yes
checking for IPv6 sockets... yes
checking whether lstat correctly handles trailing slash... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking whether <sys/select.h> is self-contained... yes
checking for inline... inline
checking for library containing setsockopt... none needed
checking whether select supports a 0 argument... yes
checking whether select detects invalid fds... yes
checking whether alarm is declared... yes
checking for O_CLOEXEC... yes
checking for promoted mode_t type... int
checking whether strerror_r is declared... (cached) yes
checking whether setenv is declared... yes
checking search.h usability... yes
checking search.h presence... yes
checking for search.h... yes
checking for tsearch... yes
checking for struct timespec in <time.h>... yes
checking whether unsetenv is declared... yes
checking for alloca as a compiler built-in... yes
checking byteswap.h usability... no
checking byteswap.h presence... no
checking for byteswap.h... no
checking whether // is distinct from /... (cached) no
checking whether dup2 works... yes
checking for error_at_line... no
checking whether fcntl handles F_DUPFD correctly... yes
checking whether fcntl understands F_DUPFD_CLOEXEC... yes
checking whether conversion from 'int' to 'long double' works... yes
checking whether getdtablesize works... yes
checking whether program_invocation_name is declared... no
checking whether program_invocation_short_name is declared... no
checking whether __argv is declared... no
checking whether __progname is defined in default libraries... yes
checking whether INT32_MAX < INTMAX_MAX... yes
checking whether INT64_MAX == LONG_MAX... yes
checking whether UINT32_MAX < UINTMAX_MAX... yes
checking whether UINT64_MAX == ULONG_MAX... yes
checking for pthread_rwlock_t... (cached) yes
checking whether pthread_rwlock_rdlock prefers a writer to a reader... (cached) yes
checking whether program_invocation_name is declared... (cached) no
checking whether program_invocation_short_name is declared... (cached) no
checking for raise... yes
checking for sigprocmask... yes
checking for volatile sig_atomic_t... yes
checking for sighandler_t... no
checking for stdint.h... (cached) yes
checking for SIZE_MAX... yes
checking for ssize_t... (cached) yes
checking for good max_align_t... yes
checking whether NULL can be used in arbitrary expressions... yes
checking which flavor of printf attribute matches inttypes macros... system
checking for working strndup... yes
checking for working strnlen... yes
checking for strtoll... yes
checking for strtoull... yes
checking for ptrdiff_t... yes
checking for vasprintf... yes
checking for stdint.h... (cached) yes
checking for long long int... (cached) yes
checking whether fdopen sets errno... yes
checking for getpagesize... yes
checking whether getpagesize is declared... yes
checking whether gettimeofday clobbers localtime buffer... no
checking for gettimeofday with POSIX signature... yes
checking for library containing inet_pton... none required
checking whether inet_pton is declared... yes
checking whether byte ordering is bigendian... no
checking for ioctl... yes
checking for ioctl with POSIX signature... no
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking for library containing nanosleep... none required
checking for working nanosleep... no (mishandles large arguments)
checking whether <netinet/in.h> is self-contained... yes
checking whether open recognizes a trailing slash... no
checking whether perror matches strerror... yes
checking whether pthread_sigmask works without -lpthread... yes
checking whether pthread_sigmask returns error numbers... yes
checking whether pthread_sigmask unblocks signals correctly... guessing yes
checking for putenv compatible with GNU and SVID... no
checking whether _putenv is declared... no
checking whether select supports a 0 argument... (cached) yes
checking whether select detects invalid fds... (cached) yes
checking whether setenv validates arguments... yes
checking for struct sigaction.sa_sigaction... yes
checking for sigprocmask... (cached) yes
checking whether sleep is declared... yes
checking for working sleep... yes
checking for socklen_t... yes
checking whether stat handles trailing slashes on files... no
checking for struct stat.st_atim.tv_nsec... no
checking for struct stat.st_atimespec.tv_nsec... yes
checking for struct stat.st_birthtimespec.tv_nsec... yes
checking for working stdalign.h... yes
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking whether symlink handles trailing slash correctly... no
checking whether <sys/ioctl.h> declares ioctl... yes
checking for nlink_t... (cached) yes
checking for pthread_atfork... yes
checking for unsetenv... yes
checking for unsetenv() return type... int
checking whether unsetenv obeys POSIX... yes
checking for useconds_t... yes
checking whether usleep allows large arguments... yes
checking for sched_yield in -lrt... no
checking for sched_yield in -lposix4... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin18.6.0 file names to x86_64-apple-darwin18.6.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin18.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin18.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for function prototypes... yes
checking for special C compiler options needed for large files... (cached) no
checking for _FILE_OFFSET_BITS value needed for large files... (cached) no
checking size of long... 8
checking for byteswap.h... (cached) no
checking endian.h usability... no
checking endian.h presence... no
checking for endian.h... no
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking for mmap... (cached) yes
checking for bindtextdomain... no
checking for pod2man... pod2man
checking for pod2text... pod2text
checking whether NLS is requested... yes
checking for msgfmt... /usr/local/opt/gettext/bin/msgfmt
checking for gmsgfmt... /usr/local/opt/gettext/bin/msgfmt
checking for xgettext... /usr/local/opt/gettext/bin/xgettext
checking for msgmerge... /usr/local/opt/gettext/bin/msgmerge
checking for CFPreferencesCopyAppValue... yes
checking for CFLocaleCopyCurrent... yes
checking for GNU gettext in libc... no
checking for iconv... (cached) yes
checking for working iconv... (cached) yes
checking how to link with libiconv... -liconv
checking for GNU gettext in libintl... no
checking whether to use NLS... no
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libxml-2.0... yes
checking for open_memstream... yes
checking for ocamlc... ocamlc
OCaml version is 4.07.0
OCaml library path is /usr/local/lib/ocaml
checking for ocamlopt... ocamlopt
checking for ocamlc.opt... ocamlc.opt
checking for ocamlopt.opt... ocamlopt.opt
checking for ocamldep... ocamldep
checking for ocamlmktop... ocamlmktop
checking for ocamlmklib... ocamlmklib
checking for ocamldoc... ocamldoc
checking for ocamlbuild... no
checking for ocamlfind... no
checking for perl... perl
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating extra-tests/Makefile
config.status: creating generator/Makefile
config.status: creating gnulib/lib/Makefile
config.status: creating gnulib/tests/Makefile
config.status: creating hivex.pc
config.status: creating images/Makefile
config.status: creating lib/Makefile
config.status: creating lib/tools/Makefile
config.status: creating ocaml/Makefile
config.status: creating ocaml/META
config.status: creating perl/Makefile
config.status: creating perl/Makefile.PL
config.status: creating python/Makefile
config.status: creating po/Makefile.in
config.status: creating regedit/Makefile
config.status: creating ruby/Makefile
config.status: creating ruby/Rakefile
config.status: creating sh/Makefile
config.status: creating xml/Makefile
config.status: creating python/run-python-tests
config.status: creating ruby/run-ruby-tests
config.status: creating run
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
------------------------------------------------------------
Thank you for downloading hivex 1.3.18
This is how we have configured the optional components for you today:
-n OCaml bindings ......................
no
-n Perl bindings .......................
no
-n Python bindings .....................
no
-n Ruby bindings .......................
no
If any optional component is configured 'no' when you expected 'yes'
then you should check the preceeding messages.
Please report bugs back to the mailing list:
http://www.redhat.com/mailman/listinfo/libguestfs
Next you should type 'make' to build the package,
then 'make check' to run the tests.
------------------------------------------------------------
mdscentral-6:hivex tperfitt$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in gnulib/lib
GEN alloca.h
GEN byteswap.h
GEN fcntl.h
GEN getopt.h
GEN getopt-cdefs.h
GEN inttypes.h
GEN limits.h
GEN signal.h
GEN stdint.h
GEN stdio.h
GEN stdlib.h
GEN string.h
GEN sys/types.h
GEN unistd.h
GEN wchar.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
CC c-ctype.lo
CC dirname-lgpl.lo
CC basename-lgpl.lo
CC stripslash.lo
CC exitfail.lo
CC fd-hook.lo
CC full-read.lo
CC full-write.lo
CC getprogname.lo
CC glthread/lock.lo
CC progname.lo
CC safe-read.lo
CC safe-write.lo
CC glthread/threadlib.lo
CC unistd.lo
CC xsize.lo
CC xstrtol.lo
CC xstrtoul.lo
CC xstrtol-error.lo
CC asnprintf.lo
CC error.lo
CC getopt.lo
CC getopt1.lo
CC printf-args.lo
CC printf-parse.lo
CC strerror.lo
CC strerror-override.lo
CC vasnprintf.lo
CC xstrtoll.lo
CC xstrtoull.lo
CCLD libgnu.la
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(c-ctype.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(fd-hook.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(getprogname.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(threadlib.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(unistd.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(xsize.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(c-ctype.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(fd-hook.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(getprogname.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(threadlib.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(unistd.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgnu.a(xsize.o) has no symbols
Making all in generator
make[2]: Nothing to be done for `all'.
Making all in lib
Making all in tools
make[3]: Nothing to be done for `all'.
CC libhivex_la-handle.lo
handle.c:47:10: fatal error: 'hivex.h' file not found
#include "hivex.h"
^~~~~~~~~
1 error generated.
make[3]: *** [libhivex_la-handle.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
mdscentral-6:hivex tperfitt$ git branch
* (HEAD detached at v1.3.18)
master
mdscentral-6:hivex tperfitt$ auto
mdscentral-6:hivex tperfitt$ ./auto
autogen.sh autom4te.cache/
mdscentral-6:hivex tperfitt$ ./autogen.sh
# Ensure that whenever we pull in a gnulib update or otherwise change to a
# different version (i.e., when switching branches), we also rerun ./bootstrap.
curr_status=.git-module-status
t=$(git submodule status)
git submodule status
if test "$t" = "$(cat $curr_status 2>/dev/null)"; then
: # good, it's up to date
else
echo running bootstrap...
./bootstrap && echo "$t" > $curr_status
fi
cat $curr_status 2>/dev/null
CONFIGUREDIR=.
# Run configure in BUILDDIR if it's set
if [ ! -z "$BUILDDIR" ]; then
mkdir -p $BUILDDIR
cd $BUILDDIR
CONFIGUREDIR=..
fi
# Rerun the generator (requires OCaml interpreter). This is *not* for
# anything that is required at configure-time when configure is run
# from a distribution tarball. From those, nothing ocaml-related is
# required.
mkdir -p perl/lib/Win
./generator/generator.ml
File "compiler internals", line 1:
Error: Unbound module Stdlib
mdscentral-6:hivex tperfitt$
5 years, 4 months