From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60883 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIWT4-00034v-1b for qemu-devel@nongnu.org; Tue, 16 Nov 2010 20:05:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIWSy-0002Tt-IR for qemu-devel@nongnu.org; Tue, 16 Nov 2010 20:05:45 -0500 Received: from cantor.suse.de ([195.135.220.2]:47327 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PIWSy-0002TZ-C7 for qemu-devel@nongnu.org; Tue, 16 Nov 2010 20:05:40 -0500 From: Alexander Graf Date: Wed, 17 Nov 2010 02:05:35 +0100 Message-Id: <1289955937-24121-10-git-send-email-agraf@suse.de> In-Reply-To: <1289955937-24121-1-git-send-email-agraf@suse.de> References: <1289955937-24121-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 09/10] ahci: add -drive support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU-devel Developers Cc: tj@kernel.org, Joerg Roedel , Sebastian Herbszt , Roland Elek 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 --- 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