summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-09-17 13:02:47 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-09-17 13:02:47 +0000
commit4cdcc4bcf4ffbca300191150e86b1b50fe3278a7 (patch)
tree571f453459c43aececd595e0e674297d22b6dc74 /perl-install/detect_devices.pm
parentcab732cea44dae8c2f10f5b7fc928939acf99153 (diff)
downloaddrakx-backup-do-not-use-4cdcc4bcf4ffbca300191150e86b1b50fe3278a7.tar
drakx-backup-do-not-use-4cdcc4bcf4ffbca300191150e86b1b50fe3278a7.tar.gz
drakx-backup-do-not-use-4cdcc4bcf4ffbca300191150e86b1b50fe3278a7.tar.bz2
drakx-backup-do-not-use-4cdcc4bcf4ffbca300191150e86b1b50fe3278a7.tar.xz
drakx-backup-do-not-use-4cdcc4bcf4ffbca300191150e86b1b50fe3278a7.zip
Handle virtio
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 3e057d28f..a4cc3d05d 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() }
@@ -366,6 +366,13 @@ sub getATARAID() {
values %l;
}
+sub getVirtIO() {
+ -d '/sys/bus/virtio/devices' or return;
+ map {
+ { device => 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"