From nobody Thu May 2 17:18:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 151066487216693.1834209297715; Tue, 14 Nov 2017 05:07:52 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 021F67EA95; Tue, 14 Nov 2017 13:07:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87E1D17107; Tue, 14 Nov 2017 13:07:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2DA6C1800BDF; Tue, 14 Nov 2017 13:07:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAED6ccW028544 for ; Tue, 14 Nov 2017 08:06:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 878138B14B; Tue, 14 Nov 2017 13:06:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81DF18B152 for ; Tue, 14 Nov 2017 13:06:35 +0000 (UTC) Received: from mail.pronoc.net (smtp.pronoc.net [62.148.169.252]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78B964E341 for ; Tue, 14 Nov 2017 13:06:34 +0000 (UTC) Received: from 31jsimonetti1.nl.securelink.local (j245077.upc-j.chello.nl [24.132.245.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jeroen@simonetti.nl) by mail.pronoc.net (Postfix) with ESMTPSA id 312D2540113; Tue, 14 Nov 2017 13:57:58 +0100 (CET) From: Jeroen Simonetti To: libvir-list@redhat.com Date: Tue, 14 Nov 2017 13:57:53 +0100 Message-Id: <20171114125753.2582-1-jeroen@simonetti.nl> X-Virus-Scanned: clamav-milter 0.99.2 at antivirus.pronoc.net X-Virus-Status: Clean X-Greylist: Delayed for 00:08:34 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 14 Nov 2017 13:06:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 14 Nov 2017 13:06:34 +0000 (UTC) for IP:'62.148.169.252' DOMAIN:'smtp.pronoc.net' HELO:'mail.pronoc.net' FROM:'jeroen@simonetti.nl' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 62.148.169.252 smtp.pronoc.net 62.148.169.252 smtp.pronoc.net X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Jeroen Simonetti Subject: [libvirt] [PATCH go-xml] Support network backed serial interfaces X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 14 Nov 2017 13:07:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Adds network backing for a DomainChardevSource and protocol selection for serial device of type tcp. Signed-off-by: Jeroen Simonetti Reviewed-by: Daniel P. Berrange --- domain.go | 26 +++++++++++++++++--------- domain_test.go | 26 +++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/domain.go b/domain.go index f4ef35c..47e9dc6 100644 --- a/domain.go +++ b/domain.go @@ -256,9 +256,12 @@ type DomainInterface struct { } =20 type DomainChardevSource struct { - Mode string `xml:"mode,attr,omitempty"` - Path string `xml:"path,attr"` - Append string `xml:"append,attr,omitempty"` + Mode string `xml:"mode,attr,omitempty"` + Path string `xml:"path,attr,omitempty"` + Append string `xml:"append,attr,omitempty"` + Host string `xml:"host,attr,omitempty"` + Service string `xml:"service,attr,omitempty"` + TLS string `xml:"tls,attr,omitempty"` } =20 type DomainChardevTarget struct { @@ -329,12 +332,17 @@ type DomainConsole struct { } =20 type DomainSerial struct { - XMLName xml.Name `xml:"serial"` - Type string `xml:"type,attr"` - Source *DomainChardevSource `xml:"source"` - Target *DomainSerialTarget `xml:"target"` - Alias *DomainAlias `xml:"alias"` - Address *DomainAddress `xml:"address"` + XMLName xml.Name `xml:"serial"` + Type string `xml:"type,attr"` + Source *DomainChardevSource `xml:"source"` + Protocol *DomainSerialProtocol `xml:"protocol"` + Target *DomainSerialTarget `xml:"target"` + Alias *DomainAlias `xml:"alias"` + Address *DomainAddress `xml:"address"` +} + +type DomainSerialProtocol struct { + Type string `xml:"type,attr"` } =20 type DomainChannel struct { diff --git a/domain_test.go b/domain_test.go index 1ad5125..99d5022 100644 --- a/domain_test.go +++ b/domain_test.go @@ -330,6 +330,21 @@ var domainTestData =3D []struct { Port: &serialPort, }, }, + DomainSerial{ + Type: "tcp", + Source: &DomainChardevSource{ + Mode: "bind", + Host: "127.0.0.1", + Service: "1234", + TLS: "yes", + }, + Protocol: &DomainSerialProtocol{ + Type: "telnet", + }, + Target: &DomainSerialTarget{ + Port: &serialPort, + }, + }, }, Channels: []DomainChannel{ DomainChannel{ @@ -415,6 +430,11 @@ var domainTestData =3D []struct { ` `, ` `, ` `, + ` `, + ` `, + ` `, + ` `, + ` `, ` `, ` `, ` `, @@ -1725,9 +1745,9 @@ var domainTestData =3D []struct { /* Host Bootloader -- bhyve, Xen */ { Object: &Domain{ - Type: "bhyve", - Name: "test", - Bootloader: "/usr/local/sbin/grub-bhyve", + Type: "bhyve", + Name: "test", + Bootloader: "/usr/local/sbin/grub-bhyve", BootloaderArgs: "-r cd0 -m /tmp/test-device.map -M 1024M linuxguest", }, Expected: []string{ --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list