static CPUState *cur_cpu;
static CPUState *next_cpu;
static int event_pending = 1;
-/* Conversion factor from emulated instrctions to virtual clock ticks. */
+/* Conversion factor from emulated instructions to virtual clock ticks. */
static int icount_time_shift;
-/* Arbitrarily pick 1MIPS as the minimum alowable speed. */
+/* Arbitrarily pick 1MIPS as the minimum allowable speed. */
#define MAX_ICOUNT_SHIFT 10
/* Compensate for varying guest execution speed. */
static int64_t qemu_icount_bias;
#endif /* _WIN32 */
/* Correlation between real and virtual time is always going to be
- farly approximate, so ignore small variation.
+ fairly approximate, so ignore small variation.
When the guest is idle real and virtual time will be aligned in
the IO wait loop. */
#define ICOUNT_WOBBLE (QEMU_TIMER_BASE / 10)
static SaveStateEntry *first_se;
+/* TODO: Individual devices generally have very little idea about the rest
+ of the system, so instance_id should be removed/replaced. */
int register_savevm(const char *idstr,
int instance_id,
int version_id,
if (!se)
return -1;
pstrcpy(se->idstr, sizeof(se->idstr), idstr);
- se->instance_id = instance_id;
+ se->instance_id = (instance_id == -1) ? 0 : instance_id;
se->version_id = version_id;
se->save_state = save_state;
se->load_state = load_state;
/* add at the end of list */
pse = &first_se;
- while (*pse != NULL)
+ while (*pse != NULL) {
+ if (instance_id == -1
+ && strcmp(se->idstr, (*pse)->idstr) == 0
+ && se->instance_id <= (*pse)->instance_id)
+ se->instance_id = (*pse)->instance_id + 1;
pse = &(*pse)->next;
+ }
*pse = se;
return 0;
}
if (use_icount == 1) {
/* When not using an adaptive execution frequency
we tend to get badly out of sync with real time,
- so just delay for a resonable amount of time. */
+ so just delay for a reasonable amount of time. */
delta = 0;
} else {
delta = cpu_get_icount() - cpu_get_clock();
kernel_cmdline = "";
cyls = heads = secs = 0;
translation = BIOS_ATA_TRANSLATION_AUTO;
- monitor_device = "vc:800x600";
+ monitor_device = "vc";
serial_devices[0] = "vc:80Cx24C";
for(i = 1; i < MAX_SERIAL_PORTS; i++)
nb_drives_opt == 0)
help(1);
+ if (!linux_boot && *kernel_cmdline != '\0') {
+ fprintf(stderr, "-append only allowed with -kernel option\n");
+ exit(1);
+ }
+
+ if (!linux_boot && initrd_filename != NULL) {
+ fprintf(stderr, "-initrd only allowed with -kernel option\n");
+ exit(1);
+ }
+
/* boot to floppy or the default cd if no hard disk defined yet */
if (!boot_devices[0]) {
boot_devices = "cad";