From patchwork Mon May 10 21:55:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Herbszt X-Patchwork-Id: 52240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A9D9BB7D77 for ; Tue, 11 May 2010 07:59:31 +1000 (EST) Received: from localhost ([127.0.0.1]:52734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBb0b-0000DL-39 for incoming@patchwork.ozlabs.org; Mon, 10 May 2010 17:59:29 -0400 Received: from [140.186.70.92] (port=37058 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBay3-0007E6-Tf for qemu-devel@nongnu.org; Mon, 10 May 2010 17:56:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBay2-0006S1-U4 for qemu-devel@nongnu.org; Mon, 10 May 2010 17:56:51 -0400 Received: from mail.gmx.net ([213.165.64.20]:35874) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OBay2-0006Ri-J0 for qemu-devel@nongnu.org; Mon, 10 May 2010 17:56:50 -0400 Received: (qmail invoked by alias); 10 May 2010 21:56:48 -0000 Received: from e177081167.adsl.alicedsl.de (HELO FSCPC) [85.177.81.167] by mail.gmx.net (mp014) with SMTP; 10 May 2010 23:56:48 +0200 X-Authenticated: #310364 X-Provags-ID: V01U2FsdGVkX1/amWgBf/PaHVlJU5NaUj2yrLGsYxyRYtRtC2Y78p mDF8dRpUy8NkPb Message-ID: <080FFDF282C84044B8A8C8BA23EAE5AE@FSCPC> From: "Sebastian Herbszt" To: Date: Mon, 10 May 2010 23:55:50 +0200 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] add interface type IF_SATA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add interface type IF_SATA. Signed-off-by: Sebastian Herbszt diff --git a/sysemu.h b/sysemu.h index fa921df..b88bae9 100644 --- a/sysemu.h +++ b/sysemu.h @@ -151,7 +151,7 @@ extern unsigned int nb_prom_envs; 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; typedef enum { @@ -177,6 +177,7 @@ typedef struct DriveInfo { #define MAX_IDE_DEVS 2 #define MAX_SCSI_DEVS 7 +#define MAX_SATA_DEVS 1 #define MAX_DRIVES 32 extern QTAILQ_HEAD(drivelist, DriveInfo) drives; diff --git a/vl.c b/vl.c index 85bcc84..cd3a343 100644 --- a/vl.c +++ b/vl.c @@ -849,6 +849,9 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque, } 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; @@ -1039,7 +1042,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque, } 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", @@ -1064,6 +1067,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque, case IF_IDE: case IF_SCSI: case IF_XEN: + case IF_SATA: case IF_NONE: switch(media) { case MEDIA_DISK: