Bug 695138

Summary: Remove dependency on gfs2-utils
Product: Red Hat Enterprise Linux 6 Reporter: Perry Myers <pmyers>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.0CC: cluster-maint, dgregor, jzheng, leiwang, lhh, mshao, nstraz, qwan, riek, rwheeler, ssaha, swhiteho, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.7.17-17.el6 Doc Type: Bug Fix
Doc Text:
A superfluous dependency on the gfs2-utils package has been removed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 11:44:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 695347    

Description Perry Myers 2011-04-10 20:55:48 UTC
Description of problem:
libguestfs presently supports using gfs2 fs utilities on an offline VM disk image.  This pulls the gfs2-utils package (and therefore other core bits of cluster) into the base os channels instead of just being in the Resiliant Storage and High Availability Add Ons.

This bug is to remove the dependency so that libguestfs no longer requires gfs2-utils.

Comment 5 Steve Whitehouse 2011-04-11 08:36:32 UTC
I'm wondering exactly what the connection is with gfs2-utils? Since the bug mentions offline access, I assume that at most this means fork + exec of mkfs.gfs2 and/or fsck.gfs2.

In that case there is no need for a dep on gfs2-utils, it should be possible to offer these functions only when gfs2-utils is installed and therefore no dependency need exist.

gfs2-utils does something similar itself to avoid a dependency on the "file" program.

Comment 6 Richard W.M. Jones 2011-04-11 08:47:09 UTC
(In reply to comment #5)
> I'm wondering exactly what the connection is with gfs2-utils? Since the bug
> mentions offline access, I assume that at most this means fork + exec of
> mkfs.gfs2 and/or fsck.gfs2.

Precisely -- if the user asks to create a GFS2 filesystem,
then we run mkfs.gfs2.  I've attached an example below.  It's
not a particularly useful feature for virtual machines, since
we wouldn't expect they would be using GFS2, so we just decided
to drop this facility from RHEL 6.1 (or 6.2) in order to avoid the
extra dependency.

> In that case there is no need for a dep on gfs2-utils, it should be possible to
> offer these functions only when gfs2-utils is installed and therefore no
> dependency need exist.

However this is not possible (or at least, not trivial) because
of the way that the supermin appliance is built.

-----------------------------

$ guestfish -N fs:gfs2:1G

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> file /dev/vda1 
GFS2 Filesystem (blocksize 4096, lockproto lock_nolock)
><fs> mount /dev/vda1 /
><fs> ll /
total 8
drwxr-xr-x  2 root root 3864 Apr 11 09:43 .
drwxr-xr-x 24  500  500 4096 Apr 11 09:43 ..
><fs> vfs-type /dev/vda1 
gfs2
><fs> exit
$ file test1.img 
test1.img: x86 boot sector; partition 1: ID=0x83, starthead 1, startsector 64, 2097025 sectors, code offset 0xb8

Comment 7 Steve Whitehouse 2011-04-11 08:57:17 UTC
If it is not useful, then that sounds perfectly ok to drop it.

I don't follow why there is a problem with only offering the function when gfs2-utils is installed? In your example I'd expect a test for /sbin/mkfs.gfs2 which if it failed would just print an "I can't do that because gfs2-utils isn't installed" message.

Comment 8 Richard W.M. Jones 2011-04-11 09:02:33 UTC
It's to do with the way we build an appliance for libguestfs.
See: http://libguestfs.org/febootstrap.8.html#supermin_appliances

Comment 9 Richard W.M. Jones 2011-04-11 10:42:27 UTC
I can't commit the fix for this: flags are wrong.

Comment 19 Richard W.M. Jones 2011-04-12 20:59:20 UTC
(In reply to comment #18)
> http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3252424

The montecarlo testing of virt-make-fs caused that build
to fail (bug 695881).  It appears to be unrelated to the
present change.

I've submitted a new build here:
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3252987

Comment 20 Richard W.M. Jones 2011-04-12 22:38:18 UTC
I did some testing of this package on my local
production server and it appears to work.

Comment 22 Jinxin Zheng 2011-04-13 09:22:20 UTC
Verification of this bug:

1. Reproduce:

libguestfs-1.7.17-16.el6 depends on gfs2-utils,

$ rpm -qRp guestfish-1.7.17-16.el6.x86_64.rpm | grep gfs2
gfs2-utils

issuing `guestfish -N fs:gfs2:1G` produces a test1.img file that contains gfs2 filesystem as shown in comment 6.

2. Verify:

libguestfs-1.7.17-17.el6 removed the dependency,

$ rpm -qRp guestfish-1.7.17-17.el6.x86_64.rpm | grep gfs2
(no output)

`guestfish -N fs:gfs2:1G` prints the following error (which is expected),

libguestfs: error: mkfs: gfs2: /dev/vda1: mkfs.gfs2: No such file or directory
guestfish: error creating prepared disk image 'fs:gfs2:1G' on 'test1.img': failed to create filesystem (gfs2): mkfs: gfs2: /dev/vda1: mkfs.gfs2: No such file or directory

Comment 23 Laura Bailey 2011-04-20 01:59:00 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
A superfluous dependency on the gfs2-utils package has been removed.

Comment 24 Richard W.M. Jones 2011-04-20 07:45:30 UTC
Fine, thanks.

Comment 25 errata-xmlrpc 2011-05-19 11:44:21 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0586.html

Comment 26 errata-xmlrpc 2011-05-19 13:11:05 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0586.html