allow passing null machine pointer to drive_init().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Gerd Hoffmann 2009-08-31 14:23:57 +02:00 committed by Anthony Liguori
parent f4dbb8dd9a
commit 4d00781419
1 changed files with 1 additions and 1 deletions

2
vl.c
View File

@ -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");