From patchwork Fri Apr 25 15:54:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 29089 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 595D7203AC for ; Fri, 25 Apr 2014 15:57:17 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id q108sf9126149qgd.3 for ; Fri, 25 Apr 2014 08:57:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=fDH8ZKDA6T5x/fpNnBmXasdHD/Hd5QtlB31HcLXLOro=; b=EGenTHtmPRPnzbqA/w9Imyn/5bLdriomBKi66An7litnQk+GzmOde6tJm7ItRzKojt Z0dpu7QbTyqaW9BDbNyREMrO2inADHWmyiDqqMvRuOou4bhnS/cPHHNEb0+Z/Awq3AN1 kjbULhqHizm7+AHzyD7rGKRqu1HIv5FYxHixmgVcHLw85ZJjokb2RYRmmURMfD/XoH9u Am5PCoqU+OJ+v5obDK36gSYDMuEiwAdqM0xrkX+7h/6IbB9fPxCQhXOfDsnGdwbh3NEF IOGZWt8ImAvEk15Z6fp+ygwTGpVMjsof/eQTIAp2395HLK9tpr3Z0Ya93PkDIjboDcZn grDQ== X-Gm-Message-State: ALoCoQnHaxHj7nG6tODZotK3M8iml1rg8GlyTwkkM90Ko1U9b7PO9GNkix0Zx+s5+CDNoJo2WHK/ X-Received: by 10.236.45.41 with SMTP id o29mr4385097yhb.13.1398441437105; Fri, 25 Apr 2014 08:57:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.182 with SMTP id l51ls1554134qgf.33.gmail; Fri, 25 Apr 2014 08:57:16 -0700 (PDT) X-Received: by 10.220.105.4 with SMTP id r4mr2125179vco.27.1398441436739; Fri, 25 Apr 2014 08:57:16 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id cm9si1797716vcb.46.2014.04.25.08.57.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Apr 2014 08:57:16 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id if17so4937933vcb.8 for ; Fri, 25 Apr 2014 08:57:16 -0700 (PDT) X-Received: by 10.58.132.228 with SMTP id ox4mr360450veb.54.1398441436667; Fri, 25 Apr 2014 08:57:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp108560vcb; Fri, 25 Apr 2014 08:57:16 -0700 (PDT) X-Received: by 10.52.65.132 with SMTP id x4mr1494253vds.36.1398441436147; Fri, 25 Apr 2014 08:57:16 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id x18si1789828vcs.193.2014.04.25.08.57.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 25 Apr 2014 08:57:16 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WdiTR-0000Z8-90; Fri, 25 Apr 2014 15:55:37 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WdiTP-0000Yn-D3 for xen-devel@lists.xen.org; Fri, 25 Apr 2014 15:55:35 +0000 Received: from [193.109.254.147:12744] by server-1.bemta-14.messagelabs.com id DF/0C-00839-6758A535; Fri, 25 Apr 2014 15:55:34 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1398441332!932012!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14877 invoked from network); 25 Apr 2014 15:55:33 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 25 Apr 2014 15:55:33 -0000 X-IronPort-AV: E=Sophos;i="4.97,927,1389744000"; d="scan'208";a="124628980" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 25 Apr 2014 15:54:22 +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.3.123.3; Fri, 25 Apr 2014 11:54:21 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=localhost.localdomain) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1WdiSC-000598-RY; Fri, 25 Apr 2014 16:54:21 +0100 Received: by localhost.localdomain (sSMTP sendmail emulation); Fri, 25 Apr 2014 16:54:20 +0100 From: Ian Campbell To: , Date: Fri, 25 Apr 2014 16:54:20 +0100 Message-ID: <1398441260-19568-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-DLP: MIA1 Cc: Dario Faggioli , Jim Fehlig , Clark Laughlin , Ian Campbell Subject: [Xen-devel] [PATCH v2] libxl: Support PV consoles X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Currently the driver only exposes the ability to connect to the serial console of a Xen guest, which doesn't work for a PV guest. Since for an HVM guest the serial devices are duplicated as consoles it is sufficient to just use the console devices unconditionally. Tested with the following bit of config XML: ... I have observed and tested this on ARM but I believe it also applies to x86 PV guests. Signed-off-by: Ian Campbell Cc: Jim Fehlig Cc: Dario Faggioli Cc: Clark Laughlin --- v2: Just use nconsoles unconditionally, they contain serial too --- src/libxl/libxl_driver.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index a6ae8a1..535e7da 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -3780,6 +3780,7 @@ libxlDomainOpenConsole(virDomainPtr dom, { virDomainObjPtr vm = NULL; int ret = -1; + libxl_console_type console_type = LIBXL_CONSOLE_TYPE_UNKNOWN; virDomainChrDefPtr chr = NULL; libxlDomainObjPrivatePtr priv; char *console = NULL; @@ -3807,8 +3808,8 @@ libxlDomainOpenConsole(virDomainPtr dom, priv = vm->privateData; - if (vm->def->nserials) - chr = vm->def->serials[0]; + if (vm->def->nconsoles) + chr = vm->def->consoles[0]; if (!chr) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -3824,7 +3825,12 @@ libxlDomainOpenConsole(virDomainPtr dom, goto cleanup; } - ret = libxl_primary_console_get_tty(priv->ctx, vm->def->id, &console); + console_type = + (chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL ? + LIBXL_CONSOLE_TYPE_SERIAL : LIBXL_CONSOLE_TYPE_PV); + + ret = libxl_console_get_tty(priv->ctx, vm->def->id, chr->target.port, + console_type, &console); if (ret) goto cleanup;