From: Gerd Hoffmann <kraxel@redhat.com>
To: Lei Li <lilei@linux.vnet.ibm.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] chardev: Get filename for new qapi backend
Date: Wed, 15 May 2013 07:39:01 +0200 [thread overview]
Message-ID: <51931F75.8040107@redhat.com> (raw)
In-Reply-To: <1368589953-22455-1-git-send-email-lilei@linux.vnet.ibm.com>
On 05/15/13 05:52, Lei Li wrote:
> This patch add the filename when the new qapi backend init from opts.
>
> Commit 2c5f488293c7d0cd095635c74157c2526e2c4947 add support for
> qapi-based chardev initialization, but miss the filename of the
> char device as below:
>
> (qemu) info chardev
> parallel0: filename=(null)
> serial0: filename=(null)
> compat_monitor0: filename=(null)
> @@ -3276,6 +3276,7 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts,
> ChardevReturn *ret = NULL;
> const char *id = qemu_opts_id(opts);
> const char *bid = NULL;
> + char *filename = g_strdup(qemu_opt_get(opts, "backend"));
>
> if (qemu_opt_get_bool(opts, "mux", 0)) {
> bid = g_strdup_printf("%s-base", id);
> @@ -3308,6 +3309,7 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts,
> }
>
> chr = qemu_chr_find(id);
> + chr->filename = filename;
That should happen in qmp_chardev_add(), so filename is set consistently
for every chardev no matter how it gets created.
Take care to not overwrite filename, some functions
(qmp_chardev_open_socket for example) do set chr->filename already.
Maybe it's better to put that into the individual qmp_chardev_open_*
functions anyway.
cheers,
Gerd
next prev parent reply other threads:[~2013-05-15 5:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 3:52 [Qemu-devel] [PATCH] chardev: Get filename for new qapi backend Lei Li
2013-05-15 5:39 ` Gerd Hoffmann [this message]
2013-05-15 7:03 ` Lei Li
2013-05-15 7:26 ` Lei Li
2013-05-17 8:35 ` Lei Li
2013-05-22 22:59 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51931F75.8040107@redhat.com \
--to=kraxel@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=lilei@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).