[Libguestfs] [PATCH] Remove multiple hacks that only apply to RHEL 5.

Richard W.M. Jones rjones at redhat.com
Mon Oct 5 13:32:02 UTC 2015


On Mon, Oct 05, 2015 at 03:09:01PM +0200, Pino Toscano wrote:
> On Monday 05 October 2015 13:50:06 Richard W.M. Jones wrote:
> > We don't support RHEL 5 upstream (see the 'oldlinux' branch for a
> > version that works with RHEL 5).  Therefore remove a bunch of hacks
> > that were only needed on RHEL 5.
> > ---
> 
> Mostly LGTM, just two notes:
> 
> > diff --git a/daemon/swap.c b/daemon/swap.c
> > index 26fe30d..9d7839e 100644
> > --- a/daemon/swap.c
> > +++ b/daemon/swap.c
> > @@ -38,26 +38,10 @@ GUESTFSD_EXT_CMD(str_swaplabel, swaplabel);
> >  /* Confirmed this is true for Linux swap partitions from the Linux sources. */
> >  #define SWAP_LABEL_MAX 16
> >  
> > -/* Convenient place to test for the later version of e2fsprogs
> > - * and util-linux which supports -U parameters to specify UUIDs.
> > - * (Not supported in RHEL 5).
> > - */
> >  int
> >  optgroup_linuxfsuuid_available (void)
> >  {
> > -  CLEANUP_FREE char *err = NULL;
> > -  int av;
> > -
> > -  /* Upstream util-linux have been gradually changing '--help' to go
> > -   * from stderr to stdout, and changing the return code from 1 to 0.
> > -   * Thus we need to fold stdout and stderr together, and ignore the
> > -   * return code.
> > -   */
> > -  ignore_value (commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
> > -                          str_mkswap, "--help", NULL));
> > -
> > -  av = strstr (err, "-U") != NULL;
> > -  return av;
> > +  return 1;
> >  }
> 
> If the "linuxfsuuid" is now always available, then it could be retired:
> - remove its dependency in actions (there are 5)
> - adding it to the optgroups_retired list in generator/optgroups.ml

I think I want to keep my options open on this one.  Maybe we'll want
the option back again, if we decide to test for the 'mkswap' utility.

It depends on whether we will ever support a non-Linux appliance.
Years ago, this looked likely -- we even had a Windows-based
appliance, or rough plans for one.  Nowadays I can't really see that
ever happening.

> > diff --git a/generator/ruby.ml b/generator/ruby.ml
> > index 87bb34a..cb187b0 100644
> > --- a/generator/ruby.ml
> > +++ b/generator/ruby.ml
> > @@ -84,20 +84,6 @@ let rec generate_ruby_c () =
> >  #define RSTRING_PTR(r) (RSTRING((r))->ptr)
> >  #endif
> >  
> > -/* For RHEL 5 (Ruby 1.8.5) */
> > -#ifndef HAVE_RB_HASH_LOOKUP
> > -VALUE
> > -rb_hash_lookup (VALUE hash, VALUE key)
> > -{
> > -  volatile VALUE val;
> > -
> > -  if (!st_lookup (RHASH(hash)->tbl, key, &val))
> > -    return Qnil;
> > -
> > -  return val;
> > -}
> > -#endif /* !HAVE_RB_HASH_LOOKUP */
> 
> The
>   have_func("rb_hash_lookup")
> in ruby/ext/guestfs/extconf.rb.in could be removed then.

Ah, removed it too, thanks.

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




More information about the Libguestfs mailing list