From nobody Sat Apr 27 19:20:48 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; dkim=fail; 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 1505311788944905.762641820738; Wed, 13 Sep 2017 07:09: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 7A08581DFC; Wed, 13 Sep 2017 14:09:47 +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 69868614CF; Wed, 13 Sep 2017 14:09:46 +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 69A6B18045C2; Wed, 13 Sep 2017 14:09:44 +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 v8DCwBS1023863 for ; Wed, 13 Sep 2017 08:58:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 79EA569FB7; Wed, 13 Sep 2017 12:58:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72B2769FB4 for ; Wed, 13 Sep 2017 12:58:07 +0000 (UTC) Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5ED935D68A for ; Wed, 13 Sep 2017 12:58:03 +0000 (UTC) Received: by mail-wr0-f172.google.com with SMTP id m18so310114wrm.2 for ; Wed, 13 Sep 2017 05:58:03 -0700 (PDT) Received: from desktop.london.zelotus.com (cpc115198-nmal23-2-0-cust489.19-2.cable.virginm.net. [81.97.153.234]) by smtp.gmail.com with ESMTPSA id t2sm7271812wre.5.2017.09.13.05.58.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2017 05:58:00 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7A08581DFC Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zelotus.com Authentication-Results: ext-mx01.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 7A08581DFC Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=zelotus-com.20150623.gappssmtp.com header.i=@zelotus-com.20150623.gappssmtp.com header.b="KBnJZsYv" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5ED935D68A Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zelotus.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dean@zelotus.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5ED935D68A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zelotus-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vg557jAI2W8xX+jczz8uUPLZFAqZLxa7Nnmz6btgsq0=; b=KBnJZsYvOAtzLm/Ax50i9JTCv9z1T7vrjgDYyf17vSl1VsqIBC4CQUqqs9IS56OYPd NHLICoFbEMVn9ktlMHYc8Y/CQn1jfRXUXNLljp9wcAr394pweaNyc3qQ6T+UjhPSMVUd HarEwcvamIb0LGAnE48oi6Y59nsO0g24HHYCnNKAKUVMDO1GRwxQbzGY760Km7ClaPyz ko0amhNSBKrIQ0LRbtICsltc6hdatdO1r3ukEf/cqaQ5+D0/QTGpvj7pmToGBMP2iw3o hgr+uwKD9UH+tsVDeQXOsJ0a7S69NMI68i3mVodvmVLfYDgM+ntQHCsw7bqYPptkvvHA AGPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vg557jAI2W8xX+jczz8uUPLZFAqZLxa7Nnmz6btgsq0=; b=kRbppVPi9UxmQEaG8z+9OQMivmkIQ9vnDaYl9a3Mu8eIV/+l+Cjc5OcwJOHD9pjCV8 nktsN3sohgg7qrjD7VgbaErTFB7cm6B4pg8ifsph7SuBknnSVO8E3vv5X9XdH9hxgQhm o7Yh6gOy0M0LuJWOsTeFAiXVxQFhJAG80d7g1EnMMwTPUK/6vkXh5Ajb1VDeOp4K3gFC RM0g9dhu89fpkoEEhbYDZvV/yh1mZEtdRTNLmlHr5JOG8BDJQDjeycdxSqwZ4MdVRSOB LTj/H5m+AFi0zvInfNQACV5YYgGPuN7GVm2ILTB4RElt2T7lM9bsJMhkQsyeTw/kYnoj /T0Q== X-Gm-Message-State: AHPjjUhvmXnQm62C9ltAsR+4H2nNj8lia5EgW3b32GbVdnEeuYY2MN5R 2edwp9IEgAOoaZh2xfgNoA== X-Google-Smtp-Source: ADKCNb56Fw+Erhrvxtvjb+e2yBpYS02vvE2fOyBD9YQMDQNbZFGPl4hgZSYj/Yw2XEmpaqP4oiHLuQ== X-Received: by 10.223.186.67 with SMTP id t3mr15253175wrg.22.1505307481811; Wed, 13 Sep 2017 05:58:01 -0700 (PDT) From: Dean Smith To: libvir-list@redhat.com Date: Wed, 13 Sep 2017 13:57:45 +0100 Message-Id: <1505307466-5550-2-git-send-email-dean@zelotus.com> In-Reply-To: <1505307466-5550-1-git-send-email-dean@zelotus.com> References: <1505307466-5550-1-git-send-email-dean@zelotus.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 13 Sep 2017 12:58:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 13 Sep 2017 12:58:04 +0000 (UTC) for IP:'209.85.128.172' DOMAIN:'mail-wr0-f172.google.com' HELO:'mail-wr0-f172.google.com' FROM:'dean@zelotus.com' RCPT:'' X-RedHat-Spam-Score: -2.311 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.128.172 mail-wr0-f172.google.com 209.85.128.172 mail-wr0-f172.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Wed, 13 Sep 2017 09:42:41 -0400 Cc: Anton Kryukov Subject: [libvirt] [PATCH go-xml 1/2] Add support for hex values in DomainAddress struct 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.25]); Wed, 13 Sep 2017 14:09:48 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Anton Kryukov Add support for hex values in DomainAddress struct Tests fixed for HexUint >From PR#13 https://github.com/libvirt/libvirt-go-xml/pull/13 on github by Emreu @deasmi submitting via mail --- domain.go | 27 ++++++++++++++++++--------- domain_test.go | 10 +++++----- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/domain.go b/domain.go index a5d3203..bead49a 100644 --- a/domain.go +++ b/domain.go @@ -27,6 +27,7 @@ package libvirtxml =20 import ( "encoding/xml" + "strconv" ) =20 type DomainController struct { @@ -281,15 +282,15 @@ type DomainAlias struct { } =20 type DomainAddress struct { - Type string `xml:"type,attr"` - Controller *uint `xml:"controller,attr"` - Domain *uint `xml:"domain,attr"` - Bus *uint `xml:"bus,attr"` - Port *uint `xml:"port,attr"` - Slot *uint `xml:"slot,attr"` - Function *uint `xml:"function,attr"` - Target *uint `xml:"target,attr"` - Unit *uint `xml:"unit,attr"` + Type string `xml:"type,attr"` + Controller *uint `xml:"controller,attr"` + Domain *HexUint `xml:"domain,attr"` + Bus *HexUint `xml:"bus,attr"` + Port *uint `xml:"port,attr"` + Slot *HexUint `xml:"slot,attr"` + Function *HexUint `xml:"function,attr"` + Target *uint `xml:"target,attr"` + Unit *uint `xml:"unit,attr"` } =20 type DomainConsole struct { @@ -792,3 +793,11 @@ func (d *DomainRNG) Marshal() (string, error) { } return string(doc), nil } + +type HexUint uint + +func (h *HexUint) UnmarshalXMLAttr(attr xml.Attr) error { + val, err :=3D strconv.ParseUint(attr.Value, 0, 32) + *h =3D HexUint(val) + return err +} diff --git a/domain_test.go b/domain_test.go index 2af451f..d1b107d 100644 --- a/domain_test.go +++ b/domain_test.go @@ -31,10 +31,10 @@ import ( ) =20 type Address struct { - Domain uint - Bus uint - Slot uint - Function uint + Domain HexUint + Bus HexUint + Slot HexUint + Function HexUint } =20 var uhciIndex uint =3D 0 @@ -48,7 +48,7 @@ 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 tabletBus HexUint =3D 0 var tabletPort uint =3D 1 =20 var nicAverage int =3D 1000 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 27 19:20:48 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; dkim=fail; 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 15053119220431009.6696966420731; Wed, 13 Sep 2017 07:12:02 -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 0467581E17; Wed, 13 Sep 2017 14:12:01 +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 D421377DF7; Wed, 13 Sep 2017 14:12:00 +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 9B703180610F; Wed, 13 Sep 2017 14:12:00 +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 v8DCw9ID023857 for ; Wed, 13 Sep 2017 08:58:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7638C61780; Wed, 13 Sep 2017 12:58:09 +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 711F1177CB for ; Wed, 13 Sep 2017 12:58:07 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C9F3C057FA8 for ; Wed, 13 Sep 2017 12:58:06 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id e64so588603wmi.2 for ; Wed, 13 Sep 2017 05:58:06 -0700 (PDT) Received: from desktop.london.zelotus.com (cpc115198-nmal23-2-0-cust489.19-2.cable.virginm.net. [81.97.153.234]) by smtp.gmail.com with ESMTPSA id t2sm7271812wre.5.2017.09.13.05.58.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2017 05:58:04 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0467581E17 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zelotus.com Authentication-Results: ext-mx01.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 0467581E17 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=zelotus-com.20150623.gappssmtp.com header.i=@zelotus-com.20150623.gappssmtp.com header.b="oTvMXzYQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5C9F3C057FA8 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zelotus.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dean@zelotus.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5C9F3C057FA8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zelotus-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4b/VaLdFY2kd2tCCrG/7ON58FCoxiFg0a1c1EwHpxEo=; b=oTvMXzYQRfTmLWfFLPrBr7CuhZ5ecUbPOxltzJWW9a9SYDIdm82DN61TgzcXd4SyDM znLHjnXvdUOyokTQ35dfzJtjbKA4JMbG5VA16e2zf3RUvtynizyHXJsFTXUOZBlSZO36 SMhnMKQWpxIwa/0KLjxDhTQd/vIdidmR1jSNhExEoktP6vu5B/0a4FjkzOMGarnzOY8j iROvBJWpsCAnAszdxw1E178O+asSLdTK455qIRhRjIq9CoeWM+9sbsGk1CfPqhhPmoZJ sxRLUNiihJKo53HCi1awWPKVyPoqg92Q1GxVsZ9lOmUXsvO3KhS542Oupineqse6P3iJ /sGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4b/VaLdFY2kd2tCCrG/7ON58FCoxiFg0a1c1EwHpxEo=; b=LY5XphvpK9kWNWEts4LLbKkvUR2LNCorKpxD64ZL/nirojAxoNjFJXdxC1eqMg7WZZ LWQw0cPb9iQEh6RGMWKaZOJqZlCC+rwIkozdhiFStk2Hi4sgxgj3tqBMOAde0iU/Sz6G FAHIeV+DnZsh6MrQ/p+IVuTuj0XGuuT4WwYWATY2dTBKz83Jl9B6SqmN/CAmKDIztjdi zPXt3XcYdZp9+ZUdy8SeV/TNDB/rYOsoKdBrLHjajIrffzZz28bTNLMXe1QV4+gS6fs8 O84LWDV0O9OZVvxXoCndu+8q6yYdrj7dZ8ggiEsxSAjER5DPTdwg2dST7mDz+N51/SVg 0stg== X-Gm-Message-State: AHPjjUiLWFknGRYk8BHUHj9bOHP9pYlREEIGNXYW/CX0Hu+JSm3brvNq mGY4fsOkS0IfAAD5B6JzlQ== X-Google-Smtp-Source: AOwi7QDG5L0g08o5e6upeIUWOBJ+UPwV8+wUVpc/qazogbfZ0v1pASIMjG9kQCpTVPZERE+/nUIpAg== X-Received: by 10.28.66.65 with SMTP id p62mr2420740wma.159.1505307484856; Wed, 13 Sep 2017 05:58:04 -0700 (PDT) From: Dean Smith To: libvir-list@redhat.com Date: Wed, 13 Sep 2017 13:57:46 +0100 Message-Id: <1505307466-5550-3-git-send-email-dean@zelotus.com> In-Reply-To: <1505307466-5550-1-git-send-email-dean@zelotus.com> References: <1505307466-5550-1-git-send-email-dean@zelotus.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 13 Sep 2017 12:58:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 13 Sep 2017 12:58:06 +0000 (UTC) for IP:'74.125.82.65' DOMAIN:'mail-wm0-f65.google.com' HELO:'mail-wm0-f65.google.com' FROM:'dean@zelotus.com' RCPT:'' X-RedHat-Spam-Score: 0.469 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 74.125.82.65 mail-wm0-f65.google.com 74.125.82.65 mail-wm0-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Wed, 13 Sep 2017 09:42:41 -0400 Cc: Dean Smith Subject: [libvirt] [PATCH go-xml 2/2] Adding go 1.8 and 1.9 to travis tests 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.25]); Wed, 13 Sep 2017 14:12:01 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5e6be77..dd13140 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ go: - 1.5 - 1.6 - 1.7 + - 1.8 + - 1.9 =20 script: go test -timeout 1m -v --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list