/* point to the block driver where the snapshots are managed */
BlockDriverState *bs_snapshots;
int vga_ram_size;
+enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
static DisplayState display_state;
int nographic;
int curses;
QEMUTimer *icount_rt_timer;
QEMUTimer *icount_vm_timer;
+uint8_t qemu_uuid[16];
+
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
/***********************************************************/
" use -soundhw ? to get the list of supported cards\n"
" use -soundhw all to enable all of them\n"
#endif
+ "-vga [std|cirrus|vmware]\n"
+ " select video card type\n"
"-localtime set the real time clock to local time [default=utc]\n"
"-full-screen start in full screen\n"
#ifdef TARGET_I386
"-g WxH[xDEPTH] Set the initial graphical resolution and depth\n"
#endif
"-name string set the name of the guest\n"
+ "-uuid %%08x-%%04x-%%04x-%%04x-%%012x specify machine UUID\n"
"\n"
"Network options:\n"
"-net nic[,vlan=n][,macaddr=addr][,model=type]\n"
"-no-kqemu disable KQEMU kernel module usage\n"
#endif
#ifdef TARGET_I386
- "-std-vga simulate a standard VGA card with VESA Bochs Extensions\n"
- " (default is CL-GD5446 PCI VGA)\n"
"-no-acpi disable ACPI\n"
#endif
#ifdef CONFIG_CURSES
QEMU_OPTION_bios,
QEMU_OPTION_k,
QEMU_OPTION_localtime,
- QEMU_OPTION_cirrusvga,
- QEMU_OPTION_vmsvga,
QEMU_OPTION_g,
- QEMU_OPTION_std_vga,
+ QEMU_OPTION_vga,
QEMU_OPTION_echr,
QEMU_OPTION_monitor,
QEMU_OPTION_serial,
QEMU_OPTION_startdate,
QEMU_OPTION_tb_size,
QEMU_OPTION_icount,
+ QEMU_OPTION_uuid,
};
typedef struct QEMUOption {
{ "g", 1, QEMU_OPTION_g },
#endif
{ "localtime", 0, QEMU_OPTION_localtime },
- { "std-vga", 0, QEMU_OPTION_std_vga },
+ { "vga", HAS_ARG, QEMU_OPTION_vga },
{ "echr", HAS_ARG, QEMU_OPTION_echr },
{ "monitor", HAS_ARG, QEMU_OPTION_monitor },
{ "serial", HAS_ARG, QEMU_OPTION_serial },
#ifdef CONFIG_CURSES
{ "curses", 0, QEMU_OPTION_curses },
#endif
+ { "uuid", HAS_ARG, QEMU_OPTION_uuid },
/* temporary options */
{ "usb", 0, QEMU_OPTION_usb },
- { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
- { "vmwarevga", 0, QEMU_OPTION_vmsvga },
{ "no-acpi", 0, QEMU_OPTION_no_acpi },
{ "no-reboot", 0, QEMU_OPTION_no_reboot },
{ "no-shutdown", 0, QEMU_OPTION_no_shutdown },
}
#endif
+static void select_vgahw (const char *p)
+{
+ const char *opts;
+
+ if (strstart(p, "std", &opts)) {
+ cirrus_vga_enabled = 0;
+ vmsvga_enabled = 0;
+ } else if (strstart(p, "cirrus", &opts)) {
+ cirrus_vga_enabled = 1;
+ vmsvga_enabled = 0;
+ } else if (strstart(p, "vmware", &opts)) {
+ cirrus_vga_enabled = 0;
+ vmsvga_enabled = 1;
+ } else {
+ invalid_vga:
+ fprintf(stderr, "Unknown vga type: %s\n", p);
+ exit(1);
+ }
+ while (*opts) {
+ const char *nextopt;
+
+ if (strstart(opts, ",retrace=", &nextopt)) {
+ opts = nextopt;
+ if (strstart(opts, "dumb", &nextopt))
+ vga_retrace_method = VGA_RETRACE_DUMB;
+ else if (strstart(opts, "precise", &nextopt))
+ vga_retrace_method = VGA_RETRACE_PRECISE;
+ else goto invalid_vga;
+ } else goto invalid_vga;
+ opts = nextopt;
+ }
+}
+
#ifdef _WIN32
static BOOL WINAPI qemu_ctrl_handler(DWORD type)
{
}
#endif
+static int qemu_uuid_parse(const char *str, uint8_t *uuid)
+{
+ int ret;
+
+ if(strlen(str) != 36)
+ return -1;
+
+ ret = sscanf(str, UUID_FMT, &uuid[0], &uuid[1], &uuid[2], &uuid[3],
+ &uuid[4], &uuid[5], &uuid[6], &uuid[7], &uuid[8], &uuid[9],
+ &uuid[10], &uuid[11], &uuid[12], &uuid[13], &uuid[14], &uuid[15]);
+
+ if(ret != 16)
+ return -1;
+
+ return 0;
+}
+
#define MAX_NET_CLIENTS 32
#ifndef _WIN32
case QEMU_OPTION_localtime:
rtc_utc = 0;
break;
- case QEMU_OPTION_cirrusvga:
- cirrus_vga_enabled = 1;
- vmsvga_enabled = 0;
- break;
- case QEMU_OPTION_vmsvga:
- cirrus_vga_enabled = 0;
- vmsvga_enabled = 1;
- break;
- case QEMU_OPTION_std_vga:
- cirrus_vga_enabled = 0;
- vmsvga_enabled = 0;
+ case QEMU_OPTION_vga:
+ select_vgahw (optarg);
break;
case QEMU_OPTION_g:
{
case QEMU_OPTION_show_cursor:
cursor_hide = 0;
break;
+ case QEMU_OPTION_uuid:
+ if(qemu_uuid_parse(optarg, qemu_uuid) < 0) {
+ fprintf(stderr, "Fail to parse UUID string."
+ " Wrong format.\n");
+ exit(1);
+ }
+ break;
case QEMU_OPTION_daemonize:
daemonize = 1;
break;
init_timers();
init_timer_alarm();
- qemu_aio_init();
if (use_icount && icount_time_shift < 0) {
use_icount = 2;
/* 125MIPS seems a reasonable initial guess at the guest speed.