[Libguestfs] [PATCH pkg-libvirt/libguestfs] Split off ZFS support from libguestfs0.

Richard W.M. Jones rjones at redhat.com
Tue Apr 22 10:48:51 UTC 2014


On Sat, Mar 15, 2014 at 10:29:08PM +0000, Richard W.M. Jones wrote:
> Hilko,
> 
> This is an experimental patch showing how to split libguestfs into
> subpackages, so the main libguestfs0 doesn't depend on everything.
> 
> Splitting packages only works for packages which are in the appliance
> (ie. in appliance/packagelist or supermin.d/packages).
> 
> In this patch, only zfs-fuse [which previously caused trouble for
> users: https://bugs.launchpad.net/bugs/1053911] has been split off.
> 
> However the same principle can be used for other large dependencies.
> The links below are how we split the package in Fedora.  This may not
> be a suitable split for Debian, and it's probably not even the best
> split for Fedora, but it's here as a reference.  [It'd be good to do
> some analysis on the largest dependent packages and a knapsack-type
> best division analysis.]
> 
> http://pkgs.fedoraproject.org/cgit/libguestfs.git/tree/libguestfs.spec?id=c28e621afd5f78e5f55286b2f7a6fa6c3d9469ec#n840
> http://pkgs.fedoraproject.org/cgit/libguestfs.git/tree/libguestfs.spec?id=c28e621afd5f78e5f55286b2f7a6fa6c3d9469ec#n244
> 
> This patch probably won't apply cleanly to your latest experimental
> branch: in particular you moved /usr/lib/guestfs to a multiarch
> subdirectory, but this patch still uses /usr/lib/guestfs.

Hi Hilko,

There's a thread on openstack-operators:

http://www.gossamer-threads.com/lists/openstack/operators/37556

about the zfs-fuse dependency being a problem.  Is it possible you can
include a patch to split off libguestfs-zfs as a subpackage?

Since I wrote the above email, there are two further developments.

Firstly I examined the size of dependencies in Fedora to see which
ones were worth splitting off from the core library (although in the
ZFS case it's not really the size of the dependency, but the fact that
there are two conflicting implementations in Debian):

http://rwmj.wordpress.com/2014/03/20/analysis-of-the-size-of-libguestfs-dependencies/#content

Secondly I changed the subpackages in Fedora slightly.  See:

http://pkgs.fedoraproject.org/cgit/libguestfs.git/tree/libguestfs.spec?id=73fe0e6ab11c33845042a84ef98e69303e8e8923#n194
http://pkgs.fedoraproject.org/cgit/libguestfs.git/tree/libguestfs.spec?id=73fe0e6ab11c33845042a84ef98e69303e8e8923#n848

Rich.

