[Ovirt-devel] [PATCH] Expand get_dev_name funtion to consider devices not seen by HAL
Ricardo Marin Matinata
matinata at br.ibm.com
Thu Feb 4 19:16:48 UTC 2010
This patch augments the get_dev_name functions for devices not properly seen by HAL.
Signed-off-by: Ricardo Marin Matinata <matinata at br.ibm.com>
---
scripts/ovirt-config-storage | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage
index eed126c..74894d1 100755
--- a/scripts/ovirt-config-storage
+++ b/scripts/ovirt-config-storage
@@ -140,7 +140,8 @@ check_partition_sizes()
get_dev_name()
{
local udi_list=$(hal-find-by-capability --capability storage)
- if test -z "$udi_list"; then
+ local byid_list=$(find /dev/disk/by-id -mindepth 1| grep -v "\-part")
+ if test -z "$udi_list" -a -z "$byid_list"; then
warn "ERROR: no usable storage devices detected"
return 1
fi
@@ -164,6 +165,10 @@ get_dev_name()
&& devices="$block_dev" \
|| devices="$devices $block_dev"
done
+ d=""
+ for d in $byid_list; do
+ devices="$devices `readlink -f $d`";
+ done
# FIXME: workaround for detecting virtio block devices
devices="$devices $(ls /dev/vd? 2> /dev/null | xargs)"
--
1.6.6
More information about the ovirt-devel
mailing list