X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fswap.c;h=2d3d9ff413bf6aec17b133ad3fd32fb786fac393;hb=949d6e79ad81db208e5181d01f01b736a271c1e5;hp=bcc5f1b13529e76228c627e3ede30ad91da78538;hpb=84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0;p=libguestfs.git diff --git a/daemon/swap.c b/daemon/swap.c index bcc5f1b..2d3d9ff 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -26,6 +26,25 @@ #include "../src/guestfs_protocol.h" #include "daemon.h" #include "actions.h" +#include "optgroups.h" + +/* 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) +{ + char *err; + int av; + + /* Ignore return code - mkswap --help *will* fail. */ + command (NULL, &err, "/sbin/mkswap", "--help", NULL); + + av = strstr (err, "-U") != NULL; + free (err); + return av; +} static int mkswap (const char *device, const char *flag, const char *value)