> >From f0bc374caed67294b885869c1bc1ea22189fac39 Mon Sep 17 00:00:00 2001
> From: "Richard W.M. Jones" <rjones at redhat.com>
> Date: Sat, 15 Mar 2014 16:39:18 -0400
> Subject: [PATCH] Split off ZFS support from libguestfs0.
> 
> ---
>  debian/changelog                   |  6 ++++++
>  debian/control                     | 14 +++++++++++++-
>  debian/libguestfs-zfs-fuse.install |  1 +
>  debian/libguestfs0.dirs            |  2 ++
>  debian/libguestfs0.install         |  8 +++++++-
>  debian/rules                       | 12 ++++++++++++
>  6 files changed, 41 insertions(+), 2 deletions(-)
>  create mode 100644 debian/libguestfs-zfs-fuse.install
> 
> diff --git a/debian/changelog b/debian/changelog
> index c0b8769..2cddcf2 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,3 +1,9 @@
> +libguestfs (1:1.25.43-3) experimental; urgency=medium
> +
> +  * Split off ZFS support from libguestfs0.
> +
> + -- Richard W.M. Jones <rjones at redhat.com>  Sat, 15 Mar 2014 16:38:45 -0400
> +
>  libguestfs (1:1.25.43-2) experimental; urgency=medium
>  
>    * Remove update-guestfs-appliance.
> diff --git a/debian/control b/debian/control
> index cfc8eec..e6579e2 100644
> --- a/debian/control
> +++ b/debian/control
> @@ -114,7 +114,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends},
>    udev,
>    vim-tiny,
>    xz-utils,
> -  zfs-fuse,
>    binutils,
>    cpio,
>    dosfstools,
> @@ -152,6 +151,19 @@ Description: guest disk image management system - shared library
>   what file system is in each LV, etc.); to run commands in the context of the
>   guest; and to upload and download files and directories.
>  
> +Package: libguestfs-zfs-fuse
> +Section: libs
> +Architecture: linux-any
> +Multi-Arch: same
> +Pre-Depends: ${misc:Pre-Depends}
> +Depends: libguestfs0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends},
> +  zfs-fuse
> +Description: guest disk image management system - shared library
> + The libguestfs library allows accessing and modifying guest disk
> + images.
> + .
> + Install this package to get ZFS support.
> +
>  Package: libguestfs-tools
>  Section: admin
>  Architecture: linux-any
> diff --git a/debian/libguestfs-zfs-fuse.install b/debian/libguestfs-zfs-fuse.install
> new file mode 100644
> index 0000000..11a6249
> --- /dev/null
> +++ b/debian/libguestfs-zfs-fuse.install
> @@ -0,0 +1 @@
> +usr/lib/guestfs/supermin.d/zz-packages-zfs-fuse
> diff --git a/debian/libguestfs0.dirs b/debian/libguestfs0.dirs
> index fcf16f2..334dbd2 100644
> --- a/debian/libguestfs0.dirs
> +++ b/debian/libguestfs0.dirs
> @@ -1 +1,3 @@
>  usr/share/man/man1
> +usr/lib/guestfs
> +usr/lib/guestfs/supermin.d
> diff --git a/debian/libguestfs0.install b/debian/libguestfs0.install
> index 0045dd8..9d8de70 100644
> --- a/debian/libguestfs0.install
> +++ b/debian/libguestfs0.install
> @@ -1,5 +1,11 @@
>  usr/lib/*-*/libguestfs.so.*
> -usr/lib/guestfs/*
> +usr/lib/guestfs/supermin.d/base.tar.gz
> +usr/lib/guestfs/supermin.d/daemon.tar.gz
> +usr/lib/guestfs/supermin.d/excludefiles
> +usr/lib/guestfs/supermin.d/hostfiles
> +usr/lib/guestfs/supermin.d/init.tar.gz
> +usr/lib/guestfs/supermin.d/packages
> +usr/lib/guestfs/supermin.d/udev-rules.tar.gz
>  usr/share/man/man1/guestfs-*
>  usr/share/man/*/man1/guestfs-*
>  usr/share/locale/*/LC_MESSAGES/libguestfs.mo
> diff --git a/debian/rules b/debian/rules
> index 211c26e..9c6f232 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -108,6 +108,18 @@ override_dh_auto_install:
>  	done
>  
>  override_dh_install:
> +# Split the supermin appliance packages list into subpackages, so the
> +# main libguestfs0 can avoid depending on everything.
> +	cd $(CURDIR)/debian/tmp/usr/lib/guestfs/supermin.d && \
> +	for f in zfs-fuse; do \
> +	  if grep -Esq "^$$f\$$" packages; then \
> +	    mv packages packages~; \
> +	    grep -Ev "^$$f\$$" < packages~ > packages; \
> +	    rm packages~; \
> +	    echo $$f > zz-packages-$$f; \
> +	  fi; \
> +	done
> +
>  	erlang-depends -perlang-guestfs
>  
>  	dh_install -X.la -X.so.owner -Xbindtests -X/usr/lib/go/ \
> -- 
> 1.9.0
> 

> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs


-- 
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/




More information about the Libguestfs mailing list