[PATCH v2 0/2] python: fixes for Python 3
by Pino Toscano
A couple of fixes for Python 3 to the Python binding.
Unfortunately a behaviour change is needed, although it fixes broken
types used.
Changes from v1:
- handle also FBuffer in structs
Pino Toscano (2):
python: fix call of Python handlers of events
python: change types for RBufferOut/FBuffer with Python 3
(RHBZ#1661871)
generator/python.ml | 9 +++++++++
python/handle.c | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
--
2.20.1
5 years, 10 months
[PATCH 0/2] python: fixes for Python 3
by Pino Toscano
A couple of fixes for Python 3 to the Python binding.
Unfortunately a behaviour change is needed, although it fixes broken
types used.
Pino Toscano (2):
python: fix call of Python handlers of events
python: change return type for RBufferOut with Python 3 (RHBZ#1661871)
generator/python.ml | 4 ++++
python/handle.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
--
2.20.1
5 years, 10 months
[PATCH] gobject: Add Vala binding support
by Corentin Noël
Here is a patch adding Vala bindings support if the GObject Introspection is also available.
>From 610c8206ecd991be372650c2914bbffd9af057fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Corentin=20No=C3=ABl?= <corentin.noel(a)collabora.com>
Date: Tue, 22 Jan 2019 13:12:57 +0100
Subject: [PATCH] gobject: Add Vala binding support
---
.gitignore | 1 +
configure.ac | 4 ++
gobject/Makefile.am | 17 +++++
gobject/libguestfs-gobject-1.0.deps | 2 +
m4/vapigen.m4 | 101 ++++++++++++++++++++++++++++
5 files changed, 125 insertions(+)
create mode 100644 gobject/libguestfs-gobject-1.0.deps
create mode 100644 m4/vapigen.m4
diff --git a/.gitignore b/.gitignore
index 637bf7765..afe1c0654 100644
--- a/.gitignore
+++ b/.gitignore
@@ -340,6 +340,7 @@ Makefile.in
/gobject/Guestfs-1.0.typelib
/gobject/guestfs-gobject.3
/gobject/stamp-guestfs-gobject.pod
+/gobject/libguestfs-gobject-1.0.vapi
/golang/bindtests.go
/golang/examples/guestfs-golang.3
/golang/examples/stamp-guestfs-golang.pod
diff --git a/configure.ac b/configure.ac
index e18e099b9..dfc7a1af3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,6 +161,8 @@ HEADING([Checking for Go])
m4_include([m4/guestfs-golang.m4])
HEADING([Checking for GObject Introspection])
m4_include([m4/guestfs-gobject.m4])
+HEADING([Checking for Vala])
+VAPIGEN_CHECK
dnl virt-v2v, virt-p2v.
HEADING([Checking the virt-v2v and virt-p2v dependencies])
@@ -421,6 +423,8 @@ AS_ECHO_N(["gobject bindings .................... "])
if test "x$HAVE_GOBJECT_TRUE" = "x"; then echo "yes"; else echo "no"; fi
AS_ECHO_N(["gobject introspection ............... "])
if test "x$HAVE_INTROSPECTION_TRUE" = "x"; then echo "yes"; else echo "no"; fi
+AS_ECHO_N(["Vala bindings ....................... "])
+if test "x$ENABLE_VAPIGEN" = "x"; then echo "yes"; else echo "no"; fi
AS_ECHO_N(["bash completion ..................... "])
if test "x$HAVE_BASH_COMPLETION_TRUE" = "x"; then echo "yes"; else echo "no"; fi
echo
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index ddedd5b51..302d54354 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -105,6 +105,23 @@ $(TESTS): $(typelib_DATA)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
+if ENABLE_VAPIGEN
+-include $(VAPIGEN_MAKEFILE)
+
+libguestfs-gobject-1.0.vapi: Guestfs-1.0.gir libguestfs-gobject-1.0.deps
+
+VAPIGEN_VAPIS = libguestfs-gobject-1.0.vapi
+
+libguestfs_gobject_1_0_vapi_DEPS = gobject-2.0 gio-2.0
+libguestfs_gobject_1_0_vapi_METADATADIRS = $(srcdir)
+libguestfs_gobject_1_0_vapi_FILES = Guestfs-1.0.gir
+
+vapidir = $(datadir)/vala/vapi
+vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
+
+EXTRA_DIST += foo-1.0.deps
+endif
+
endif HAVE_INTROSPECTION
# Documentation.
diff --git a/gobject/libguestfs-gobject-1.0.deps b/gobject/libguestfs-gobject-1.0.deps
new file mode 100644
index 000000000..d4db05933
--- /dev/null
+++ b/gobject/libguestfs-gobject-1.0.deps
@@ -0,0 +1,2 @@
+gobject-2.0
+gio-2.0
diff --git a/m4/vapigen.m4 b/m4/vapigen.m4
new file mode 100644
index 000000000..2c435e74b
--- /dev/null
+++ b/m4/vapigen.m4
@@ -0,0 +1,101 @@
+dnl vapigen.m4
+dnl
+dnl Copyright 2012 Evan Nemerson
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND_INTROSPECTION], [DEFAULT])
+# --------------------------------------
+# Check vapigen existence and version
+#
+# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
+AC_DEFUN([VAPIGEN_CHECK],
+[
+ AS_IF([test "x$3" != "xyes"], [
+ m4_provide_if([GOBJECT_INTROSPECTION_CHECK], [], [
+ m4_provide_if([GOBJECT_INTROSPECTION_REQUIRE], [], [
+ AC_MSG_ERROR([[You must call GOBJECT_INTROSPECTION_CHECK or GOBJECT_INTROSPECTION_REQUIRE before using VAPIGEN_CHECK unless using the FOUND_INTROSPECTION argument is "yes"]])
+ ])
+ ])
+ ])
+
+ AC_ARG_ENABLE([vala],
+ [AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],[build Vala bindings @<:@default=]ifelse($4,,auto,$4)[@:>@])],,[
+ AS_IF([test "x$4" = "x"], [
+ enable_vala=auto
+ ], [
+ enable_vala=$4
+ ])
+ ])
+
+ AS_CASE([$enable_vala], [no], [enable_vala=no],
+ [yes], [
+ AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
+ AC_MSG_ERROR([Vala bindings require GObject Introspection])
+ ])
+ ], [auto], [
+ AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
+ enable_vala=no
+ ])
+ ], [
+ AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@])
+ ])
+
+ AS_IF([test "x$2" = "x"], [
+ vapigen_pkg_name=vapigen
+ ], [
+ vapigen_pkg_name=vapigen-$2
+ ])
+ AS_IF([test "x$1" = "x"], [
+ vapigen_pkg="$vapigen_pkg_name"
+ ], [
+ vapigen_pkg="$vapigen_pkg_name >= $1"
+ ])
+
+ PKG_PROG_PKG_CONFIG
+
+ PKG_CHECK_EXISTS([$vapigen_pkg], [
+ AS_IF([test "$enable_vala" = "auto"], [
+ enable_vala=yes
+ ])
+ ], [
+ AS_CASE([$enable_vala], [yes], [
+ AC_MSG_ERROR([$vapigen_pkg not found])
+ ], [auto], [
+ enable_vala=no
+ ])
+ ])
+
+ AC_MSG_CHECKING([for vapigen])
+
+ AS_CASE([$enable_vala],
+ [yes], [
+ VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
+ VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
+ AS_IF([test "x$2" = "x"], [
+ VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
+ ], [
+ VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
+ ])
+ ])
+
+ AC_MSG_RESULT([$enable_vala])
+
+ AC_SUBST([VAPIGEN])
+ AC_SUBST([VAPIGEN_VAPIDIR])
+ AC_SUBST([VAPIGEN_MAKEFILE])
+
+ AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes")
+])
--
2.17.1
5 years, 10 months
[PATCH] build: Reduce -Wformat-overflow=2 to =1.
by Richard W.M. Jones
GCC 9 gives this error which I believe is bogus:
qemuopts.c: In function 'qemuopts_to_config_channel':
qemuopts.c:987:29: error: '%.*s' directive output between 0 and 2147483647 bytes may exceed minimum required size of 4095 [-Werror=format-overflow=]
987 | fprintf (fp, " %.*s = ", (int) k, values[j]);
| ^~~~
qemuopts.c:987:26: note: assuming directive output of 1 byte
987 | fprintf (fp, " %.*s = ", (int) k, values[j]);
| ^~~~~~~~~~~
---
m4/guestfs-c.m4 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/m4/guestfs-c.m4 b/m4/guestfs-c.m4
index 3fd44ed6b..e20721f5f 100644
--- a/m4/guestfs-c.m4
+++ b/m4/guestfs-c.m4
@@ -105,6 +105,9 @@ gl_WARN_ADD([-Wimplicit-fallthrough=4])
dnl GCC level 2 gives incorrect warnings, so use level 1.
gl_WARN_ADD([-Wformat-truncation=1])
+dnl GCC 9 at level 2 gives apparently bogus errors when %.*s is used.
+gl_WARN_ADD([-Wformat-overflow=1])
+
AC_SUBST([WARN_CFLAGS])
NO_SNV_CFLAGS=
--
2.20.1
5 years, 10 months
Re: [Libguestfs] hivexregedit
by Richard W.M. Jones
On Fri, Jan 18, 2019 at 11:35:44AM -0700, JD wrote:
> Hello Richard,
> I was referred to the utility hivexregedit
> by a member of the ntfs-3g-devel newsgroup.
>
> I have a quick question about this util.
>
> I have a failed HD of Windows 7, and I want to reinstall Win 7
> on a new drive using the same COA key, which I do not have
> saved anywhere.
>
> I used testdisk to back up the unmountable win7 install partition.
> Testdisk copied all the files that it could to my linux HD.
>
> Question:
>
> How do I use the utility to show the COA key?
If the key is contained in the Windows Registry, then hivexregedit
should be able to display it (you might want to look at ‘virt-win-reg’
however since it wraps hivex so that it can be used directly against a
disk image).
However, I'm afraid I've no idea if the "COA key" is in the registry,
or what is the name of the registry key. Perhaps someone on the
libguestfs mailing list will know, but in any case that's not really a
hivex question, more of a Windows question.
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
5 years, 10 months
ANNOUNCE: nbdkit 1.10 - an NBD server toolkit with stable plugin API and permissive license
by Richard W.M. Jones
I’m pleased to announce the next stable release of nbdkit. This
release concentrates on performance and fuzzing, along with numerous
other enhancements (full list below).
NBD — Network Block Device — is a protocol for accessing Block Devices
(hard disks and disk-like things) over a Network. nbdkit is a toolkit
for creating NBD servers.
The key features are:
* Multithreaded NBD server written in C with good performance.
* Minimal dependencies for the basic server.
* Liberal license (BSD) allows nbdkit to be linked to proprietary
libraries or included in proprietary code.
* Well-documented, simple plugin API with a stable ABI guarantee.
Lets you export “unconventional” block devices easily.
* You can write plugins in C, Lua, Perl, Python, OCaml, Ruby,
[new!] shell script or Tcl.
* Filters can be stacked in front of plugins to transform the output.
Clone source: https://github.com/libguestfs/nbdkit
Download tarball: http://download.libguestfs.org/nbdkit/1.10-stable/
(other downloads: http://download.libguestfs.org/nbdkit/ )
New in this release:
- Implemented NBD_FLAG_CAN_MULTI_CONN which greatly improves
performance for clients that support it.
- Implemented NBD_OPT_INFO (Eric Blake).
- nbdkit-data-plugin and nbdkit-memory-plugin: By adding fine-grained
locking, these plugins now use the fully parallel thread model.
- nbdkit-cache-filter: The size of the cache can now be limited, and
the cache reclaims space using an LRU algorithm. It has also been
enhanced to support cache-on-read mode. The filter now uses a fully
parallel thread model.
- nbdkit-cow-filter: Use a fully parallel thread model.
- nbdkit-sh-plugin: Inline scripts:
https://rwmj.wordpress.com/2018/12/15/nbdkit-inline-scripts/
- nbdkit-sh-plugin: Full API version 2 is now supported.
- OCaml bindings: Full API version 2 is now supported.
- nbdkit-delay-filter allows you to specify the read, write, zero and
trim delays individually.
- nbdkit-curl-plugin: Add support for connecting to servers over Unix
domain sockets.
- Bash tab completion has been improved: Partial plugin names are
expanded correctly, and plugin parameters containing '-' work.
- Public header files can now be consumed by ISO C90 compilers (but
GCC or Clang is still required to compile nbdkit itself).
- A better non-cryptographically secure pseudo-random number generator
(xoshiro256** 1.0) is now used on all platforms, replacing previous
uses of random(3).
- Fuzzing using American Fuzzy Lop is now supported, and was carried
out, resulting in one error being found in the server (not security
related).
- New nbdkit-xz-filter: This replaces nbdkit-xz-plugin which will be
removed in nbdkit 1.12.
- New nbdkit-loop(1) man page documenting how to use nbdkit for loop
mounts. See also:
https://fosdem.org/2019/schedule/event/nbdkit/
- New nbdkit-full-plugin: Returns ENOSPC on every request.
- attribute((format)), attribute((nonnull)) and attribute((sentinel))
are used in internal header files to improve code quality.
- Logging using %m now works on all platforms, not just on Linux with
glibc (Eric Blake).
- VPATH builds partially supported (Eric Blake).
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, 10 months