From patchwork Tue Dec 8 12:11:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40631 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 38740B7BC5 for ; Wed, 9 Dec 2009 00:11:13 +1100 (EST) Received: from localhost ([127.0.0.1]:42188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHzqQ-0007Jz-BC for incoming@patchwork.ozlabs.org; Tue, 08 Dec 2009 08:11:10 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHyvb-0005pL-Bp for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:12:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHyvT-0005kV-Pi for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:12:25 -0500 Received: from [199.232.76.173] (port=44209 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHyvS-0005k4-Ud for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:12:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46199) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHyvS-00084T-Hr for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:12:18 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB8CCH9d015542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Dec 2009 07:12:18 -0500 Received: from zweiblum.home.kraxel.org (vpn2-9-91.ams2.redhat.com [10.36.9.91]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB8CCC7n005113; Tue, 8 Dec 2009 07:12:15 -0500 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 34E1670117; Tue, 8 Dec 2009 13:11:58 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 8 Dec 2009 13:11:48 +0100 Message-Id: <1260274314-2906-17-git-send-email-kraxel@redhat.com> In-Reply-To: <1260274314-2906-1-git-send-email-kraxel@redhat.com> References: <1260274314-2906-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann , agraf@suse.de, lcapitulino@redhat.com Subject: [Qemu-devel] [FOR 0.12 PATCH v4 16/22] default devices: drives 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 a default_drive variable which specified whenever the default drives (cdrom, floppy, sd) should be created. It is cleared when the new -nodefaults switch is specified on the command line. Signed-off-by: Gerd Hoffmann --- vl.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/vl.c b/vl.c index 4825836..f64f72e 100644 --- a/vl.c +++ b/vl.c @@ -276,6 +276,7 @@ static int default_serial = 1; static int default_parallel = 1; static int default_monitor = 1; static int default_vga = 1; +static int default_drive = 1; static struct { const char *driver; @@ -5477,6 +5478,7 @@ int main(int argc, char **argv, char **envp) default_monitor = 0; default_vga = 0; default_net = 0; + default_drive = 0; break; #ifndef _WIN32 case QEMU_OPTION_chroot: @@ -5709,14 +5711,16 @@ int main(int argc, char **argv, char **envp) blk_mig_init(); - /* we always create the cdrom drive, even if no disk is there */ - drive_add(NULL, CDROM_ALIAS); + if (default_drive) { + /* we always create the cdrom drive, even if no disk is there */ + drive_add(NULL, CDROM_ALIAS); - /* we always create at least one floppy */ - drive_add(NULL, FD_ALIAS, 0); + /* we always create at least one floppy */ + drive_add(NULL, FD_ALIAS, 0); - /* we always create one sd slot, even if no card is in it */ - drive_add(NULL, SD_ALIAS); + /* we always create one sd slot, even if no card is in it */ + drive_add(NULL, SD_ALIAS); + } /* open the virtual block devices */ if (snapshot)