Re: [PATCH] check device-mapper when building without storage mpath

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 18, 2011 at 08:00:34PM +1100, Justin Clift wrote:
> On 18/02/2011, at 7:46 PM, Jiri Denemark wrote:
> <snip>
> > 
> >> Thanks for the fix, actually It can be reproduced simply by:
> >> % ./autogen.sh --with-storage-mpath=no
> >> % make
> >> 
> >> As src/util/util.c invokes "dm_is_dm_major".
> > 
> > Yes it does, but I'm not convinced this is the right approach to fix it. Why
> > should libvirt always require device-mapper libraries?
> 
> As a data point, device-mapper isn't available on non-Linux platforms.  If
> Osier was meaning to make it "required", I can see a problem about there. ;)

Since device-mapper is Linux specific, then by definition
virIsDevMapperDevice() will always return false on those
platforms. So there is no requirement for any device-mapper
libs on non-Linux, you just trivially make it do:


#if HAVE_DEVICE_MAPPER
bool
virIsDevMapperDevice(const char *devname)
{
    struct stat buf;

    if (!stat(devname, &buf) &&
        S_ISBLK(buf.st_mode) &&
        dm_is_dm_major(major(buf.st_rdev)))
            return true;

    return false;
}
#else
bool
virIsDevMapperDevice(const char *devname ATTRIBUTE_UNUSED)
{
  return false;
}
#endif


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]