[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/13] ahci: add -drive support
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 09/13] ahci: add -drive support |
Date: |
Fri, 26 Nov 2010 20:17:29 +0100 |
We need to be able to spawn new AHCI drives, so let's add AHCI support
to the -drive option.
Signed-off-by: Alexander Graf <address@hidden>
---
blockdev.c | 6 +++++-
blockdev.h | 1 +
qemu-common.h | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 6cb179a..5ce90cc 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -209,6 +209,9 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi,
int *fatal_error)
} else if (!strcmp(buf, "xen")) {
type = IF_XEN;
max_devs = 0;
+ } else if (!strcmp(buf, "sata")) {
+ type = IF_SATA;
+ max_devs = MAX_SATA_DEVS;
} else if (!strcmp(buf, "none")) {
type = IF_NONE;
max_devs = 0;
@@ -402,7 +405,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi,
int *fatal_error)
} else {
/* no id supplied -> create one */
dinfo->id = qemu_mallocz(32);
- if (type == IF_IDE || type == IF_SCSI)
+ if (type == IF_IDE || type == IF_SCSI || type == IF_SATA)
mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd";
if (max_devs)
snprintf(dinfo->id, 32, "%s%i%s%i",
@@ -427,6 +430,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi,
int *fatal_error)
case IF_IDE:
case IF_SCSI:
case IF_XEN:
+ case IF_SATA:
case IF_NONE:
switch(media) {
case MEDIA_DISK:
diff --git a/blockdev.h b/blockdev.h
index 653affc..f50a15e 100644
--- a/blockdev.h
+++ b/blockdev.h
@@ -33,6 +33,7 @@ struct DriveInfo {
#define MAX_IDE_DEVS 2
#define MAX_SCSI_DEVS 7
+#define MAX_SATA_DEVS 4
DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit);
int drive_get_max_bus(BlockInterfaceType type);
diff --git a/qemu-common.h b/qemu-common.h
index b3957f1..ae1cfca 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -257,7 +257,7 @@ typedef uint64_t pcibus_t;
typedef enum {
IF_NONE,
IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XEN,
- IF_COUNT
+ IF_SATA, IF_COUNT
} BlockInterfaceType;
void cpu_exec_init_all(unsigned long tb_size);
--
1.6.0.2
- [Qemu-devel] [PATCH 00/13] AHCI emulation support v6, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 01/13] ide: split ide command interpretation off, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 07/13] pci: add ich7 pci id, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 09/13] ahci: add -drive support,
Alexander Graf <=
- [Qemu-devel] [PATCH 04/13] ide: add DMA hooks to bus ops, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 06/13] pci: add storage class for sata, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 03/13] ide: add support for ide bus ops, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 10/13] ahci: spawn controller on demand, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 05/13] ide: add ncq identify data for ahci sata drives, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 11/13] ide: move pata specific parts to pata.c, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 12/13] config: add generic pci config file, Alexander Graf, 2010/11/26
- [Qemu-devel] [PATCH 13/13] config: add ahci for pci capable machines, Alexander Graf, 2010/11/26