diff options
author | Eric Blake | 2016-02-20 01:19:31 +0100 |
---|---|---|
committer | Paolo Bonzini | 2016-02-25 16:11:29 +0100 |
commit | 21a933ea33c820515f331c162c9f7053ca6f4129 (patch) | |
tree | 97336805256251c1836cc3805ac41ac9101ba97b /ui | |
parent | memory: Remove unreachable return statement (diff) | |
download | qemu-21a933ea33c820515f331c162c9f7053ca6f4129.tar.gz qemu-21a933ea33c820515f331c162c9f7053ca6f4129.tar.xz qemu-21a933ea33c820515f331c162c9f7053ca6f4129.zip |
chardev: Properly initialize ChardevCommon components
Commit d0d7708b forgot to parse logging for spice chardevs and
virtual consoles. This requires making qemu_chr_parse_common()
non-static. While at it, use a temporary variable to make the
code shorter, as well as reduce the churn when a later patch
alters the layout of simple unions.
Signed-off-by: Eric Blake <eblake@redhat.com>
CC: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1455927587-28033-2-git-send-email-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/console.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ui/console.c b/ui/console.c index b739ae9a05..7db0fd27c9 100644 --- a/ui/console.c +++ b/ui/console.c @@ -2060,31 +2060,33 @@ static void qemu_chr_parse_vc(QemuOpts *opts, ChardevBackend *backend, Error **errp) { int val; + ChardevVC *vc; - backend->u.vc = g_new0(ChardevVC, 1); + vc = backend->u.vc = g_new0(ChardevVC, 1); + qemu_chr_parse_common(opts, qapi_ChardevVC_base(vc)); val = qemu_opt_get_number(opts, "width", 0); if (val != 0) { - backend->u.vc->has_width = true; - backend->u.vc->width = val; + vc->has_width = true; + vc->width = val; } val = qemu_opt_get_number(opts, "height", 0); if (val != 0) { - backend->u.vc->has_height = true; - backend->u.vc->height = val; + vc->has_height = true; + vc->height = val; } val = qemu_opt_get_number(opts, "cols", 0); if (val != 0) { - backend->u.vc->has_cols = true; - backend->u.vc->cols = val; + vc->has_cols = true; + vc->cols = val; } val = qemu_opt_get_number(opts, "rows", 0); if (val != 0) { - backend->u.vc->has_rows = true; - backend->u.vc->rows = val; + vc->has_rows = true; + vc->rows = val; } } |