From bd2d80b2b75b36955d536564ceb593f5bdae2f12 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 15 Oct 2012 09:28:05 +0200 Subject: chardev: add error reporting for qemu_chr_new_from_opts Signed-off-by: Gerd Hoffmann --- include/char/char.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/char/char.h b/include/char/char.h index baa5d03..1952a10 100644 --- a/include/char/char.h +++ b/include/char/char.h @@ -89,7 +89,8 @@ struct CharDriverState { * Returns: a new character backend */ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts, - void (*init)(struct CharDriverState *s)); + void (*init)(struct CharDriverState *s), + Error **errp); /** * @qemu_chr_new: -- cgit v1.1 From 2274ae9d1a841c9d214b7c877d28e2f037a9b26e Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 15 Oct 2012 09:30:59 +0200 Subject: chardev: fix QemuOpts lifecycle qemu_chr_new_from_opts handles QemuOpts release now, so callers don't have to worry. It will either be saved in CharDriverState, then released in qemu_chr_delete, or in the error case released instantly. Signed-off-by: Gerd Hoffmann --- include/char/char.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/char/char.h b/include/char/char.h index 1952a10..c91ce3c 100644 --- a/include/char/char.h +++ b/include/char/char.h @@ -75,6 +75,7 @@ struct CharDriverState { char *filename; int opened; int avail_connections; + QemuOpts *opts; QTAILQ_ENTRY(CharDriverState) next; }; -- cgit v1.1