From nobody Sat Apr 27 14:15:18 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.zoho.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 1498439533543993.7119295711336; Sun, 25 Jun 2017 18:12:13 -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 6619737E60; Mon, 26 Jun 2017 01:12:08 +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 0FA4577D6A; Mon, 26 Jun 2017 01:12:06 +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 56F451803B26; Mon, 26 Jun 2017 01:12:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5Q18GD6007874 for ; Sun, 25 Jun 2017 21:08:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4248678424; Mon, 26 Jun 2017 01:08:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A93978426; Mon, 26 Jun 2017 01:08:14 +0000 (UTC) Received: from out28-146.mail.aliyun.com (out28-146.mail.aliyun.com [115.124.28.146]) by mx1.redhat.com (Postfix) with ESMTP id 625D637E60; Mon, 26 Jun 2017 01:08:09 +0000 (UTC) Received: from 192.168.3.53(mailfrom:zhenwei.pi@youruncloud.com ip:112.95.153.98) by smtp.aliyun-inc.com(10.147.42.253); Mon, 26 Jun 2017 09:08:03 +0800 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6619737E60 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=youruncloud.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6619737E60 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 625D637E60 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=youruncloud.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=zhenwei.pi@youruncloud.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 625D637E60 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.08261393|-1; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03293; MF=zhenwei.pi@youruncloud.com; NM=1; PH=DS; RN=2; RT=2; SR=0; TI=SMTPD_---.8HuXxKB_1498439283; References: <32d818e9-3237-07bc-fe59-8782b4ffd2c8@youruncloud.com> To: "Daniel P. Berrange" From: ZhenweiPi X-Forwarded-Message-Id: <32d818e9-3237-07bc-fe59-8782b4ffd2c8@youruncloud.com> Message-ID: Date: Mon, 26 Jun 2017 09:08:03 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <32d818e9-3237-07bc-fe59-8782b4ffd2c8@youruncloud.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 26 Jun 2017 01:08:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 26 Jun 2017 01:08:12 +0000 (UTC) for IP:'115.124.28.146' DOMAIN:'out28-146.mail.aliyun.com' HELO:'out28-146.mail.aliyun.com' FROM:'zhenwei.pi@youruncloud.com' RCPT:'' X-RedHat-Spam-Score: 0.371 (BAYES_50, DCC_REPUT_00_12, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, UNPARSEABLE_RELAY) 115.124.28.146 out28-146.mail.aliyun.com 115.124.28.146 out28-146.mail.aliyun.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com Subject: [libvirt] [PATCH go-xml] support virtualport for interface and add test code 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: , 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.29]); Mon, 26 Jun 2017 01:12:11 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8"; format="flowed" --- domain.go | 29 +++++++++++++++++------------ domain_test.go | 4 ++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/domain.go b/domain.go index eb7ff9e..ecb8550 100644 --- a/domain.go +++ b/domain.go @@ -185,19 +185,24 @@ type DomainInterfaceDriver struct { Queues uint `xml:"queues,attr,omitempty"` } =20 +type DomainInterfaceVirtualport struct { + Type string `xml:"type,attr"` +} + type DomainInterface struct { - XMLName xml.Name `xml:"interface"` - Type string `xml:"type,attr"` - MAC *DomainInterfaceMAC `xml:"mac"` - Model *DomainInterfaceModel `xml:"model"` - Source *DomainInterfaceSource `xml:"source"` - Target *DomainInterfaceTarget `xml:"target"` - Alias *DomainInterfaceAlias `xml:"alias"` - Link *DomainInterfaceLink `xml:"link"` - Boot *DomainDeviceBoot `xml:"boot"` - Script *DomainInterfaceScript `xml:"script"` - Driver *DomainInterfaceDriver `xml:"driver"` - Address *DomainAddress `xml:"address"` + XMLName xml.Name `xml:"interface"` + Type string `xml:"type,attr"` + MAC *DomainInterfaceMAC `xml:"mac"` + Model *DomainInterfaceModel `xml:"model"` + Source *DomainInterfaceSource `xml:"source"` + Target *DomainInterfaceTarget `xml:"target"` + Alias *DomainInterfaceAlias `xml:"alias"` + Link *DomainInterfaceLink `xml:"link"` + Boot *DomainDeviceBoot `xml:"boot"` + Script *DomainInterfaceScript `xml:"script"` + Driver *DomainInterfaceDriver `xml:"driver"` + Virtualport *DomainInterfaceVirtualport `xml:"virtualport"` + Address *DomainAddress `xml:"address"` } =20 type DomainChardevSource struct { diff --git a/domain_test.go b/domain_test.go index 6b37719..9de725c 100644 --- a/domain_test.go +++ b/domain_test.go @@ -565,6 +565,9 @@ var domainTestData =3D []struct { Model: &DomainInterfaceModel{ Type: "virtio", }, + Virtualport: &DomainInterfaceVirtualport{ + Type: "openvswitch", + }, }, }, }, @@ -577,6 +580,7 @@ var domainTestData =3D []struct { ` `, ` `, ` `, + ` `, ` `, ` `, ``, --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list