From nobody Thu May 2 15:21:26 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 1506940668383495.79068091408703; Mon, 2 Oct 2017 03:37:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A9A0C0587F5; Mon, 2 Oct 2017 10:37:46 +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 B498960A99; Mon, 2 Oct 2017 10:37:45 +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 0AF1818355C5; Mon, 2 Oct 2017 10:37:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v92AGN9n007527 for ; Mon, 2 Oct 2017 06:16:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id D40465EE08; Mon, 2 Oct 2017 10:16:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE7016A8EC for ; Mon, 2 Oct 2017 10:16:21 +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 2FF2A81DFE for ; Mon, 2 Oct 2017 10:16:20 +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 14E5B54033B; Mon, 2 Oct 2017 12:10:44 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7A9A0C0587F5 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=simonetti.nl Authentication-Results: ext-mx08.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 7A9A0C0587F5 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2FF2A81DFE Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=simonetti.nl Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jeroen@simonetti.nl DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2FF2A81DFE From: Jeroen Simonetti To: libvir-list@redhat.com Date: Mon, 2 Oct 2017 12:10:40 +0200 Message-Id: <20171002101040.28697-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:05:33 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 02 Oct 2017 10:16:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 02 Oct 2017 10:16:20 +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.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Jeroen Simonetti Subject: [libvirt] [PATCH go-xml] qemu: extend serial console source 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 02 Oct 2017 10:37:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" *Warning* this is a BWC breaking change! This will change the type of `DomainSerial.Source` from `*DomainChardevSource` to a new `*DomainSerialSource`. This is done to add support for networked serial ports and keep the original DomainChardevSource unchanged. DomainSerialSource contains all possible xml variations for a serial device source. Signed-off-by: Jeroen Simonetti --- domain.go | 32 ++++++++++++++++++++++++++------ domain_test.go | 30 ++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/domain.go b/domain.go index 8c2cc1b..3221423 100644 --- a/domain.go +++ b/domain.go @@ -309,12 +309,32 @@ 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 *DomainSerialSource `xml:"source"` + Protocol *DomainSerialProtocol `xml:"protocol"` + Target *DomainSerialTarget `xml:"target"` + Alias *DomainAlias `xml:"alias"` + Address *DomainAddress `xml:"address"` +} + +type DomainSerialSource struct { + 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"` + SecLabel *DomainSerialSourceSecLabel `xml:"seclabel"` +} + +type DomainSerialProtocol struct { + Type string `xml:"type,attr"` +} + +type DomainSerialSourceSecLabel struct { + Model string `xml:"model,attr,omitempty"` + Relabel string `xml:"relabel,attr,omitempty"` } =20 type DomainChannel struct { diff --git a/domain_test.go b/domain_test.go index 4fe6bfe..d301ace 100644 --- a/domain_test.go +++ b/domain_test.go @@ -314,9 +314,28 @@ var domainTestData =3D []struct { }, DomainSerial{ Type: "file", - Source: &DomainChardevSource{ + Source: &DomainSerialSource{ Path: "/tmp/serial.log", Append: "off", + SecLabel: &DomainSerialSourceSecLabel{ + Model: "dac", + Relabel: "no", + }, + }, + Target: &DomainSerialTarget{ + Port: &serialPort, + }, + }, + DomainSerial{ + Type: "tcp", + Source: &DomainSerialSource{ + Mode: "bind", + Host: "127.0.0.1", + Service: "1234", + TLS: "yes", + }, + Protocol: &DomainSerialProtocol{ + Type: "telnet", }, Target: &DomainSerialTarget{ Port: &serialPort, @@ -382,7 +401,14 @@ var domainTestData =3D []struct { ` `, ` `, ` `, - ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, ` `, ` `, ` `, --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list