summaryrefslogtreecommitdiff
path: root/tools/virt-host-validate-common.h
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2015-10-07 17:02:31 +0100
committerDaniel P. Berrange <berrange@redhat.com>2015-10-12 13:15:00 +0100
commitfd6d506c50d9c885fd500627bddefe2f93ded0c2 (patch)
treee6a214e9aa33f324c97619309971a9d1d8e41dbd /tools/virt-host-validate-common.h
parent8a6b6037f8486b4fc8a1395d03956510247fbc96 (diff)
downloadlibvirt-fd6d506c50d9c885fd500627bddefe2f93ded0c2.tar.gz
virt-host-validate: distinguish exists vs accessible for devices
Currently we just check that various devices are accessible. This leads to inaccurate errors reported for /dev/kvm and /dev/vhost-net if they exist but an unprivileged user lacks access. Switch existing checks to look for file existance, and add a separate check for accessibility of /dev/kvm since some distros don't grant users access by default. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'tools/virt-host-validate-common.h')
-rw-r--r--tools/virt-host-validate-common.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/virt-host-validate-common.h b/tools/virt-host-validate-common.h
index 9d8bceaea3..c25e69ca60 100644
--- a/tools/virt-host-validate-common.h
+++ b/tools/virt-host-validate-common.h
@@ -42,10 +42,15 @@ extern void virHostMsgPass(void);
extern void virHostMsgFail(virHostValidateLevel level,
const char *hint);
-extern int virHostValidateDevice(const char *hvname,
- const char *dev_name,
- virHostValidateLevel level,
- const char *hint);
+extern int virHostValidateDeviceExists(const char *hvname,
+ const char *dev_name,
+ virHostValidateLevel level,
+ const char *hint);
+
+extern int virHostValidateDeviceAccessible(const char *hvname,
+ const char *dev_name,
+ virHostValidateLevel level,
+ const char *hint);
extern bool virHostValidateHasCPUFlag(const char *name);