From eca01d3a93be4041ac5858ef7676e60352e9c2ed Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 3 Dec 2013 13:00:15 +0100 Subject: vl: add missing transition debug->finish_migrate This fixes an abort if you invoke the "migrate" command while the guest is being debugged. Cc: qemu-stable@nongnu.org Cc: lcapitulino@redhat.com Signed-off-by: Paolo Bonzini Signed-off-by: Luiz Capitulino --- vl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 7511e70..0f67545 100644 --- a/vl.c +++ b/vl.c @@ -591,6 +591,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 }, -- cgit v1.1 From 28ec2598ff7d74bd9556a1786f45fc5df2aacfe1 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Dec 2013 23:21:07 +0100 Subject: qom: fix leak for objects created with -object The object must be unref-ed when its variable goes out of scope. Signed-off-by: Paolo Bonzini Reviewed-by: Igor Mammedov Tested-by: Igor Mammedov Signed-off-by: Luiz Capitulino --- vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 0f67545..2170a5e 100644 --- a/vl.c +++ b/vl.c @@ -2810,12 +2810,13 @@ 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; } object_property_add_child(container_get(object_get_root(), "/objects"), id, obj, NULL); - + object_unref(obj); return 0; } -- cgit v1.1 From 87ea75d5e135c0527c6a9dbac4317913409f28c7 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Wed, 1 Jan 2014 18:49:17 -0800 Subject: qemu-option: Remove qemu_opts_create_nofail This is a boiler-plate _nofail variant of qemu_opts_create. Remove and use error_abort in call sites. null/0 arguments needs to be added for the id and fail_if_exists fields in affected callsites due to argument inconsistency between the normal and no_fail variants. Signed-off-by: Peter Crosthwaite Reviewed-by: Markus Armbruster Signed-off-by: Luiz Capitulino --- vl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 2170a5e..b14032a 100644 --- a/vl.c +++ b/vl.c @@ -545,7 +545,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; } @@ -2255,7 +2255,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; @@ -2515,14 +2516,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); @@ -3382,7 +3383,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")); @@ -3402,7 +3404,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"); -- cgit v1.1