summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-04-23 15:43:50 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-04-23 15:43:50 +0000
commit1dfa428e543aa5b4cbfe1704d0c2bc5d8a71525d (patch)
treec9f0fbb9f9b41768147004b52cc40fdf76ceec2d /perl-install/detect_devices.pm
parent09f71b434806dc5584fb239f6638937461e1dfd4 (diff)
downloaddrakx-backup-do-not-use-1dfa428e543aa5b4cbfe1704d0c2bc5d8a71525d.tar
drakx-backup-do-not-use-1dfa428e543aa5b4cbfe1704d0c2bc5d8a71525d.tar.gz
drakx-backup-do-not-use-1dfa428e543aa5b4cbfe1704d0c2bc5d8a71525d.tar.bz2
drakx-backup-do-not-use-1dfa428e543aa5b4cbfe1704d0c2bc5d8a71525d.tar.xz
drakx-backup-do-not-use-1dfa428e543aa5b4cbfe1704d0c2bc5d8a71525d.zip
handle virtio block devices
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 3cf6609cc..ce6c8e029 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -32,7 +32,7 @@ sub get() {
#- 2. The first SCSI device if SCSI exists. Or
#- 3. The first RAID device if RAID exists.
- getIDE(), getSCSI(), getDAC960(), getCompaqSmartArray(), getATARAID();
+ getIDE(), getSCSI(), getVirtIO(), getDAC960(), getCompaqSmartArray(), getATARAID();
}
sub hds() { grep { may_be_a_hd($_) } get() }
sub tapes() { grep { $_->{media_type} eq 'tape' } get() }
@@ -368,6 +368,14 @@ sub getATARAID() {
values %l;
}
+sub getVirtIO() {
+ -d '/sys/bus/virtio/devices' or return;
+ map {
+ print basename($_)."\n";
+ { device => "/dev/".basename($_), info => "VirtIO block device", media_type => 'hd', bus => 'virtio' }
+ }
+ glob("/sys/bus/virtio/devices/*/block/*");
+}
# cpu_name : arch() =~ /^alpha/ ? "cpu " :
# arch() =~ /^ppc/ ? "processor" : "vendor_id"