qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH 1/3] qemu_chr_new_from_opts: do not overwrite existing chr->filename
Date: Mon, 27 May 2013 19:13:40 +0100	[thread overview]
Message-ID: <1369678422-658-1-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1305271906480.4799@kaball.uk.xensource.com>

Set the new filename only if it hasn't been already set (for example by
qemu_chr_open_pty).

This fixes a regression that prevents Xen HVM domains from booting.
It was introduced by:

commit 2b220025993e76d4116781ca91a4fabc5ad9c722
Author: Lei Li <lilei@linux.vnet.ibm.com>
Date:   Tue May 21 18:27:59 2013 +0800

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 qemu-char.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 4f8382e..06ffd93 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3276,7 +3276,6 @@ 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);
@@ -3309,7 +3308,9 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts,
         }
 
         chr = qemu_chr_find(id);
-        chr->filename = filename;
+        if (!chr->filename) {
+            chr->filename = g_strdup(qemu_opt_get(opts, "backend"));
+        }
 
     qapi_out:
         qapi_free_ChardevBackend(backend);
-- 
1.7.2.5

  reply	other threads:[~2013-05-27 18:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27 18:13 [Qemu-devel] [PATCH 0/3] Xen related fixes Stefano Stabellini
2013-05-27 18:13 ` Stefano Stabellini [this message]
2013-05-28  6:37   ` [Qemu-devel] [PATCH 1/3] qemu_chr_new_from_opts: do not overwrite existing chr->filename Gerd Hoffmann
2013-05-28 10:43     ` Stefano Stabellini
2013-05-28 10:44   ` Stefano Stabellini
2013-05-27 18:13 ` [Qemu-devel] [PATCH 2/3] xen: simplify xen_enabled Stefano Stabellini
2013-05-27 18:13 ` [Qemu-devel] [PATCH 3/3] main_loop: do not set nonblocking if xen_enabled() Stefano Stabellini

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=1369678422-658-1-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=anthony.perard@citrix.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xen-devel@lists.xensource.com \
    /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).