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 <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2012-10-15 09:30:59 +02:00
parent bd2d80b2b7
commit 2274ae9d1a
2 changed files with 15 additions and 6 deletions

View file

@ -75,6 +75,7 @@ struct CharDriverState {
char *filename;
int opened;
int avail_connections;
QemuOpts *opts;
QTAILQ_ENTRY(CharDriverState) next;
};