From patchwork Mon Dec 7 12:42:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40480 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 5CAA5B6F14 for ; Tue, 8 Dec 2009 00:00:09 +1100 (EST) Received: from localhost ([127.0.0.1]:51302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHdCA-0003JN-Ip for incoming@patchwork.ozlabs.org; Mon, 07 Dec 2009 08:00:06 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHcwp-0005M7-4n for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHcwk-0005IC-1D for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:13 -0500 Received: from [199.232.76.173] (port=58678 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHcwj-0005I1-ES for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42824) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHcwj-0000gT-1V for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:09 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB7Ci8Rp028907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Dec 2009 07:44:08 -0500 Received: from zweiblum.home.kraxel.org (vpn2-8-247.ams2.redhat.com [10.36.8.247]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB7Ci4J8031588; Mon, 7 Dec 2009 07:44:05 -0500 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id AA2E270112; Mon, 7 Dec 2009 13:43:59 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 7 Dec 2009 13:42:44 +0100 Message-Id: <1260189773-20728-13-git-send-email-kraxel@redhat.com> In-Reply-To: <1260189773-20728-1-git-send-email-kraxel@redhat.com> References: <1260189773-20728-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 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 v3 12/21] 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 f30da12..8071868 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; @@ -5466,6 +5467,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: @@ -5695,14 +5697,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)