[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 25/28] blockdev: New drive_get_by_index()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 25/28] blockdev: New drive_get_by_index() |
Date: |
Mon, 31 Jan 2011 16:29:13 +0100 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockdev.c | 7 +++++++
blockdev.h | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index a42c5e4..01228f6 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -136,6 +136,13 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int
unit)
return NULL;
}
+DriveInfo *drive_get_by_index(BlockInterfaceType type, int index)
+{
+ return drive_get(type,
+ drive_index_to_bus_id(type, index),
+ drive_index_to_unit_id(type, index));
+}
+
int drive_get_max_bus(BlockInterfaceType type)
{
int max_bus;
diff --git a/blockdev.h b/blockdev.h
index 0c01e08..18278cc 100644
--- a/blockdev.h
+++ b/blockdev.h
@@ -39,6 +39,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);
DriveInfo *drive_get_next(BlockInterfaceType type);
void drive_uninit(DriveInfo *dinfo);
--
1.7.2.3
- [Qemu-devel] [PATCH 08/28] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD, (continued)
- [Qemu-devel] [PATCH 08/28] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 10/28] ahci: Fix cpu_physical_memory_unmap() argument ordering, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 18/28] qcow2-refcount: remove write-only variables, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 15/28] qed: Images with backing file do not require QED_F_NEED_CHECK, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 11/28] Reorganize struct Qcow2Cache for better struct packing, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 14/28] qcow2: Add bdrv_discard support, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 17/28] scsi hotplug: Set DriveInfo member bus correctly, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 16/28] raw-win32: Fix bdrv_flush return value, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 24/28] blockdev: Factor drive_index_to_{bus, unit}_id out of drive_init(), Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 27/28] blockdev: Replace drive_add()'s fmt, ... by optstr parameter, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 25/28] blockdev: New drive_get_by_index(),
Kevin Wolf <=
- [Qemu-devel] [PATCH 28/28] blockdev: Fix drive_add for drives without media, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 19/28] blockdev: New drive_get_next(), replacing qdev_init_bdrv(), Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 06/28] block: tell drivers about an image resize, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 21/28] blockdev: Put BlockInterfaceType names and max_devs in tables, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 13/28] qemu-io: Fix discard command, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 23/28] blockdev: Make drive_add() take explicit type, index parameters, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 20/28] blockdev: Move BlockInterfaceType from qemu-common.h to blockdev.h, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 09/28] Add documentation for STRTOSZ_DEFSUFFIX_ macros, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 26/28] blockdev: Reject multiple definitions for the same drive, Kevin Wolf, 2011/01/31
- [Qemu-devel] [PATCH 22/28] blockdev: Fix regression in -drive if=scsi, index=N, Kevin Wolf, 2011/01/31