From nobody Fri May 3 14:54:21 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 1506462677465526.3921884185938; Tue, 26 Sep 2017 14:51:17 -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 E2BB9806B8; Tue, 26 Sep 2017 21:51:15 +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 163F717A40; Tue, 26 Sep 2017 21:51:14 +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 657F73FA9E; Tue, 26 Sep 2017 21:51:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8QJa0Hf009183 for ; Tue, 26 Sep 2017 15:36:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id DEA5869503; Tue, 26 Sep 2017 19:36:00 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA2106A504 for ; Tue, 26 Sep 2017 19:35:58 +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 627AC267DF for ; Tue, 26 Sep 2017 19:35:57 +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 9EBFB540BB7; Tue, 26 Sep 2017 21:30:23 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E2BB9806B8 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=simonetti.nl Authentication-Results: ext-mx02.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 E2BB9806B8 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 627AC267DF 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=pass smtp.mailfrom=jeroen@simonetti.nl DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 627AC267DF From: Jeroen Simonetti To: libvir-list@redhat.com Date: Tue, 26 Sep 2017 21:30:17 +0200 Message-Id: <20170926193017.9869-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:31 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 26 Sep 2017 19:35:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 26 Sep 2017 19:35:57 +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.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Tue, 26 Sep 2017 17:49:58 -0400 Cc: Jeroen Simonetti Subject: [libvirt] [PATCH go-xml] Add qemu udp unicast tunneling support 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.26]); Tue, 26 Sep 2017 21:51:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jeroen Simonetti Reviewed-by: Daniel P. Berrange --- domain.go | 22 ++++++++++++++-------- domain_test.go | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/domain.go b/domain.go index 3ab54a1..805909f 100644 --- a/domain.go +++ b/domain.go @@ -178,16 +178,22 @@ type DomainInterfaceModel struct { } =20 type DomainInterfaceSource struct { - Bridge string `xml:"bridge,attr,omitempty"` - Dev string `xml:"dev,attr,omitempty"` - Network string `xml:"network,attr,omitempty"` + Bridge string `xml:"bridge,attr,omitempty"` + Dev string `xml:"dev,attr,omitempty"` + Network string `xml:"network,attr,omitempty"` + Address string `xml:"address,attr,omitempty"` + Type string `xml:"type,attr,omitempty"` + Path string `xml:"path,attr,omitempty"` + Mode string `xml:"mode,attr,omitempty"` + Port uint `xml:"port,attr,omitempty"` + Service string `xml:"service,attr,omitempty"` + Host string `xml:"host,attr,omitempty"` + Local *DomainInterfaceSourceLocal `xml:"local"` +} + +type DomainInterfaceSourceLocal struct { Address string `xml:"address,attr,omitempty"` - Type string `xml:"type,attr,omitempty"` - Path string `xml:"path,attr,omitempty"` - Mode string `xml:"mode,attr,omitempty"` Port uint `xml:"port,attr,omitempty"` - Service string `xml:"service,attr,omitempty"` - Host string `xml:"host,attr,omitempty"` } =20 type DomainInterfaceTarget struct { diff --git a/domain_test.go b/domain_test.go index 0ae9594..163661f 100644 --- a/domain_test.go +++ b/domain_test.go @@ -867,6 +867,47 @@ var domainTestData =3D []struct { ``, }, }, + { + Object: &Domain{ + Type: "kvm", + Name: "test", + Devices: &DomainDeviceList{ + Interfaces: []DomainInterface{ + DomainInterface{ + Type: "udp", + MAC: &DomainInterfaceMAC{ + Address: "52:54:00:39:97:ac", + }, + Model: &DomainInterfaceModel{ + Type: "virtio", + }, + Source: &DomainInterfaceSource{ + Address: "127.0.0.1", + Port: 1234, + Local: &DomainInterfaceSourceLocal{ + Address: "127.0.0.1", + Port: 1235, + }, + }, + }, + }, + }, + }, + Expected: []string{ + ``, + ` test`, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ``, + }, + }, { Object: &Domain{ Type: "kvm", --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list