diff --git a/block/qcow2.c b/block/qcow2.c index 3bae2d837e754427afe8e1ceef795c41bec52b97..655799c6a0fa89dc03274d3b66d60175917963fd 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -300,7 +300,10 @@ static int qcow2_open(BlockDriverState *bs, int flags) if (!bs->read_only && s->autoclear_features != 0) { s->autoclear_features = 0; - qcow2_update_header(bs); + ret = qcow2_update_header(bs); + if (ret < 0) { + goto fail; + } } /* Check support for various header values */ diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c index 7fa2e8554032b860c8c9a4fb3f8bcb290d03e507..861e87805af61a6f13b49bf8b4aac5518c7f2763 100644 --- a/coroutine-sigaltstack.c +++ b/coroutine-sigaltstack.c @@ -226,7 +226,7 @@ static Coroutine *coroutine_new(void) * called. */ coTS->tr_called = 0; - kill(getpid(), SIGUSR2); + pthread_kill(pthread_self(), SIGUSR2); sigfillset(&sigs); sigdelset(&sigs, SIGUSR2); while (!coTS->tr_called) { diff --git a/qemu-img.c b/qemu-img.c index 5434ddc5ee22380e5da9eba9d8c1e71f3bf9d949..c8a70ffc935daee2cc91a99a562075389aa4c6db 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -712,6 +712,9 @@ static int img_convert(int argc, char **argv) out_filename = argv[argc - 1]; + /* Initialize before goto out */ + qemu_progress_init(progress, 2.0); + if (options && !strcmp(options, "?")) { ret = print_block_option_help(out_filename, out_fmt); goto out; @@ -724,7 +727,6 @@ static int img_convert(int argc, char **argv) goto out; } - qemu_progress_init(progress, 2.0); qemu_progress_print(0, 100); bs = g_malloc0(bs_n * sizeof(BlockDriverState *));