From patchwork Fri Apr 25 14:22:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 29083 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C4DF3202E6 for ; Fri, 25 Apr 2014 14:36:38 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id i17sf13510090qcy.11 for ; Fri, 25 Apr 2014 07:36:38 -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=WfzSI5kftOTWpjOtcFnXQTEeqnQ4Tn7WWPIb0OtlPDs=; b=T6S2LJ+QhEXpkx1nTsE2Q8ufKCjIslCTi//Wy1jx7qMTsOP+HZOy4J7jwty9fqq4lf F/1mzwbJ/8hwQq/nQ8tyDGVAn5Rj/93vQXfX/uWLlXa8FnxuCMscSC0L4uq+Ut98QGSM eRbSZns0qKrP8Myz+gfYLMGgZizPN/AFkCiOA5vwY7NohteOge/dCgkmM62yePrkYRG7 uNSFY52WJ6j517w+EQULaVLk7U9yRQbwNlVftbfHGW10lh4oRHtbLkWkqc4eVg1ZMvKa Xv8N07o8j7qgQ46BNqcbeuafTITJvN3BeQtgvtaxAvjaDyZ4dAbpOoobQVN48JKcNREy d3ZQ== X-Gm-Message-State: ALoCoQlv9S2gUuQUlhgH5onNVz3DLKMLugxIQDEQwPBd81zrTt+1mi1OrHzCkOUBm1LmJZ/Hu7bn X-Received: by 10.236.43.14 with SMTP id k14mr2713176yhb.37.1398436598435; Fri, 25 Apr 2014 07:36:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.182 with SMTP id 51ls1440642qgv.38.gmail; Fri, 25 Apr 2014 07:36:38 -0700 (PDT) X-Received: by 10.58.243.72 with SMTP id ww8mr102866vec.49.1398436598237; Fri, 25 Apr 2014 07:36:38 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id pu9si1740043vec.155.2014.04.25.07.36.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Apr 2014 07:36:38 -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.176; Received: by mail-vc0-f176.google.com with SMTP id lc6so4779464vcb.7 for ; Fri, 25 Apr 2014 07:36:37 -0700 (PDT) X-Received: by 10.220.89.4 with SMTP id c4mr92730vcm.53.1398436597920; Fri, 25 Apr 2014 07:36:37 -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 ib8csp102836vcb; Fri, 25 Apr 2014 07:36:37 -0700 (PDT) X-Received: by 10.58.13.104 with SMTP id g8mr7061934vec.16.1398436597484; Fri, 25 Apr 2014 07:36:37 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id sn5si1736085vdc.191.2014.04.25.07.36.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 25 Apr 2014 07:36:37 -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 1WdhCi-0005CE-Ex; Fri, 25 Apr 2014 14:34:16 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WdhCg-0005C9-S5 for xen-devel@lists.xen.org; Fri, 25 Apr 2014 14:34:15 +0000 Received: from [85.158.137.68:5776] by server-4.bemta-3.messagelabs.com id A8/B2-17399-5627A535; Fri, 25 Apr 2014 14:34:13 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1398436451!127032!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9745 invoked from network); 25 Apr 2014 14:34:13 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 25 Apr 2014 14:34:13 -0000 X-IronPort-AV: E=Sophos;i="4.97,927,1389744000"; d="scan'208";a="123524831" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 25 Apr 2014 14:34:12 +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 10:34:09 -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 1Wdh1F-0002n1-VN; Fri, 25 Apr 2014 15:22:26 +0100 Received: by localhost.localdomain (sSMTP sendmail emulation); Fri, 25 Apr 2014 15:22:25 +0100 From: Ian Campbell To: , Date: Fri, 25 Apr 2014 15:22:25 +0100 Message-ID: <1398435745-10894-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] 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. Instead look for a PV console first and a serial console second, if an HVM guest has a PV console then it is a good bet that it is preferred, I think. 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 --- src/libxl/libxl_driver.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index a6ae8a1..bcf3595 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,15 @@ libxlDomainOpenConsole(virDomainPtr dom, priv = vm->privateData; - if (vm->def->nserials) + if (!chr && vm->def->nconsoles) { + chr = vm->def->consoles[0]; + console_type = LIBXL_CONSOLE_TYPE_PV; + } + + if (!chr && vm->def->nserials) { chr = vm->def->serials[0]; + console_type = LIBXL_CONSOLE_TYPE_SERIAL; + } if (!chr) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -3824,7 +3832,8 @@ libxlDomainOpenConsole(virDomainPtr dom, goto cleanup; } - ret = libxl_primary_console_get_tty(priv->ctx, vm->def->id, &console); + ret = libxl_console_get_tty(priv->ctx, vm->def->id, chr->target.port, + console_type, &console); if (ret) goto cleanup;