diff options
| author | John Snow | 2014-10-01 20:19:27 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2014-10-03 11:30:33 +0200 |
| commit | d8f94e1bb275ab6a14a15220fd6afd0d04324aeb (patch) | |
| tree | b24bbaf0487f1288af282314c817c53ff3a06bed /include | |
| parent | pc/vl: Add units-per-default-bus property (diff) | |
| download | qemu-d8f94e1bb275ab6a14a15220fd6afd0d04324aeb.tar.gz qemu-d8f94e1bb275ab6a14a15220fd6afd0d04324aeb.tar.xz qemu-d8f94e1bb275ab6a14a15220fd6afd0d04324aeb.zip | |
ide: Update ide_drive_get to be HBA agnostic
Instead of duplicating the logic for the if_ide
(bus,unit) mappings, rely on the blockdev layer
for managing those mappings for us, and use the
drive_get_by_index call instead.
This allows ide_drive_get to work for AHCI HBAs
as well, and can be used in the Q35 initialization.
Lastly, change the nature of the argument to
ide_drive_get so that represents the number of
total drives we can support, and not the total
number of buses. This will prevent array overflows
if the units-per-default-bus property ever needs
to be adjusted for compatibility reasons.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1412187569-23452-5-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sysemu/blockdev.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index a4033d4c29..09716de809 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -52,6 +52,7 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit); bool drive_check_orphaned(void); DriveInfo *drive_get_by_index(BlockInterfaceType type, int index); int drive_get_max_bus(BlockInterfaceType type); +int drive_get_max_devs(BlockInterfaceType type); DriveInfo *drive_get_next(BlockInterfaceType type); DriveInfo *drive_get_by_blockdev(BlockDriverState *bs); |
