# util/virdevmapper.h
virDevMapperGetTargets;
+virIsDevMapperDevice;
# util/virdnsmasq.h
virHostGetDRMRenderNode;
virHostHasIOMMU;
virIndexToDiskName;
-virIsDevMapperDevice;
virMemoryLimitIsSet;
virMemoryLimitTruncate;
virMemoryMaxValue;
#include <sys/stat.h>
#include <unistd.h>
-#include "virutil.h"
#include "virfile.h"
#include "virstring.h"
#include "virgettext.h"
+#include "virdevmapper.h"
/* we don't need to include the full internal.h just for this */
#define STREQ(a, b) (strcmp(a, b) == 0)
#include "virutil.h"
#include "configmake.h"
#include "virstring.h"
+#include "virdevmapper.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
return -1;
}
#endif /* ! WITH_DEVMAPPER */
+
+
+#if WITH_DEVMAPPER
+bool
+virIsDevMapperDevice(const char *dev_name)
+{
+ struct stat buf;
+
+ if (!stat(dev_name, &buf) &&
+ S_ISBLK(buf.st_mode) &&
+ dm_is_dm_major(major(buf.st_rdev)))
+ return true;
+
+ return false;
+}
+
+#else /* ! WITH_DEVMAPPER */
+
+bool
+virIsDevMapperDevice(const char *dev_name G_GNUC_UNUSED)
+{
+ return false;
+}
+#endif /* ! WITH_DEVMAPPER */
int
virDevMapperGetTargets(const char *path,
char ***devPaths) G_GNUC_NO_INLINE;
+
+bool
+virIsDevMapperDevice(const char *dev_name) ATTRIBUTE_NONNULL(1);
#include <sys/types.h>
-#if WITH_DEVMAPPER
-# include <libdevmapper.h>
-#endif
-
#ifdef HAVE_GETPWUID_R
# include <pwd.h>
# include <grp.h>
ignore_value(virCommandRun(cmd, &exitstatus));
}
-#if WITH_DEVMAPPER
-bool
-virIsDevMapperDevice(const char *dev_name)
-{
- struct stat buf;
-
- if (!stat(dev_name, &buf) &&
- S_ISBLK(buf.st_mode) &&
- dm_is_dm_major(major(buf.st_rdev)))
- return true;
-
- return false;
-}
-#else
-bool virIsDevMapperDevice(const char *dev_name G_GNUC_UNUSED)
-{
- return false;
-}
-#endif
-
bool
virValidateWWN(const char *wwn)
{
bool virDoesGroupExist(const char *name);
-bool virIsDevMapperDevice(const char *dev_name) ATTRIBUTE_NONNULL(1);
-
bool virValidateWWN(const char *wwn);
int virGetDeviceID(const char *path,