From nobody Sun May 5 12:18:57 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 1496364593348954.0494190443663; Thu, 1 Jun 2017 17:49:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76DFE80C19; Fri, 2 Jun 2017 00:49:50 +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 7598A7E4E9; Fri, 2 Jun 2017 00:49: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 881854BB7F; Fri, 2 Jun 2017 00:49:45 +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 v520lGbr022853 for ; Thu, 1 Jun 2017 20:47:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0298753CD5; Fri, 2 Jun 2017 00:47:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3C5A53C68; Fri, 2 Jun 2017 00:47:13 +0000 (UTC) Received: from out28-147.mail.aliyun.com (out28-147.mail.aliyun.com [115.124.28.147]) by mx1.redhat.com (Postfix) with ESMTP id DB6C1C0587C2; Fri, 2 Jun 2017 00:47:09 +0000 (UTC) Received: from 192.168.3.44(mailfrom:zhenwei.pi@youruncloud.com ip:112.95.153.98) by smtp.aliyun-inc.com(10.147.42.198); Fri, 02 Jun 2017 08:47:07 +0800 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 76DFE80C19 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=youruncloud.com Authentication-Results: ext-mx02.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 76DFE80C19 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DB6C1C0587C2 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=youruncloud.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=zhenwei.pi@youruncloud.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DB6C1C0587C2 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.09015463|-1; FP=6537652432468167863|1|1|1|0|-1|-1|-1; HT=e02c03272; MF=zhenwei.pi@youruncloud.com; NM=1; PH=DS; RN=2; RT=2; SR=0; TI=SMTPD_---.89J1Y8W_1496364427; References: <1496310599-8873-1-git-send-email-zhenwei.pi@youruncloud.com> To: "Daniel P. Berrange" From: ZhenweiPi X-Forwarded-Message-Id: <1496310599-8873-1-git-send-email-zhenwei.pi@youruncloud.com> Message-ID: <5194b3bd-f811-c991-d271-8448f3f49a26@youruncloud.com> Date: Fri, 2 Jun 2017 08:47:07 +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: <1496310599-8873-1-git-send-email-zhenwei.pi@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.32]); Fri, 02 Jun 2017 00:47:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 02 Jun 2017 00:47:12 +0000 (UTC) for IP:'115.124.28.147' DOMAIN:'out28-147.mail.aliyun.com' HELO:'out28-147.mail.aliyun.com' FROM:'zhenwei.pi@youruncloud.com' RCPT:'' X-RedHat-Spam-Score: -2.409 (BAYES_50, DCC_REPUT_00_12, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, UNPARSEABLE_RELAY) 115.124.28.147 out28-147.mail.aliyun.com 115.124.28.147 out28-147.mail.aliyun.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 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] Add support for domain input address 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 02 Jun 2017 00:49:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8"; format="flowed" --- domain.go | 5 +++-- domain_test.go | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/domain.go b/domain.go index bf0b851..dcb8f65 100644 --- a/domain.go +++ b/domain.go @@ -232,8 +232,9 @@ type DomainChardev struct { } =20 type DomainInput struct { - Type string `xml:"type,attr"` - Bus string `xml:"bus,attr"` + Type string `xml:"type,attr"` + Bus string `xml:"bus,attr"` + Address *DomainAddress `xml:"address"` } =20 type DomainGraphicListener struct { diff --git a/domain_test.go b/domain_test.go index 7990627..632b714 100644 --- a/domain_test.go +++ b/domain_test.go @@ -48,6 +48,8 @@ var balloonAddr =3D Address{0, 0, 7, 0} var duplexAddr =3D Address{0, 0, 8, 0} =20 var serialPort uint =3D 0 +var tabletBus uint =3D 0 +var tabletPort uint =3D 1 =20 var domainTestData =3D []struct { Object *Domain @@ -230,6 +232,11 @@ var domainTestData =3D []struct { DomainInput{ Type: "tablet", Bus: "usb", + Address: &DomainAddress{ + Type: "usb", + Bus: &tabletBus, + Port: &tabletPort, + }, }, DomainInput{ Type: "keyboard", @@ -301,7 +308,9 @@ var domainTestData =3D []struct { ` `, ` `, ` `, - ` `, + ` `, + `
`, + ` `, ` `, ` `, `