#include "migration/colo.h"
#include "sysemu/kvm.h"
#include "sysemu/hax.h"
+#include "qapi/qobject-input-visitor.h"
+#include "qapi/qobject-input-visitor.h"
+#include "qapi-visit.h"
#include "qapi/qmp/qjson.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
{ .driver = "ide-hd", .flag = &default_cdrom },
{ .driver = "ide-drive", .flag = &default_cdrom },
{ .driver = "scsi-cd", .flag = &default_cdrom },
+ { .driver = "scsi-hd", .flag = &default_cdrom },
{ .driver = "virtio-serial-pci", .flag = &default_virtcon },
{ .driver = "virtio-serial", .flag = &default_virtcon },
{ .driver = "VGA", .flag = &default_vga },
info->name = g_strdup(mc->name);
info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus;
- info->hotpluggable_cpus = !!mc->query_hotpluggable_cpus;
+ info->hotpluggable_cpus = mc->has_hotpluggable_cpus;
entry = g_malloc0(sizeof(*entry));
entry->value = info;
}
if (info) {
- if (info->type == GUEST_PANIC_INFORMATION_KIND_HYPER_V) {
+ if (info->type == GUEST_PANIC_INFORMATION_TYPE_HYPER_V) {
qemu_log_mask(LOG_GUEST_ERROR, "HV crash parameters: (%#"PRIx64
" %#"PRIx64" %#"PRIx64" %#"PRIx64" %#"PRIx64")\n",
- info->u.hyper_v.data->arg1,
- info->u.hyper_v.data->arg2,
- info->u.hyper_v.data->arg3,
- info->u.hyper_v.data->arg4,
- info->u.hyper_v.data->arg5);
+ info->u.hyper_v.arg1,
+ info->u.hyper_v.arg2,
+ info->u.hyper_v.arg3,
+ info->u.hyper_v.arg4,
+ info->u.hyper_v.arg5);
}
qapi_free_GuestPanicInformation(info);
}
static void main_loop(void)
{
- bool nonblocking;
- int last_io = 0;
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
do {
- nonblocking = tcg_enabled() && last_io > 0;
#ifdef CONFIG_PROFILER
ti = profile_getclock();
#endif
- last_io = main_loop_wait(nonblocking);
+ main_loop_wait(false);
#ifdef CONFIG_PROFILER
dev_time += profile_getclock() - ti;
#endif
Error *main_loop_err = NULL;
Error *err = NULL;
bool list_data_dirs = false;
+ typedef struct BlockdevOptions_queue {
+ BlockdevOptions *bdo;
+ Location loc;
+ QSIMPLEQ_ENTRY(BlockdevOptions_queue) entry;
+ } BlockdevOptions_queue;
+ QSIMPLEQ_HEAD(, BlockdevOptions_queue) bdo_queue
+ = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
module_call_init(MODULE_INIT_TRACE);
qemu_init_exec_dir(argv[0]);
module_call_init(MODULE_INIT_QOM);
- module_call_init(MODULE_INIT_QAPI);
+ monitor_init_qmp_commands();
qemu_add_opts(&qemu_drive_opts);
qemu_add_drive_opts(&qemu_legacy_drive_opts);
drive_add(IF_DEFAULT, popt->index - QEMU_OPTION_hda, optarg,
HD_OPTS);
break;
+ case QEMU_OPTION_blockdev:
+ {
+ Visitor *v;
+ BlockdevOptions_queue *bdo;
+
+ v = qobject_input_visitor_new_str(optarg, "driver", &err);
+ if (!v) {
+ error_report_err(err);
+ exit(1);
+ }
+
+ bdo = g_new(BlockdevOptions_queue, 1);
+ visit_type_BlockdevOptions(v, NULL, &bdo->bdo,
+ &error_fatal);
+ visit_free(v);
+ loc_save(&bdo->loc);
+ QSIMPLEQ_INSERT_TAIL(&bdo_queue, bdo, entry);
+ break;
+ }
case QEMU_OPTION_drive:
if (drive_def(optarg) == NULL) {
exit(1);
replay_configure(icount_opts);
- qemu_tcg_configure(accel_opts, &error_fatal);
-
machine_class = select_machine();
set_memory_options(&ram_slots, &maxram_size, machine_class);
if (!tcg_enabled()) {
error_report("-icount is not allowed with hardware virtualization");
exit(1);
- } else if (qemu_tcg_mttcg_enabled()) {
- error_report("-icount does not currently work with MTTCG");
- exit(1);
}
configure_icount(icount_opts, &error_abort);
qemu_opts_del(icount_opts);
}
+ qemu_tcg_configure(accel_opts, &error_fatal);
+
if (default_net) {
QemuOptsList *net = qemu_find_opts("net");
qemu_opts_set(net, NULL, "type", "nic", &error_abort);
}
/* open the virtual block devices */
+ while (!QSIMPLEQ_EMPTY(&bdo_queue)) {
+ BlockdevOptions_queue *bdo = QSIMPLEQ_FIRST(&bdo_queue);
+
+ QSIMPLEQ_REMOVE_HEAD(&bdo_queue, entry);
+ loc_push_restore(&bdo->loc);
+ qmp_blockdev_add(bdo->bdo, &error_fatal);
+ loc_pop(&bdo->loc);
+ qapi_free_BlockdevOptions(bdo->bdo);
+ g_free(bdo);
+ }
if (snapshot || replay_mode != REPLAY_MODE_NONE) {
qemu_opts_foreach(qemu_find_opts("drive"), drive_enable_snapshot,
NULL, NULL);