From nobody Thu May 2 18:56:15 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 150694764207293.93736037337999; Mon, 2 Oct 2017 05:34:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B09E1356E3; Mon, 2 Oct 2017 12:34:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7CD88900D5; Mon, 2 Oct 2017 12:34:00 +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 D8E1162CF6; Mon, 2 Oct 2017 12:33:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v92CDTgA024753 for ; Mon, 2 Oct 2017 08:13:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id EEFB99081A; Mon, 2 Oct 2017 12:13:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E93D7907FB for ; Mon, 2 Oct 2017 12:13:27 +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 299F3C04AC57 for ; Mon, 2 Oct 2017 12:13:22 +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 B3CE054033B; Mon, 2 Oct 2017 14:13:20 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B09E1356E3 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=simonetti.nl Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B09E1356E3 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 299F3C04AC57 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=simonetti.nl Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jeroen@simonetti.nl DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 299F3C04AC57 From: Jeroen Simonetti To: libvir-list@redhat.com Date: Mon, 2 Oct 2017 14:13:03 +0200 Message-Id: <20171002121303.5756-1-jeroen@simonetti.nl> X-Virus-Scanned: clamav-milter 0.99.2 at antivirus.pronoc.net X-Virus-Status: Clean X-Greylist: Delayed for 02:02:35 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 02 Oct 2017 12:13:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 02 Oct 2017 12:13:22 +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.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Jeroen Simonetti Subject: [libvirt] [PATCH go-xml] extend chardev source to include networking 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 02 Oct 2017 12:34:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This will extend the DomainChardevSource to also support networked backends. Signed-off-by: Jeroen Simonetti --- domain.go | 26 +++++++++++++++++--------- domain_test.go | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/domain.go b/domain.go index 8c2cc1b..8392322 100644 --- a/domain.go +++ b/domain.go @@ -255,9 +255,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 { @@ -309,12 +312,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 4fe6bfe..a7d8348 100644 --- a/domain_test.go +++ b/domain_test.go @@ -322,6 +322,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{ @@ -385,6 +400,11 @@ var domainTestData =3D []struct { ` `, ` `, ` `, + ` `, + ` `, + ` `, + ` `, + ` `, ` `, ` `, ` `, --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list