[PATCH] configure: add java-8-openjdk and java-7-openjdk as locations for java
by Pino Toscano
This helps some distros (e.g. Archlinux) where openjdk is installed in
java-MAJOR-openjdk directories, without any "default version" symlink.
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure.ac b/configure.ac
index 1d93ca0..fa26924 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1251,6 +1251,8 @@ if test "x$with_java" != "xno"; then
for d in \
/usr/lib/jvm/java \
/usr/lib/jvm/default-java \
+ /usr/lib/jvm/java-8-openjdk \
+ /usr/lib/jvm/java-7-openjdk \
/usr/lib/jvm/java-6-openjdk
do
if test -d $d && test -f $d/bin/java; then
--
1.9.3
10 years, 3 months
[PATCH] launch: direct: Only issue Debian /dev/kvm group warning if /dev/kvm wasn't openable (RHBZ#1130189).
by Richard W.M. Jones
This warning was meant for the case where /dev/kvm is inaccessible and
the user must add themselves to a special group.
However we didn't take into account whether /dev/kvm was openable in
this test. If it's openable, no point issuing the warning.
Move the is_openable ("/dev/kvm") test earlier, and don't issue the
warning if that was successful.
---
src/launch-direct.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/launch-direct.c b/src/launch-direct.c
index 3bae254..3a8f2b2 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -289,11 +289,19 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
return -1;
}
+ /* Try to guess if KVM is available. We are just checking that
+ * /dev/kvm is openable. That's not reliable, since /dev/kvm
+ * might be openable by qemu but not by us (think: SELinux) in
+ * which case the user would not get hardware virtualization,
+ * although at least shouldn't fail.
+ */
+ has_kvm = is_openable (g, "/dev/kvm", O_RDWR|O_CLOEXEC);
+
force_tcg = guestfs___get_backend_setting_bool (g, "force_tcg");
if (force_tcg == -1)
return -1;
- if (!force_tcg)
+ if (!has_kvm && !force_tcg)
debian_kvm_warning (g);
guestfs___launch_send_progress (g, 0);
@@ -411,14 +419,6 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
warning (g, "qemu debugging is enabled, connect gdb to tcp::1234 to begin");
}
- /* Try to guess if KVM is available. We are just checking that
- * /dev/kvm is openable. That's not reliable, since /dev/kvm
- * might be openable by qemu but not by us (think: SELinux) in
- * which case the user would not get hardware virtualization,
- * although at least shouldn't fail.
- */
- has_kvm = is_openable (g, "/dev/kvm", O_RDWR|O_CLOEXEC);
-
cpu_model = guestfs___get_cpu_model (has_kvm && !force_tcg);
if (cpu_model) {
ADD_CMDLINE ("-cpu");
--
1.9.3
10 years, 3 months
[PATCH] appliance: add libc-bin to Debian's packagelist
by Pino Toscano
It provides libc binaries like ldconfig and its configuration.
---
appliance/packagelist.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index 686f597..41bb8e4 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -76,6 +76,7 @@ dnl iproute has been renamed to iproute2
iputils-arping
iputils-tracepath
libaugeas0
+ libc-bin
libcap2
libhivex0
libpcre3
--
1.9.3
10 years, 3 months
[PATCH] build: manually drop flex-/bison-generated files from dist
by Pino Toscano
It seems that Automake cannot handle properly the files generated by
flex and bison, leaving them in the dist tarball.
For now, add a dist-hook to manually prune them from distdir.
---
builder/Makefile.am | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/builder/Makefile.am b/builder/Makefile.am
index 0b4acd7..6a5cb01 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -317,3 +317,8 @@ index-parser-c.c index-scan.c index-validate.c: index-parse.h
index-parse.h: index-parse.y
$(MAKE) index-parse.h
endif
+
+# Apparently there's no clean way with Automake to not have them
+# in the distribution, so just remove them from the distdir.
+dist-hook:
+ rm -f $(distdir)/index-parse.c $(distdir)/index-parse.h $(distdir)/index-scan.c
--
1.9.3
10 years, 3 months
Re: [Libguestfs] How make check with test-harder.sh screw my box !!!!!
by Richard W.M. Jones
[Please keep replies on the list]
On Wed, Aug 13, 2014 at 02:16:29AM +0200, arnaud gaboury wrote:
> See attached screenshot after supermin test with package "hivex". This
> package is much more too heavy and breaks everything.
> And believe me, my box have quite strong muscles and compile everything, fast.
>
> Now with a few commits, results are at least here:
>
> Testsuite summary for supermin 5.1.9
> ============================================================================
> # TOTAL: 8
> # PASS: 8
> # SKIP: 0
> # XFAIL: 0
> # FAIL: 0
> # XPASS: 0
> # ERROR: 0
>
> see https://github.com/gabx/supermin for my commits
It seems the main effect of the changes was to accidentally
disable network tests.
USE_NETWORK=1 command
and
USE_NETWORK=1
command
have quite different effects in bash.
Anyway an easier way to do that is to:
./configure --disable-network-tests
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
10 years, 3 months
Re: [Libguestfs] issue when building/making package from git
by Richard W.M. Jones
On Mon, Aug 11, 2014 at 07:32:35PM +0200, arnaud gaboury wrote:
> >
> > gnulib tests are broken. Not sure why -- would need to see the
> > complete messages not just the end bit.
> >
>
> first test to fail :
> ----------------
> Starting test_lock .../bin/sh: line 5: 1463 Aborted
> EXEEXT='' srcdir='.' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8'
> LOCALE_FR='fr_FR' LOCALE_TR_UTF8='none' LOCALE_FR='fr_FR'
> LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='none' LOCALE_ZH_CN='none'
> LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_FR='fr_FR'
> LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='none' LOCALE_ZH_CN='none'
> LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='none'
> LOCALE_ZH_CN='none'
> abs_aux_dir='/drawer/aur/libguestfs-git/src/libguestfs/build-aux'
> MAKE='make' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8'
> LOCALE_JA='none' LOCALE_ZH_CN='none' ${dir}$tst
> FAIL: test-lock
> ------------------------------
>
> Second :
> -------------
>
> glthread_create failed
> FAIL: test-thread_create
> --------------
You can avoid testing gnulib (not very interesting anyway) by running:
./configure --disable-gnulib-tests
For gnulib problems, ask on this list:
https://www.gnu.org/software/gnulib/
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
10 years, 3 months
[PATCH] p2v: check results of strndup and sscanf
by Pino Toscano
---
p2v/ssh.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/p2v/ssh.c b/p2v/ssh.c
index 1e9b05c..ff906df 100644
--- a/p2v/ssh.c
+++ b/p2v/ssh.c
@@ -505,7 +505,16 @@ open_data_connection (struct config *config, int *local_port, int *remote_port)
}, ovector, ovecsize)) {
case 100: /* Ephemeral port. */
port_str = strndup (&h->buffer[ovector[2]], ovector[3]-ovector[2]);
- sscanf (port_str, "%d", remote_port);
+ if (port_str == NULL) {
+ set_ssh_error ("not enough memory for strndup");
+ mexp_close (h);
+ return NULL;
+ }
+ if (sscanf (port_str, "%d", remote_port) != 1) {
+ set_ssh_error ("cannot extract the port number from '%s'", port_str);
+ mexp_close (h);
+ return NULL;
+ }
break;
case MEXP_EOF:
--
1.9.3
10 years, 3 months
[hivex] Segfault for an integer value to node_set_value
by Peter Wu
Hi,
When an integer argument is passed as value, node_set_value
segfaults. Reproducer is at the end of this message
The backtrace points at hivex-py.c, function get_value. While obj
is non-NULL, `bytes = PyUnicode_AsUTF8String (obj);` returns NULL.
Kind regards,
Peter
https://lekensteyn.nl
#!/usr/bin/env python3
import hivex, sys
h = hivex.Hivex(sys.argv[1])
print(h)
val = {
'key': 'broken',
't': 4,
'value': 1234
}
print(val)
r = h.node_set_value(h.root(), val)
print(r)
10 years, 3 months
[PATCH] python: fix possible free on uninit memory with OStringList optargs
by Pino Toscano
When using optional arguments of type OStringList, the code free'ing
the member in the optargs_s struct corresponding to that optional
argument would just check for a non-PyNone PyObject for that argument.
If before that optional argument there are other arguments which can
cause an earlier error return from that binding function, the free'ing
code will then act on garbage values.
Enhance the check by also checking whether the optargs struct has the
bitmask with the element for that argument, meaning that the
corresponding struct member was initialized.
---
generator/python.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/generator/python.ml b/generator/python.ml
index 72bc8a0..a763104 100644
--- a/generator/python.ml
+++ b/generator/python.ml
@@ -511,7 +511,9 @@ put_table (char * const * const argv)
function
| OBool _ | OInt _ | OInt64 _ | OString _ -> ()
| OStringList n ->
- pr " if (py_%s != Py_None)\n" n;
+ let uc_n = String.uppercase n in
+ pr " if (py_%s != Py_None && (optargs_s.bitmask |= %s_%s_BITMASK) != 0)\n"
+ n c_optarg_prefix uc_n;
pr " free ((char **) optargs_s.%s);\n" n
) optargs;
--
1.9.3
10 years, 3 months
[hivex] [PATCH 0/3] python: export version and hive types
by Peter Wu
Hi,
Here are another set of patches that attempt to make the Python interface more
useful. First there is a patch to export the package version over the binary
interface.
The second patch is a prerequisite for the third and moves the hivex.py source
to a separate directory. This may need changes to your distro packaging. The
Debian packaging from Ubuntu 14.04 did however not require such changes as it
does not depend on the exact location of the .py files.
The third patch depends on the second one and adds a new module
`hivex.hive_types` to avoid duplicating the `REG_*` constants everywhere.
Tested against the following combinations:
- Python 3.4.1 (Arch Linux x86_64, ./configure from git tree)
- Python 2.7.6 + 3.4.0 (Ubuntu 14.04 x86_64, using Debian packaging)
- Python 2.6.5 (Ubuntu 10.04 i686, ./configure from dist tarball)
These patches are based on the following two patches which have not yet been
merged into master (they are however independent of the functionality introduced
therein):
- Add type checking, support integers as value
- generator: Fix mixed tabs/spaces
If you prefer a git repo, have a look at the following for accumulated patches
https://github.com/Lekensteyn/hivex/compare/master...develop
Peter Wu (3):
python: expose package version
python: move module to separate directory
python: export hive_types constants
generator/generator.ml | 27 ++++++++++++++++++++++++++-
python/Makefile.am | 19 ++++++++++++++++---
2 files changed, 42 insertions(+), 4 deletions(-)
--
2.0.2
10 years, 3 months