[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 1/4] blockdev: add if_get_max_devs
From: |
John Snow |
Subject: |
[Qemu-devel] [RFC 1/4] blockdev: add if_get_max_devs |
Date: |
Mon, 18 Aug 2014 18:05:17 -0400 |
Signed-off-by: John Snow <address@hidden>
---
blockdev.c | 9 +++++++++
include/sysemu/blockdev.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 48bd9a3..58da77f 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -110,6 +110,15 @@ void blockdev_auto_del(BlockDriverState *bs)
}
}
+int if_get_max_devs(BlockInterfaceType type)
+{
+ if (type >= IF_IDE && type < IF_COUNT) {
+ return if_max_devs[type];
+ }
+
+ return 0;
+}
+
static int drive_index_to_bus_id(BlockInterfaceType type, int index)
{
int max_devs = if_max_devs[type];
diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
index 23a5d10..2420abd 100644
--- a/include/sysemu/blockdev.h
+++ b/include/sysemu/blockdev.h
@@ -48,6 +48,7 @@ struct DriveInfo {
DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit);
DriveInfo *drive_get_by_index(BlockInterfaceType type, int index);
int drive_get_max_bus(BlockInterfaceType type);
+int if_get_max_devs(BlockInterfaceType type);
DriveInfo *drive_get_next(BlockInterfaceType type);
DriveInfo *drive_get_by_blockdev(BlockDriverState *bs);
--
1.9.3
- [Qemu-devel] [RFC 0/4] Adding -cdrom, -hd[abcd] and -drive file=... to Q35, John Snow, 2014/08/18
- [Qemu-devel] [RFC 1/4] blockdev: add if_get_max_devs,
John Snow <=
- [Qemu-devel] [RFC 2/4] blockdev: add IF_AHCI to support -cdrom and -hd[a-d], John Snow, 2014/08/18
- [Qemu-devel] [RFC 3/4] ide: update ide_drive_get to work with both PCI-IDE and AHCI interfaces, John Snow, 2014/08/18
- [Qemu-devel] [RFC 4/4] ahci: implement -cdrom and -hd[a-d], John Snow, 2014/08/18
- Re: [Qemu-devel] [RFC 0/4] Adding -cdrom, -hd[abcd] and -drive file=... to Q35, Markus Armbruster, 2014/08/19
Re: [Qemu-devel] [RFC 0/4] Adding -cdrom, -hd[abcd] and -drive file=... to Q35, Dr. David Alan Gilbert, 2014/08/19