diff options
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 53 |
1 files changed, 43 insertions, 10 deletions
@@ -170,6 +170,7 @@ int main(int argc, char **argv) #include "ui/qemu-spice.h" #include "qapi/string-input-visitor.h" +#include "qom/object_interfaces.h" //#define DEBUG_NET //#define DEBUG_SLIRP @@ -545,7 +546,7 @@ QemuOpts *qemu_get_machine_opts(void) assert(list); opts = qemu_opts_find(list, NULL); if (!opts) { - opts = qemu_opts_create_nofail(list); + opts = qemu_opts_create(list, NULL, 0, &error_abort); } return opts; } @@ -591,6 +592,7 @@ typedef struct { static const RunStateTransition runstate_transitions_def[] = { /* from -> to */ { RUN_STATE_DEBUG, RUN_STATE_RUNNING }, + { RUN_STATE_DEBUG, RUN_STATE_FINISH_MIGRATE }, { RUN_STATE_INMIGRATE, RUN_STATE_RUNNING }, { RUN_STATE_INMIGRATE, RUN_STATE_PAUSED }, @@ -2254,7 +2256,8 @@ static int balloon_parse(const char *arg) return -1; } else { /* create empty opts */ - opts = qemu_opts_create_nofail(qemu_find_opts("device")); + opts = qemu_opts_create(qemu_find_opts("device"), NULL, 0, + &error_abort); } qemu_opt_set(opts, "driver", "virtio-balloon"); return 0; @@ -2514,14 +2517,14 @@ static int virtcon_parse(const char *devname) exit(1); } - bus_opts = qemu_opts_create_nofail(device); + bus_opts = qemu_opts_create(device, NULL, 0, &error_abort); if (arch_type == QEMU_ARCH_S390X) { qemu_opt_set(bus_opts, "driver", "virtio-serial-s390"); } else { qemu_opt_set(bus_opts, "driver", "virtio-serial-pci"); } - dev_opts = qemu_opts_create_nofail(device); + dev_opts = qemu_opts_create(device, NULL, 0, &error_abort); qemu_opt_set(dev_opts, "driver", "virtconsole"); snprintf(label, sizeof(label), "virtcon%d", index); @@ -2798,6 +2801,7 @@ static int object_create(QemuOpts *opts, void *opaque) { const char *type = qemu_opt_get(opts, "qom-type"); const char *id = qemu_opts_id(opts); + Error *local_err = NULL; Object *obj; g_assert(type != NULL); @@ -2809,12 +2813,31 @@ static int object_create(QemuOpts *opts, void *opaque) obj = object_new(type); if (qemu_opt_foreach(opts, object_set_property, obj, 1) < 0) { + object_unref(obj); return -1; } + if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) { + error_setg(&local_err, "object '%s' isn't supported by -object", + id); + goto out; + } + + user_creatable_complete(obj, &local_err); + if (local_err) { + goto out; + } + object_property_add_child(container_get(object_get_root(), "/objects"), - id, obj, NULL); + id, obj, &local_err); +out: + object_unref(obj); + if (local_err) { + qerror_report_err(local_err); + error_free(local_err); + return -1; + } return 0; } @@ -2922,7 +2945,7 @@ int main(int argc, char **argv, char **envp) bdrv_init_with_whitelist(); - autostart= 1; + autostart = 1; /* first pass of option parsing */ optind = 1; @@ -3380,7 +3403,8 @@ int main(int argc, char **argv, char **envp) qemu_opt_set_bool(fsdev, "readonly", qemu_opt_get_bool(opts, "readonly", 0)); - device = qemu_opts_create_nofail(qemu_find_opts("device")); + device = qemu_opts_create(qemu_find_opts("device"), NULL, 0, + &error_abort); qemu_opt_set(device, "driver", "virtio-9p-pci"); qemu_opt_set(device, "fsdev", qemu_opt_get(opts, "mount_tag")); @@ -3400,7 +3424,8 @@ int main(int argc, char **argv, char **envp) } qemu_opt_set(fsdev, "fsdriver", "synth"); - device = qemu_opts_create_nofail(qemu_find_opts("device")); + device = qemu_opts_create(qemu_find_opts("device"), NULL, 0, + &error_abort); qemu_opt_set(device, "driver", "virtio-9p-pci"); qemu_opt_set(device, "fsdev", "v_synth"); qemu_opt_set(device, "mount_tag", "v_synth"); @@ -3874,8 +3899,10 @@ int main(int argc, char **argv, char **envp) qemu_set_log(mask); } - if (!trace_backend_init(trace_events, trace_file)) { - exit(1); + if (!is_daemonized()) { + if (!trace_backend_init(trace_events, trace_file)) { + exit(1); + } } /* If no data_dir is specified then try to find it relative to the @@ -4374,6 +4401,12 @@ int main(int argc, char **argv, char **envp) os_setup_post(); + if (is_daemonized()) { + if (!trace_backend_init(trace_events, trace_file)) { + exit(1); + } + } + main_loop(); bdrv_close_all(); pause_all_vcpus(); |