From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQ5Gv-0001Yo-3l for qemu-devel@nongnu.org; Thu, 22 Jan 2009 14:31:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQ5Gt-0001Ww-LL for qemu-devel@nongnu.org; Thu, 22 Jan 2009 14:31:24 -0500 Received: from [199.232.76.173] (port=38457 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQ5Gt-0001WL-9e for qemu-devel@nongnu.org; Thu, 22 Jan 2009 14:31:23 -0500 Received: from oxygen.pond.sub.org ([213.239.205.148]:60683) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQ5Gs-0006Ko-P9 for qemu-devel@nongnu.org; Thu, 22 Jan 2009 14:31:23 -0500 Received: from pike.pond.sub.org (pD9E3B496.dip.t-dialin.net [217.227.180.150]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 883F5276CAE for ; Thu, 22 Jan 2009 20:31:21 +0100 (CET) From: Markus Armbruster Date: Thu, 22 Jan 2009 20:31:02 +0100 Message-Id: <1232652665-1710-6-git-send-email-armbru@redhat.com> In-Reply-To: <87ocxzrvqb.fsf@pike.pond.sub.org> References: <87ocxzrvqb.fsf@pike.pond.sub.org> Subject: [Qemu-devel] [PATCH 6/9] Make drives_opt[] accessible from device initialization Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Markus Armbruster This is in preparation of pci=... support for block devices. --- sysemu.h | 10 ++++++++++ vl.c | 7 ++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/sysemu.h b/sysemu.h index 56eb9b3..79cbdf0 100644 --- a/sysemu.h +++ b/sysemu.h @@ -134,6 +134,7 @@ typedef struct DriveInfo { int bus; int unit; char serial[21]; + int drive_opt_idx; } DriveInfo; #define MAX_IDE_DEVS 2 @@ -143,6 +144,15 @@ typedef struct DriveInfo { extern int nb_drives; extern DriveInfo drives_table[MAX_DRIVES+1]; +struct drive_opt { + const char *file; + char opt[1024]; + int used; +}; + +extern struct drive_opt drives_opt[MAX_DRIVES]; +extern int nb_drives_opt; + extern int drive_get_index(BlockInterfaceType type, int bus, int unit); extern int drive_get_max_bus(BlockInterfaceType type); extern const char *drive_get_serial(BlockDriverState *bdrv); diff --git a/vl.c b/vl.c index 4c1045c..cf413c2 100644 --- a/vl.c +++ b/vl.c @@ -246,11 +246,8 @@ int alt_grab = 0; unsigned int nb_prom_envs = 0; const char *prom_envs[MAX_PROM_ENVS]; #endif -static int nb_drives_opt; -static struct drive_opt { - const char *file; - char opt[1024]; -} drives_opt[MAX_DRIVES]; +int nb_drives_opt; +struct drive_opt drives_opt[MAX_DRIVES]; static CPUState *cur_cpu; static CPUState *next_cpu; -- 1.6.0.6