Re: [Libguestfs] Add support for slackware in supermin
by Richard W.M. Jones
On Sat, Nov 08, 2014 at 02:27:49PM +0100, Mathieu Bouillaguet wrote:
> Hi,
>
> What needs to be implemented to add support for slackware distribution in
> supermin ?
hi Mathieu
I'm on holiday at the moment and will give a more complete reply
when I get back. In brief you need to be able to do a few simple
package database meta operations such as listing all files in a
package and listing the installed deps of a named pkg. This pre-
supposes that slackware has such a packaging db. Pino CCd can
give more details, and you can look at existing pkg systems in
src/*.ml.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
10 years, 1 month
[PATCH 0/4 v3] readline escaping functions
by Maros Zatko
Helper functions for future support of backslash escaped spaces in filenames.
There are a few tests too. Changed according to review remarks and fixed few
other mistakes.
Maros Zatko (4):
fish: copy parse_quoted_string and hexdigit from fish.h to rl.c
fish: rl.{c,h} - escaping functions for readline
fish: basic tests for readline escaping
autotools: add fish/test
Makefile.am | 1 +
configure.ac | 1 +
fish/rl.c | 157 ++++++++++++++++++++++++++++++++++++++++++++++++
fish/rl.h | 25 ++++++++
fish/test/Makefile.am | 34 +++++++++++
fish/test/testquoting.c | 96 +++++++++++++++++++++++++++++
6 files changed, 314 insertions(+)
create mode 100644 fish/rl.c
create mode 100644 fish/rl.h
create mode 100644 fish/test/Makefile.am
create mode 100644 fish/test/testquoting.c
--
1.9.3
10 years, 1 month
libguestfs-tools with libvirt SASL authentication
by Dan Ryder (daryder)
Hello,
I'm running into an issue using the 'virt-df' command when SASL is enabled in libvirt. I'm running version 1.26.5 of libguestfs on an Ubuntu 14.04 OS.
I'm running 'virt-df' for all guests at one time, not specifying a domain or image to use. I was expecting a SASL authentication prompt but to no avail. Below is a sample run:
root@all-in-one:~# virt-df -P 15
libvirt: XML-RPC error : authentication failed: Failed to start SASL negotiation: -4 (SASL(-4): no mechanism available: No worthy mechs found)
virt-df: could not connect to libvirt (code 45, domain 7): authentication failed: Failed to start SASL negotiation: -4 (SASL(-4): no mechanism available: No worthy mechs found)
However, if I do specify a domain to run on, I am prompted for SASL authentication:
root@all-in-one:~# virt-df -d instance-0000004d
libvirt needs authentication to connect to libvirt URI NULL
(see also: http://libvirt.org/auth.html http://libvirt.org/uri.html)
Please enter your authentication name: nova@all-in-one
Please enter your password:
Filesystem 1K-blocks Used Available Use%
instance-0000004d:/dev/sdb 458 458 0 100%
instance-0000004d:/dev/sda1 22773 12223 9322 54%
Is there any way to successfully run 'virt-df' for all instances at once while SASL is enabled in libvirt?
Thanks,
Dan Ryder
10 years, 1 month
[PATCH] daemon: check xfs label lengths (RHBZ#1162966).
by Pino Toscano
Similar to commit 52f9cd4882135910ea06e1e50ac6441d455c9ab1, but for xfs
filesystems.
---
daemon/daemon.h | 4 ++++
daemon/labels.c | 6 ++++++
daemon/xfs.c | 6 ++++++
3 files changed, 16 insertions(+)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 0ccbc9e..f442efd 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -253,6 +253,10 @@ extern void main_loop (int sock) __attribute__((noreturn));
/*-- in xattr.c --*/
extern int copy_xattrs (const char *src, const char *dest);
+/*-- in xfs.c --*/
+/* Documented in xfs_admin(8). */
+#define XFS_LABEL_MAX 12
+
/* ordinary daemon functions use these to indicate errors
* NB: you don't need to prefix the string with the current command,
* it is added automatically by the client-side RPC stubs.
diff --git a/daemon/labels.c b/daemon/labels.c
index f417c57..cfcb4df 100644
--- a/daemon/labels.c
+++ b/daemon/labels.c
@@ -118,6 +118,12 @@ xfslabel (const char *device, const char *label)
return -1;
}
+ if (strlen (label) > XFS_LABEL_MAX) {
+ reply_with_error ("%s: xfs labels are limited to %d bytes",
+ label, XFS_LABEL_MAX);
+ return -1;
+ }
+
r = command (NULL, &err, str_xfs_admin, "-L", label, device, NULL);
if (r == -1) {
reply_with_error ("%s", err);
diff --git a/daemon/xfs.c b/daemon/xfs.c
index 725f7b3..687013b 100644
--- a/daemon/xfs.c
+++ b/daemon/xfs.c
@@ -498,6 +498,12 @@ do_xfs_admin (const char *device,
}
if (optargs_bitmask & GUESTFS_XFS_ADMIN_LABEL_BITMASK) {
+ if (strlen (label) > XFS_LABEL_MAX) {
+ reply_with_error ("%s: xfs labels are limited to %d bytes",
+ label, XFS_LABEL_MAX);
+ return -1;
+ }
+
ADD_ARG (argv, i, "-L");
ADD_ARG (argv, i, label);
}
--
1.9.3
10 years, 1 month
[PATCH] configure: simplify the qemu cpu mapping
by Pino Toscano
Use AS_CASE to properly map from the host cpu to the qemu cpu suffix;
this avoids doing multiple string replacements using sed, and it is
possible to use case-like syntax.
---
configure.ac | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index a571de5..75dfb37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -755,15 +755,13 @@ AC_DEFINE_UNQUOTED([UNZIP],["$UNZIP"],[Name of unzip program.])
dnl Check for QEMU for running binaries on this $host_cpu, fall
dnl back to basic 'qemu'. Allow the user to override it.
-qemu_system="$(
- echo qemu-system-$host_cpu |
- $SED -e 's/-i@<:@456@:>@86/-i386/g' \
- -e 's/-arm.*/-arm/g' \
- -e 's/-amd64/-x86_64/g' \
- -e 's/-powerpc64/-ppc64/g' \
- -e 's/-ppc64le/-ppc64/g'
- )"
-default_qemu="qemu-kvm kvm $qemu_system qemu"
+AS_CASE([$host_cpu],
+ [i@<:@456@:>@86],[qemu_cpu=i386],
+ [arm*],[qemu_cpu=arm],
+ [amd64],[qemu_cpu=x86_64],
+ [powerpc64 | ppc64le],[qemu_cpu=ppc64],
+ [qemu_cpu=$host_cpu])
+default_qemu="qemu-kvm kvm qemu-system-$qemu_cpu qemu"
AC_ARG_WITH([qemu],
[AS_HELP_STRING([--with-qemu="bin1 bin2 ..."],
[set default QEMU binary @<:@default="[qemu-kvm] qemu-system-<host> qemu"@:>@])],
--
1.9.3
10 years, 1 month
[PATCH] use pkg-config to look up ncurses
by Mike Frysinger
Hardcoding -ltinfo breaks on distros that do not build the sep library
(which is the default ncurses behavior). Use pkg-config to look up the
right libraries regardless of how the distro built things.
---
builder/Makefile.am | 5 +++--
configure.ac | 18 ++++++------------
customize/Makefile.am | 2 +-
mllib/Makefile.am | 6 +++---
resize/Makefile.am | 2 +-
sparsify/link.sh.in | 2 +-
sysprep/Makefile.am | 2 +-
v2v/link.sh.in | 2 +-
8 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/builder/Makefile.am b/builder/Makefile.am
index 7b66afb..e64a696 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -24,7 +24,8 @@ AM_CFLAGS = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/fish \
-pthread \
- $(LIBLZMA_CFLAGS)
+ $(LIBLZMA_CFLAGS) \
+ $(LIBCURSES_CFLAGS)
EXTRA_DIST = \
$(SOURCES) \
@@ -172,7 +173,7 @@ OCAMLCLIBS = \
-L../src/.libs -lutils \
-L../gnulib/lib/.libs -lgnu \
-pthread -lpthread \
- -ltinfo -lcrypt
+ $(LIBCURSES_LIBS) -lcrypt
if HAVE_OCAMLOPT
virt-builder: $(OBJECTS)
diff --git a/configure.ac b/configure.ac
index a571de5..1c38084 100644
--- a/configure.ac
+++ b/configure.ac
@@ -352,19 +352,13 @@ struct sockaddr_un myaddr;
AC_DEFINE_UNQUOTED([UNIX_PATH_MAX], $unix_path_max, [Custom value for UNIX_PATH_MAX])
])
-dnl tgetent, tputs and UP [sic] are all required. They come from libtinfo
-dnl which is pulled in as a dependency of libncurses.
-old_LIBS="$LIBS"
-AC_CHECK_LIB([tinfo], [tgetent], [], [
- AC_MSG_ERROR(['libtinfo' library (usually part of ncurses) not found, or it doesn't contain 'tgetent'])
-])
-AC_CHECK_LIB([tinfo], [tputs], [], [
- AC_MSG_ERROR(['libtinfo' library (usually part of ncurses) not found, or it doesn't contain 'tputs'])
+dnl tgetent, tputs and UP [sic] are all required. They come from the lower
+dnl tinfo library, but might be part of ncurses directly.
+PKG_CHECK_MODULES([LIBCURSES], [tinfo], [], [
+ PKG_CHECK_MODULES([LIBCURSES], [ncurses])
])
-AC_CHECK_LIB([tinfo], [UP], [], [
- AC_MSG_ERROR(['libtinfo' library (usually part of ncurses) not found, or it doesn't contain 'UP'])
-])
-LIBS="$old_LIBS"
+AC_SUBST([LIBCURSES_CFLAGS])
+AC_SUBST([LIBCURSES_LIBS])
dnl GNU gettext tools (optional).
AC_CHECK_PROG([XGETTEXT],[xgettext],[xgettext],[no])
diff --git a/customize/Makefile.am b/customize/Makefile.am
index f9dccd5..64509fd 100644
--- a/customize/Makefile.am
+++ b/customize/Makefile.am
@@ -124,7 +124,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES)
OCAMLOPTFLAGS = $(OCAMLCFLAGS)
OCAMLCLIBS = \
- $(LIBXML2_LIBS) $(LIBINTL) -ltinfo -lcrypt \
+ $(LIBXML2_LIBS) $(LIBINTL) $(LIBCURSES_LIBS) -lcrypt \
-L../src/.libs -lutils \
-L../gnulib/lib/.libs -lgnu
diff --git a/mllib/Makefile.am b/mllib/Makefile.am
index d248a72..112b610 100644
--- a/mllib/Makefile.am
+++ b/mllib/Makefile.am
@@ -99,7 +99,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES)
OCAMLOPTFLAGS = $(OCAMLCFLAGS)
OCAMLCLIBS = \
- $(LIBXML2_LIBS) $(LIBINTL) -ltinfo -lcrypt \
+ $(LIBXML2_LIBS) $(LIBINTL) $(LIBCURSES_LIBS) -lcrypt \
-L../src/.libs -lutils \
-L../gnulib/lib/.libs -lgnu
@@ -154,11 +154,11 @@ check_SCRIPTS = common_utils_tests
if HAVE_OCAMLOPT
common_utils_tests: common_gettext.cmx tty-c.o tTY.cmx common_utils.cmx common_utils_tests.cmx
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
- mlguestfs.cmxa -linkpkg $^ -cclib -ltinfo -o $@
+ mlguestfs.cmxa -linkpkg $^ -cclib $(LIBCURSES_LIBS) -o $@
else
common_utils_tests: common_gettext.cmo tty-c.o tTY.cmo common_utils.cmo common_utils_tests.cmo
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
- mlguestfs.cma -linkpkg $^ -cclib -ltinfo -custom -o $@
+ mlguestfs.cma -linkpkg $^ -cclib $(LIBCURSES_LIBS) -custom -o $@
endif
TESTS_ENVIRONMENT = $(top_builddir)/run --test
diff --git a/resize/Makefile.am b/resize/Makefile.am
index f7aa9b4..3030366 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -71,7 +71,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES)
OCAMLOPTFLAGS = $(OCAMLCFLAGS)
OCAMLCLIBS = \
- $(LIBXML2_LIBS) $(LIBINTL) -ltinfo \
+ $(LIBXML2_LIBS) $(LIBINTL) $(LIBCURSES_LIBS) \
-L../src/.libs -lutils \
-L../gnulib/lib/.libs -lgnu
diff --git a/sparsify/link.sh.in b/sparsify/link.sh.in
index 537e967..5d69237 100644
--- a/sparsify/link.sh.in
+++ b/sparsify/link.sh.in
@@ -19,4 +19,4 @@
# Hack automake to link binary properly. There is no other way to add
# the -cclib parameter to the end of the command line.
-exec "$@" -linkpkg -cclib '-ltinfo'
+exec "$@" -linkpkg -cclib '@LIBCURSES_LIBS@'
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
index 70f677d..086f14c 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
@@ -136,7 +136,7 @@ OCAMLCFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) $(OCAMLPACKAGES)
OCAMLOPTFLAGS = $(OCAMLCFLAGS)
OCAMLCLIBS = \
- $(LIBXML2_LIBS) $(LIBINTL) -ltinfo -lcrypt \
+ $(LIBXML2_LIBS) $(LIBINTL) $(LIBCURSES_LIBS) -lcrypt \
-L../src/.libs -lutils \
-L../gnulib/lib/.libs -lgnu
diff --git a/v2v/link.sh.in b/v2v/link.sh.in
index d95a1dc..7ac7ee6 100644
--- a/v2v/link.sh.in
+++ b/v2v/link.sh.in
@@ -19,4 +19,4 @@
# Hack automake to link binary properly. There is no other way to add
# the -cclib parameter to the end of the command line.
-exec "$@" -linkpkg -cclib '-lutils -ltinfo -lcrypt @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
+exec "$@" -linkpkg -cclib '-lutils @LIBCURSES_LIBS@ -lcrypt @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
--
2.1.3
10 years, 1 month
[libhivex] Memory leak in hivex_node_delete_child?
by Mahmoud Al-Qudsi
Hello,
I’m not able to pin it myself from a brief look, but it seems that under certain
conditions a call to hivex_node_delete_child can cause the allocations from
_hivex_get_children to not be freed properly?
I know that if the return value of _hivex_get_children is -1, no free is called;
but from what I can see, -1 means there is nothing to be freed/it’s been taken
care of.
I’ve attached the valgrind log together with the output of HIVEX_OPEN_DEBUG,
please let me know if there’s anything else I can provide to make this easier.
Many thanks,
Mahmoud Al-Qudsi
NeoSmart Technologies
10 years, 1 month
Re: [Libguestfs] [nbdkit] leak? (#1)
by Richard W.M. Jones
On Thu, May 29, 2014 at 10:39:49AM -0700, knokknok wrote:
> Not clear to me if the following malloc is freed within lzma or if this is a leak...
> https://github.com/libguestfs/nbdkit/blob/master/plugins/xz/xzfile.c#L454
Sorry for the late reply - we don't use github for problem tracking so
no one was looking at this.
In this function (xzfile_read_block) the 'data' pointer is returned to
the caller, who must free it. The calling code is a bit complicated
because it puts the 'data' pointer into a cache, where it will be
freed when the cache is deleted or the block in the cache expires. So
I believe this is safe, but if you think otherwise, then let us know
on the mailing list (libguestfs(a)redhat.com).
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
10 years, 1 month