Darryl L. Pierce
2009-Jun-25 20:47 UTC
[Ovirt-devel] [PATCH node] Fixes when a removable media is removed. bz#507455
If a device is a removeable media device, then o-c-storage will now check if there's media present before attempting to get the storage size for the device. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-storage | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 0fcc0bc..41177a4 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -62,7 +62,10 @@ get_drive_size() size=$(hal-get-property --udi "$udi" --key storage.size) if [[ "${size}" == "0" ]]; then # disk is probably hot-swappable, use different HAL key - size=$(hal-get-property --udi "$udi" --key storage.removable.media_size) + # but first check that it is removeable media and that media is present + if [[ "true" == "$(hal-get-property --udi "$udi" --key storage.removable.media_available)" ]]; then + size=$(hal-get-property --udi "$udi" --key storage.removable.media_size) + fi fi fi -- 1.6.0.6