diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-12-24 17:12:43 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-12-24 17:12:43 +0000 |
commit | fa1fb14cd2f4f24e158b1bb284bd193e79899575 (patch) | |
tree | 8a38b3800d1f3a13153ef0f1b4b08761d82039b3 /vl.c | |
parent | 1f9584496747480020bb93ee1582d104f877ce0a (diff) |
Fix SCSI cdrom boot, thanks Blue Swirl.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2278 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -3925,8 +3925,12 @@ static int disk_options_init(int num_ide_disks, for(i = 0; i < num_scsi_disks; i++) { +#if !defined(TARGET_SPARC) || defined(TARGET_SPARC64) temp_adapter = SCSI_LSI_53C895A; scsi_hba_lsi++; +#else + temp_adapter = SCSI_ESP; +#endif /*Check for sdx= parameter */ if (get_param_value(buf, sizeof(buf), "sdx", scsi_disk_options[i])) { @@ -3999,6 +4003,9 @@ static int disk_options_init(int num_ide_disks, fprintf(stderr, "qemu: SCSI disk image not specified for sd%c \n", i + 'a'); return -1; } + if (cdrom_device) { + bdrv_set_type_hint(bs_scsi_table[scsi_index], BDRV_TYPE_CDROM); + } } return 0; @@ -6887,6 +6894,8 @@ int main(int argc, char **argv) kernel_cmdline = optarg; break; case QEMU_OPTION_cdrom: +#if !defined(TARGET_SPARC) || defined(TARGET_SPARC64) + /* Assume boot cdrom is IDE */ { char buf[22]; if (num_ide_disks >= MAX_DISKS) { @@ -6904,6 +6913,27 @@ int main(int argc, char **argv) optarg); num_ide_disks++; } +#else + /* Assume boot cdrom is SCSI */ + { + char buf[27]; + if (num_scsi_disks >= MAX_SCSI_DISKS) { + fprintf(stderr, "qemu: too many SCSI disks/cdroms defined.\n"); + exit(1); + } + snprintf(buf, sizeof(buf), "type=cdrom,sdx=%c,id=%d,img=", + num_scsi_disks + 'a', num_scsi_disks + 2); + /* Build new disk SCSI syntax string */ + pstrcpy(scsi_options[num_scsi_disks], + 27, + buf); + /* Add on image filename */ + pstrcpy(&(scsi_options[num_scsi_disks][26]), + sizeof(scsi_options[0])-26, + optarg); + num_scsi_disks++; + } +#endif break; case QEMU_OPTION_boot: boot_device = optarg[0]; @@ -7193,6 +7223,7 @@ int main(int argc, char **argv) if (!linux_boot && num_ide_disks == 0 && + num_scsi_disks == 0 && fd_filename[0] == '\0') help(); |