Revision a1bb27b1 vl.c
b/vl.c | ||
---|---|---|
138 | 138 |
/* Note: bs_table[MAX_DISKS] is a dummy block driver if none available |
139 | 139 |
to store the VM snapshots */ |
140 | 140 |
BlockDriverState *bs_table[MAX_DISKS + 1], *fd_table[MAX_FD]; |
141 |
BlockDriverState *sd_bdrv; |
|
141 | 142 |
/* point to the block driver where the snapshots are managed */ |
142 | 143 |
BlockDriverState *bs_snapshots; |
143 | 144 |
int vga_ram_size; |
... | ... | |
6345 | 6346 |
"-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n" |
6346 | 6347 |
"-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n" |
6347 | 6348 |
"-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n" |
6349 |
"-sd file use 'file' as SecureDigital card image\n" |
|
6348 | 6350 |
"-boot [a|c|d|n] boot on floppy (a), hard disk (c), CD-ROM (d), or network (n)\n" |
6349 | 6351 |
"-snapshot write to temporary files instead of disk image files\n" |
6350 | 6352 |
#ifdef CONFIG_SDL |
... | ... | |
6482 | 6484 |
QEMU_OPTION_hdc, |
6483 | 6485 |
QEMU_OPTION_hdd, |
6484 | 6486 |
QEMU_OPTION_cdrom, |
6487 |
QEMU_OPTION_sd, |
|
6485 | 6488 |
QEMU_OPTION_boot, |
6486 | 6489 |
QEMU_OPTION_snapshot, |
6487 | 6490 |
#ifdef TARGET_I386 |
... | ... | |
6560 | 6563 |
{ "hdc", HAS_ARG, QEMU_OPTION_hdc }, |
6561 | 6564 |
{ "hdd", HAS_ARG, QEMU_OPTION_hdd }, |
6562 | 6565 |
{ "cdrom", HAS_ARG, QEMU_OPTION_cdrom }, |
6566 |
{ "sd", HAS_ARG, QEMU_OPTION_sd }, |
|
6563 | 6567 |
{ "boot", HAS_ARG, QEMU_OPTION_boot }, |
6564 | 6568 |
{ "snapshot", 0, QEMU_OPTION_snapshot }, |
6565 | 6569 |
#ifdef TARGET_I386 |
... | ... | |
6847 | 6851 |
int snapshot, linux_boot; |
6848 | 6852 |
const char *initrd_filename; |
6849 | 6853 |
const char *hd_filename[MAX_DISKS], *fd_filename[MAX_FD]; |
6854 |
const char *sd_filename; |
|
6850 | 6855 |
const char *kernel_filename, *kernel_cmdline; |
6851 | 6856 |
DisplayState *ds = &display_state; |
6852 | 6857 |
int cyls, heads, secs, translation; |
... | ... | |
6907 | 6912 |
fd_filename[i] = NULL; |
6908 | 6913 |
for(i = 0; i < MAX_DISKS; i++) |
6909 | 6914 |
hd_filename[i] = NULL; |
6915 |
sd_filename = NULL; |
|
6910 | 6916 |
ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; |
6911 | 6917 |
vga_ram_size = VGA_RAM_SIZE; |
6912 | 6918 |
#ifdef CONFIG_GDBSTUB |
... | ... | |
7025 | 7031 |
cdrom_index = -1; |
7026 | 7032 |
} |
7027 | 7033 |
break; |
7034 |
case QEMU_OPTION_sd: |
|
7035 |
sd_filename = optarg; |
|
7036 |
break; |
|
7028 | 7037 |
case QEMU_OPTION_snapshot: |
7029 | 7038 |
snapshot = 1; |
7030 | 7039 |
break; |
... | ... | |
7523 | 7532 |
fd_table[i] = bdrv_new(buf); |
7524 | 7533 |
bdrv_set_type_hint(fd_table[i], BDRV_TYPE_FLOPPY); |
7525 | 7534 |
} |
7526 |
if (fd_filename[i] != '\0') { |
|
7535 |
if (fd_filename[i][0] != '\0') {
|
|
7527 | 7536 |
if (bdrv_open(fd_table[i], fd_filename[i], |
7528 | 7537 |
snapshot ? BDRV_O_SNAPSHOT : 0) < 0) { |
7529 | 7538 |
fprintf(stderr, "qemu: could not open floppy disk image '%s'\n", |
... | ... | |
7534 | 7543 |
} |
7535 | 7544 |
} |
7536 | 7545 |
|
7546 |
sd_bdrv = bdrv_new ("sd"); |
|
7547 |
/* FIXME: This isn't really a floppy, but it's a reasonable |
|
7548 |
approximation. */ |
|
7549 |
bdrv_set_type_hint(sd_bdrv, BDRV_TYPE_FLOPPY); |
|
7550 |
if (sd_filename) { |
|
7551 |
if (bdrv_open(sd_bdrv, sd_filename, |
|
7552 |
snapshot ? BDRV_O_SNAPSHOT : 0) < 0) { |
|
7553 |
fprintf(stderr, "qemu: could not open SD card image %s\n", |
|
7554 |
sd_filename); |
|
7555 |
} |
|
7556 |
} |
|
7557 |
|
|
7537 | 7558 |
register_savevm("timer", 0, 2, timer_save, timer_load, NULL); |
7538 | 7559 |
register_savevm("ram", 0, 2, ram_save, ram_load, NULL); |
7539 | 7560 |
|
Also available in: Unified diff