Darryl L. Pierce
2009-Jan-06 20:32 UTC
[Ovirt-devel] [PATCH node] Small patch to find disks if hal doesn't return one.
If hal does not return any devices with the storage capability, and that's of type disk and block, then the script will grab all devices that meets the pattern /dev/[shv]d? and show them. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-storage | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 1c31a58..78e56dc 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -75,6 +75,9 @@ get_dev_name() || devices="$devices $block_dev" done + # if we didn't find any devices using HAL, so check for virtual devices + if [ -z $devices ]; then devices=$(ls -l /dev/[shv]d?); fi + # If there's only one device, use it. case $devices in '') warn "ERROR: found no usable block device"; return 1;; -- 1.6.0.6
Darryl L. Pierce
2009-Jan-07 13:01 UTC
[Ovirt-devel] Re: [PATCH node] Small patch to find disks if hal doesn't return one.
On Tue, Jan 06, 2009 at 03:32:29PM -0500, Darryl L. Pierce wrote:> If hal does not return any devices with the storage capability, and > that's of type disk and block, then the script will grab all devices > that meets the pattern /dev/[shv]d? and show them. > > Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> > --- > scripts/ovirt-config-storage | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index 1c31a58..78e56dc 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -75,6 +75,9 @@ get_dev_name() > || devices="$devices $block_dev" > done > > + # if we didn't find any devices using HAL, so check for virtual devices > + if [ -z $devices ]; then devices=$(ls -l /dev/[shv]d?); fi > + > # If there's only one device, use it. > case $devices in > '') warn "ERROR: found no usable block device"; return 1;; > -- > 1.6.0.6We discussed this in IRC and I think the consensus was that it's fine. Can someone give me an ACK? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Virtual Machine Management - http://www.ovirt.org/ "What do you care what other people think, Mr. Feynman?" -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090107/1630ba6c/attachment.sig>
Daniel P. Berrange
2009-Jan-07 14:12 UTC
[Ovirt-devel] [PATCH node] Small patch to find disks if hal doesn't return one.
On Tue, Jan 06, 2009 at 03:32:29PM -0500, Darryl L. Pierce wrote:> If hal does not return any devices with the storage capability, and > that's of type disk and block, then the script will grab all devices > that meets the pattern /dev/[shv]d? and show them. > > Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>Errr, Why ? If HAL doesn't find the disk, then we need to fix HAL and not go poking around in /dev ourselves. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|