[p2v PATCH 0/3] Small build fixes
This series for virt-p2v removes the usage of GTK deprecated stuff, and checks for a required Perl module used during build. Tested on: - RHEL 6 (GTK 2) - RHEL 7 (GTK 3) - Fedora 30 (GTK 2 & 3) - Fedora Rawhide/32 (GTK 2 & 3) Pino Toscano (3): Copy GtkAttachOptions from GTK >= 3.4 build: disable deprecated GTK stuff build: require List::MoreUtils Makefile.am | 1 + gui-gtk3-compat.h | 9 +++++++++ m4/p2v-progs.m4 | 8 ++++++++ 3 files changed, 18 insertions(+) -- 2.21.0
GtkAttachOptions is part of GtkTable, which is used only with GTK < 3.4; however, these enum values are used also in the GtkGrid version of the code, so they are needed also when disabling deprecated stuff. As easy solution to make the current code working without deprecated stuff of GTK, copy the GtkAttachOptions enum when using GtkGrid (i.e. with GTK >= 3.4). --- gui-gtk3-compat.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gui-gtk3-compat.h b/gui-gtk3-compat.h index a29e7b4..212c3af 100644 --- a/gui-gtk3-compat.h +++ b/gui-gtk3-compat.h @@ -50,6 +50,15 @@ gdk_event_get_button (const GdkEvent *event, guint *button) #endif #if GTK_CHECK_VERSION(3,4,0) /* gtk >= 3.4 */ +/* Copy this enum from GtkTable, as when building without deprecated + * functions this is not automatically pulled in. + */ +typedef enum +{ + GTK_EXPAND = 1 << 0, + GTK_SHRINK = 1 << 1, + GTK_FILL = 1 << 2 +} GtkAttachOptions; /* GtkGrid is sufficiently similar to GtkTable that we can just * redefine these functions. */ -- 2.21.0
We are not using deprecated GTK APIs/stuff, so make sure to not accidentally use them, and easily catch more deprecations in the future. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index d359a5b..b4f0014 100644 --- a/Makefile.am +++ b/Makefile.am @@ -139,6 +139,7 @@ nodist_virt_p2v_SOURCES = \ virt_p2v_CPPFLAGS = \ -DLOCALEBASEDIR=\""$(datadir)/locale"\" \ + -DGTK_DISABLE_DEPRECATED \ -I$(srcdir)/libguestfs \ -I$(srcdir)/miniexpect \ -I$(srcdir)/gnulib/lib -Ignulib/lib -- 2.21.0
It is used by the generate-p2v-config.pl build script, so make sure to error out earlier when this Perl module is not found. Followup of commit 2ac0713900dc60d9f0fbb8e5234ee41254f03e84. --- m4/p2v-progs.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/m4/p2v-progs.m4 b/m4/p2v-progs.m4 index d54b391..b3d0ce7 100644 --- a/m4/p2v-progs.m4 +++ b/m4/p2v-progs.m4 @@ -58,6 +58,14 @@ else AC_MSG_RESULT([yes]) fi +dnl Check for List::MoreUtils, used by generate-p2v-config.pl +AC_MSG_CHECKING([for List::MoreUtils]) +if ! $PERL -MList::MoreUtils -e1 >&AS_MESSAGE_LOG_FD 2>&1; then + AC_MSG_ERROR([perl List::MoreUtils must be installed]) +else + AC_MSG_RESULT([yes]) +fi + dnl Define the path to the podwrapper program. PODWRAPPER="\$(guestfs_am_v_podwrapper)$PERL $(pwd)/podwrapper.pl" AC_SUBST([PODWRAPPER]) -- 2.21.0
Yes this series looks good, thanks. Can we put patch 2 into libguestfs as well? (Until or unless we delete p2v from libguestfs) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On Friday, 30 August 2019 12:52:59 CEST Richard W.M. Jones wrote:
Yes this series looks good, thanks.
Thanks, pushed to virt-p2v.
Can we put patch 2 into libguestfs as well? (Until or unless we delete p2v from libguestfs)
(Both patches 1 and 2 are needed, not just 2.) What about: - I push the patches to libguestfs/stable-1.40 - we get a virt-p2v release out - we remove virt-p2v (already in a local branch here) from libguestfs/master ? -- Pino Toscano
On Fri, Aug 30, 2019 at 01:46:27PM +0200, Pino Toscano wrote:
On Friday, 30 August 2019 12:52:59 CEST Richard W.M. Jones wrote:
Yes this series looks good, thanks.
Thanks, pushed to virt-p2v.
Can we put patch 2 into libguestfs as well? (Until or unless we delete p2v from libguestfs)
(Both patches 1 and 2 are needed, not just 2.)
What about: - I push the patches to libguestfs/stable-1.40 - we get a virt-p2v release out - we remove virt-p2v (already in a local branch here) from libguestfs/master
Sounds like a plan. I was in the middle of a libguestfs (1.41) release yesterday but got bogged down fixing errors. 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/
On Fri, Aug 30, 2019 at 01:33:03PM +0100, Richard W.M. Jones wrote:
On Fri, Aug 30, 2019 at 01:46:27PM +0200, Pino Toscano wrote:
On Friday, 30 August 2019 12:52:59 CEST Richard W.M. Jones wrote:
Yes this series looks good, thanks.
Thanks, pushed to virt-p2v.
Can we put patch 2 into libguestfs as well? (Until or unless we delete p2v from libguestfs)
(Both patches 1 and 2 are needed, not just 2.)
What about: - I push the patches to libguestfs/stable-1.40 - we get a virt-p2v release out - we remove virt-p2v (already in a local branch here) from libguestfs/master
Sounds like a plan.
I was in the middle of a libguestfs (1.41) release yesterday but got bogged down fixing errors.
In order for the greater good of releasing 1.41.1 today, I added patches 1 & 2 to libguestfs master. However please don't let this stop you from removing p2v/ from libguestfs master when you have the time. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (2)
-
Pino Toscano -
Richard W.M. Jones