static int default_floppy = 1;
static int default_cdrom = 1;
static int default_sdcard = 1;
+static int default_vga = 1;
static struct {
const char *driver;
{ .driver = "virtio-serial-pci", .flag = &default_virtcon },
{ .driver = "virtio-serial-s390", .flag = &default_virtcon },
{ .driver = "virtio-serial", .flag = &default_virtcon },
+ { .driver = "VGA", .flag = &default_vga },
+ { .driver = "isa-vga", .flag = &default_vga },
+ { .driver = "cirrus-vga", .flag = &default_vga },
+ { .driver = "isa-cirrus-vga", .flag = &default_vga },
+ { .driver = "vmware-svga", .flag = &default_vga },
+ { .driver = "qxl-vga", .flag = &default_vga },
};
static void res_free(void)
{ RUN_STATE_SHUTDOWN, RUN_STATE_PAUSED },
{ RUN_STATE_SHUTDOWN, RUN_STATE_FINISH_MIGRATE },
+ { RUN_STATE_DEBUG, RUN_STATE_SUSPENDED },
+ { RUN_STATE_RUNNING, RUN_STATE_SUSPENDED },
+ { RUN_STATE_SUSPENDED, RUN_STATE_RUNNING },
+ { RUN_STATE_SUSPENDED, RUN_STATE_FINISH_MIGRATE },
+
{ RUN_STATE_WATCHDOG, RUN_STATE_RUNNING },
{ RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE },
static int powerdown_requested;
static int debug_requested;
static int suspend_requested;
-static bool is_suspended;
static NotifierList suspend_notifiers =
NOTIFIER_LIST_INITIALIZER(suspend_notifiers);
static NotifierList wakeup_notifiers =
{
pause_all_vcpus();
notifier_list_notify(&suspend_notifiers, NULL);
+ runstate_set(RUN_STATE_SUSPENDED);
monitor_protocol_event(QEVENT_SUSPEND, NULL);
- is_suspended = true;
}
void qemu_system_suspend_request(void)
{
- if (is_suspended) {
+ if (runstate_check(RUN_STATE_SUSPENDED)) {
return;
}
suspend_requested = 1;
void qemu_system_wakeup_request(WakeupReason reason)
{
- if (!is_suspended) {
+ if (!runstate_check(RUN_STATE_SUSPENDED)) {
return;
}
if (!(wakeup_reason_mask & (1 << reason))) {
return;
}
+ runstate_set(RUN_STATE_RUNNING);
monitor_protocol_event(QEVENT_WAKEUP, NULL);
notifier_list_notify(&wakeup_notifiers, &reason);
reset_requested = 1;
qemu_notify_event();
- is_suspended = false;
}
void qemu_system_wakeup_enable(WakeupReason reason, bool enabled)
const char *loadvm = NULL;
QEMUMachine *machine;
const char *cpu_model;
- const char *vga_model = NULL;
+ const char *vga_model = "none";
const char *pid_file = NULL;
const char *incoming = NULL;
#ifdef CONFIG_VNC
int show_vnc_port = 0;
#endif
- int defconfig = 1;
+ bool defconfig = true;
+ bool userconfig = true;
const char *log_mask = NULL;
const char *log_file = NULL;
GMemVTable mem_trace = {
popt = lookup_opt(argc, argv, &optarg, &optind);
switch (popt->index) {
case QEMU_OPTION_nodefconfig:
- defconfig=0;
+ defconfig = false;
+ break;
+ case QEMU_OPTION_nouserconfig:
+ userconfig = false;
break;
}
}
if (defconfig) {
int ret;
-
- ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf");
- if (ret < 0 && ret != -ENOENT) {
- exit(1);
- }
-
- ret = qemu_read_config_file(arch_config_name);
- if (ret < 0 && ret != -ENOENT) {
+ ret = qemu_read_default_config_files(userconfig);
+ if (ret < 0) {
exit(1);
}
}
break;
case QEMU_OPTION_vga:
vga_model = optarg;
+ default_vga = 0;
break;
case QEMU_OPTION_g:
{
default_floppy = 0;
default_cdrom = 0;
default_sdcard = 0;
- vga_model = "none";
+ default_vga = 0;
break;
case QEMU_OPTION_xen_domid:
if (!(xen_available())) {
if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
exit(1);
- /* must be after qdev registration but before machine init */
- if (vga_model) {
- select_vgahw(vga_model);
- } else if (cirrus_vga_available()) {
- select_vgahw("cirrus");
- } else {
- select_vgahw("none");
+ /* If no default VGA is requested, the default is "none". */
+ if (default_vga && cirrus_vga_available()) {
+ vga_model = "cirrus";
}
+ select_vgahw(vga_model);
if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, 0) != 0)
exit(0);
}
if (incoming) {
- int ret = qemu_start_incoming_migration(incoming);
+ Error *errp = NULL;
+ int ret = qemu_start_incoming_migration(incoming, &errp);
if (ret < 0) {
+ if (error_is_set(&errp)) {
+ fprintf(stderr, "Migrate: %s\n", error_get_pretty(errp));
+ error_free(errp);
+ }
fprintf(stderr, "Migration failed. Exit code %s(%d), exiting.\n",
incoming, ret);
exit(ret);