allow passing null machine pointer to drive_init().
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 31 Aug 2009 12:23:57 +0000 (14:23 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 9 Sep 2009 19:55:17 +0000 (14:55 -0500)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

vl.c

diff --git a/vl.c b/vl.c
index 098daaa..ff0e543 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1928,7 +1928,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
     translation = BIOS_ATA_TRANSLATION_AUTO;
     cache = 1;
 
-    if (machine->use_scsi) {
+    if (machine && machine->use_scsi) {
         type = IF_SCSI;
         max_devs = MAX_SCSI_DEVS;
         pstrcpy(devname, sizeof(devname), "scsi");