Patchwork [8/9] default devices: drives

login
register
mail settings
Submitter Gerd Hoffmann
Date Nov. 17, 2009, 9:38 a.m.
Message ID <1258450699-24445-9-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/38601/
State New
Headers show

Comments

Gerd Hoffmann - Nov. 17, 2009, 9:38 a.m.
Add defaults variable for drives.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 vl.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index 23afcc9..eb07a5b 100644
--- a/vl.c
+++ b/vl.c
@@ -275,6 +275,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;
@@ -5634,14 +5635,16 @@  int main(int argc, char **argv, char **envp)
 
     bdrv_init_with_whitelist();
 
-    /* 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)