From patchwork Mon May 27 18:13:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 246632 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A4CA82C009D for ; Tue, 28 May 2013 04:14:43 +1000 (EST) Received: from localhost ([::1]:35436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh1wP-0005Ad-R2 for incoming@patchwork.ozlabs.org; Mon, 27 May 2013 14:14:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh1vw-00052y-83 for qemu-devel@nongnu.org; Mon, 27 May 2013 14:14:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uh1vp-0001Y8-0f for qemu-devel@nongnu.org; Mon, 27 May 2013 14:14:12 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:60953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh1vo-0001XU-Rb for qemu-devel@nongnu.org; Mon, 27 May 2013 14:14:04 -0400 X-IronPort-AV: E=Sophos;i="4.87,752,1363132800"; d="scan'208";a="26301396" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA; 27 May 2013 18:14:04 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.2.342.3; Mon, 27 May 2013 14:14:03 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Uh1vi-00080P-CF; Mon, 27 May 2013 19:13:58 +0100 From: Stefano Stabellini To: Date: Mon, 27 May 2013 19:13:40 +0100 Message-ID: <1369678422-658-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 Cc: aliguori@us.ibm.com, xen-devel@lists.xensource.com, Stefano Stabellini , 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 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Date: Tue May 21 18:27:59 2013 +0800 Signed-off-by: Stefano Stabellini --- 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);