From nobody Fri May 3 10:10:11 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 1496286025010980.5637418078985; Wed, 31 May 2017 20:00:25 -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 2DF5E804EE; Thu, 1 Jun 2017 03:00:21 +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 9C12095347; Thu, 1 Jun 2017 03:00:19 +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 0A3454BB7F; Thu, 1 Jun 2017 03:00:15 +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 v512x4Jc017043 for ; Wed, 31 May 2017 22:59:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9DD5A5C6D1; Thu, 1 Jun 2017 02:59:04 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9831383860 for ; Thu, 1 Jun 2017 02:59:02 +0000 (UTC) Received: from out28-75.mail.aliyun.com (out28-75.mail.aliyun.com [115.124.28.75]) by mx1.redhat.com (Postfix) with ESMTP id 243B280C0B for ; Thu, 1 Jun 2017 02:58:50 +0000 (UTC) Received: from localhost.localdomain(mailfrom:zhenwei.pi@youruncloud.com ip:112.95.153.98) by smtp.aliyun-inc.com(10.147.43.230); Thu, 01 Jun 2017 10:58:47 +0800 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2DF5E804EE Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=youruncloud.com Authentication-Results: ext-mx03.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 2DF5E804EE DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 243B280C0B 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=none smtp.mailfrom=zhenwei.pi@youruncloud.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 243B280C0B X-Alimail-AntiSpam: AC=CONTINUE; BC=0.09197699|-1; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03277; MF=zhenwei.pi@youruncloud.com; NM=1; PH=DS; RN=2; RT=2; SR=0; TI=SMTPD_---.89-ic1G_1496285927; From: "zhenwei.pi" To: libvir-list@redhat.com Date: Thu, 1 Jun 2017 10:58:06 +0800 Message-Id: <1496285886-7910-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.26]); Thu, 01 Jun 2017 02:59:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 01 Jun 2017 02:59:01 +0000 (UTC) for IP:'115.124.28.75' DOMAIN:'out28-75.mail.aliyun.com' HELO:'out28-75.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.75 out28-75.mail.aliyun.com 115.124.28.75 out28-75.mail.aliyun.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: "zhenwei.pi" Subject: [libvirt] [PATCH go-xml] Add support for device sound 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.27]); Thu, 01 Jun 2017 03:00:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- domain.go | 11 +++++++++++ domain_test.go | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/domain.go b/domain.go index de47c07..bf0b851 100644 --- a/domain.go +++ b/domain.go @@ -283,6 +283,16 @@ type DomainMemBalloon struct { Address *DomainAddress `xml:"address"` } =20 +type DomainSoundCodec struct { + Type string `xml:"type,attr"` +} + +type DomainSound struct { + Model string `xml:"model,attr"` + Codec *DomainSoundCodec `xml:"codec"` + Address *DomainAddress `xml:"address"` +} + type DomainDeviceList struct { Controllers []DomainController `xml:"controller"` Disks []DomainDisk `xml:"disk"` @@ -295,6 +305,7 @@ type DomainDeviceList struct { Videos []DomainVideo `xml:"video"` Channels []DomainChardev `xml:"channel"` MemBalloon *DomainMemBalloon `xml:"memballoon"` + Sounds []DomainSound `xml:"sound"` } =20 type DomainMemory struct { diff --git a/domain_test.go b/domain_test.go index 2c7173b..7990627 100644 --- a/domain_test.go +++ b/domain_test.go @@ -45,6 +45,7 @@ var ifaceAddr =3D Address{0, 0, 4, 0} var videoAddr =3D Address{0, 0, 5, 0} var fsAddr =3D Address{0, 0, 6, 0} var balloonAddr =3D Address{0, 0, 7, 0} +var duplexAddr =3D Address{0, 0, 8, 0} =20 var serialPort uint =3D 0 =20 @@ -276,6 +277,21 @@ var domainTestData =3D []struct { }, }, }, + Sounds: []DomainSound{ + DomainSound{ + Model: "ich6", + Codec: &DomainSoundCodec{ + Type: "duplex", + }, + Address: &DomainAddress{ + Type: "pci", + Domain: &duplexAddr.Domain, + Bus: &duplexAddr.Bus, + Slot: &duplexAddr.Slot, + Function: &duplexAddr.Function, + }, + }, + }, }, }, Expected: []string{ @@ -295,6 +311,10 @@ var domainTestData =3D []struct { ` `, `
`, `
`, + ` `, + ` `, + `
`, + `
`, ` `, ``, }, --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list