From patchwork Fri Dec 20 22:22:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 182320 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp1110605ilf; Fri, 20 Dec 2019 14:22:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwOggh2RaGPmB0fAYik1cN54bERTSVio/7Qd5aeWUly78aa7tV0EEBfOjka7qfgffenmMZ4 X-Received: by 2002:a37:a1c1:: with SMTP id k184mr15548835qke.66.1576880568908; Fri, 20 Dec 2019 14:22:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576880568; cv=none; d=google.com; s=arc-20160816; b=Yzb9coj19y31CvzLa6+2Cr2mVEjx+Qlk+4oGXpPxuJhzIyVU9AvuVHGIgkUIPvvp6W LFdaAuZGneRW7IwWgYCewTnA+zRkRwI9oCt1VDBXFwY5sJNsBG05uLi9I9JuzzXXHFP2 jd1awP3mdEkJLYPqH3QVGcHub+GXja0L1e5GKomUr8w2xRNpxDkBTjENw9sJ6fkzhjOv rEg5iF4LqCrVrndFRvipz66LNzahM2pqXE0/MTT6a6ZqKyTG5tLxxj+8vtfX4e5AATLd 3LCkKMwF9+h13HaELH1mFZOFtJMu2Sq83VDVe57+DqNm0cUt0xm15nH6vzN0I9f1YWr6 iGUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:errors-to:sender:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to:dkim-signature; bh=IYbIYVMf644tdmmdZ2yT7UW27ZtefaKJsuKhrVRxeCY=; b=n4pLB248Ntl2IAxUXFj3qJ/VQ4EM7A0PU71p4czFNOHEbVBCkw5k6fD2O+sXncglS2 hKffQs5N4ot9r1v/2L2zRqBXkCyylIZWjqTzH0fqnrepODtNTk/3O5UNioe0IvQxPJx7 SKF5ZBCSxNFWzFw5GYr/GQAG6n9bbLfxTXozYNd5Py7zkKHIgo6b+5TVtXZygUg/s0Vp ePQRDJRAnJhNTsC6AKMg7226tVBHGoUhrE7IZILxnDqGxlNTweGUQAORnPEYkV/+NbcA elOH9YGRGzpMbu0myhScDr0jUE4Evqj6zM3aZjIR8m/vPfRGZ1rbusxrSuuQr0dpWhZ1 TSEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f7ZqnySK; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com. [205.139.110.61]) by mx.google.com with ESMTPS id t19si5237776qto.107.2019.12.20.14.22.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Dec 2019 14:22:48 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f7ZqnySK; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576880568; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=IYbIYVMf644tdmmdZ2yT7UW27ZtefaKJsuKhrVRxeCY=; b=f7ZqnySKuFQnI6YEiLIWoj0DolAkx6U+nJGkSWnDjtQ5OVBtslpx744ct3WHWPgxAmPRHK QQPSgyIOW8SKFgds7mfSqF3yKAozpvnzfpUwJj2BReyjXmVdiUjPDnarYeJQ/Ba2OjIbYT 1BJSwz2xi5fb+JcYadFS6MhnmelXdfs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-436-H1r07o6JNgqu1Zt5N5inXA-1; Fri, 20 Dec 2019 17:22:47 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1CD2800D48; Fri, 20 Dec 2019 22:22:41 +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 8E2A15D729; Fri, 20 Dec 2019 22:22:40 +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 EA04418089CD; Fri, 20 Dec 2019 22:22:37 +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 xBKMMaCw016123 for ; Fri, 20 Dec 2019 17:22:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 135FC7D92F; Fri, 20 Dec 2019 22:22:36 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-243.rdu2.redhat.com [10.10.124.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B0BF7D903; Fri, 20 Dec 2019 22:22:35 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 17:22:25 -0500 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Cole Robinson Subject: [libvirt] [go-xml PATCH 1/2] Fix virtio-s390 address lookup 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: H1r07o6JNgqu1Zt5N5inXA-1 X-Mimecast-Spam-Score: 0 It was comparing against spapr-vio Signed-off-by: Cole Robinson --- All this virtio-s390 stuff is kinda bogus though, because it is never actually output in libvirt XML. domain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/domain.go b/domain.go index 8c4d7a4..7552c4b 100644 --- a/domain.go +++ b/domain.go @@ -5145,7 +5145,7 @@ func (a *DomainAddress) UnmarshalXML(d *xml.Decoder, start xml.StartElement) err } else if typ == "ccid" { a.CCID = &DomainAddressCCID{} return d.DecodeElement(a.CCID, &start) - } else if typ == "spapr-vio" { + } else if typ == "virtio-s390" { a.VirtioS390 = &DomainAddressVirtioS390{} return d.DecodeElement(a.VirtioS390, &start) } From patchwork Fri Dec 20 22:22:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 182322 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp1110856ilf; Fri, 20 Dec 2019 14:23:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyfbXE3BtGTlmTXttFXsom16EdacyF/O6MkLpb3DJv4v6kPzpIKYDkavVVk+GFLVKxremdJ X-Received: by 2002:a25:2e09:: with SMTP id u9mr12375422ybu.485.1576880585614; Fri, 20 Dec 2019 14:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576880585; cv=none; d=google.com; s=arc-20160816; b=dwa11FjWIvAmjBNdit5/4Mrh1ce/oUrmPvfSzK7+i5aCV0jjura7UMwUMxSDX9KTjN I1X1S8atYprwVKsch4ttQ4ptZLWJtW0H588ofOFYmlK+bHyGPqMnj1bNir+YWezo1gev IEriAVzMn6sDximaJcgrCcYnn+Z4Xy9fVjTXAumBKjHaK0/YSKlwDOn9tjX9wWtmDmYq dHcsOuijLhWtkeHcGOufldi4ql023PKZgZkobl1SlmIApaxUGjY4Bh5aSHPl97J6epa6 devWCVGQFryCnS/248uy6JRl0uNx2i7xeSXcUSck+YbF8vZKQTG0y3C7DJ/ah3LpZxqG ThEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:errors-to:sender:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to:dkim-signature; bh=PnafcpI4F+1H4z6aJTQ/yWdXJg8vEcF4vGTVGFvZF4c=; b=a1udcacXZihzLjdzvTc9dbubCg22xRDfJAbpeZttEIW3MeoDpZKUUWGlcjYPoMPz4g r0nqcfln91JSY3Nh8Czhr2kx/FiXHQSkb2E0KWfZPxFm/nRvM3puzpatDaWSdAIDSrv0 vnsRm4pwKB//JPnJ78NIzVJIXgFBWZ/cKgHZjvV/Gjin1qeHjy6a+DcaPgWGj30Co4JI nt4srvXV4P59B0SRok66FCnCerAC34V7LGePFTFoXUZLCY1EqPJgstwuMqN02O/4MPIh 54PJBXTOFfjZVBKnV3W91P5W48A+0+R/WoFManptucA3gYdi8X68YsFlP0nMHddJRzSV 8c/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IEgRFD2k; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com. [205.139.110.120]) by mx.google.com with ESMTPS id 184si5611532ywc.119.2019.12.20.14.23.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Dec 2019 14:23:05 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IEgRFD2k; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576880585; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PnafcpI4F+1H4z6aJTQ/yWdXJg8vEcF4vGTVGFvZF4c=; b=IEgRFD2k7XMDRBkuZIncCkrCklbqLie7qJ0JMAb11M7/f84nnKDa87i+EqVIhRfdeuwAPA 1diKWL7KtFmjSphTdlp/EGfevzZzxp/3zcqOmMywkmIgCpCv7ThGWmiN2R0Qdr1q+waKGL SV4Ap7jmPR89Tj2MTAYekoKom2fea8k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-222-6UKUhjmCPMa9JFgOwwgxjg-1; Fri, 20 Dec 2019 17:23:03 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DEAD0800EB5; Fri, 20 Dec 2019 22:22:57 +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 B6D2C5F777; Fri, 20 Dec 2019 22:22:57 +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 40250252C3; Fri, 20 Dec 2019 22:22:57 +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 xBKMMbVc016130 for ; Fri, 20 Dec 2019 17:22:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id F2E3B7D92F; Fri, 20 Dec 2019 22:22:36 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-243.rdu2.redhat.com [10.10.124.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 626847D903; Fri, 20 Dec 2019 22:22:36 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 17:22:26 -0500 Message-Id: <03ff3c85b8f83a848c835760c3d9d8944211558c.1576879072.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Cole Robinson Subject: [libvirt] [go-xml PATCH 2/2] Support domain address type='unassigned' 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: 6UKUhjmCPMa9JFgOwwgxjg-1 X-Mimecast-Spam-Score: 0 Signed-off-by: Cole Robinson --- This should fix the libvirt-go-xml CI domain.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Daniel P. Berrangé diff --git a/domain.go b/domain.go index 7552c4b..c290003 100644 --- a/domain.go +++ b/domain.go @@ -887,6 +887,9 @@ type DomainAddressCCID struct { type DomainAddressVirtioS390 struct { } +type DomainAddressUnassigned struct { +} + type DomainAddress struct { PCI *DomainAddressPCI Drive *DomainAddressDrive @@ -899,6 +902,7 @@ type DomainAddress struct { VirtioMMIO *DomainAddressVirtioMMIO ISA *DomainAddressISA DIMM *DomainAddressDIMM + Unassigned *DomainAddressUnassigned } type DomainChardevLog struct { @@ -4801,6 +4805,12 @@ func (a *DomainAddressVirtioS390) MarshalXML(e *xml.Encoder, start xml.StartElem return nil } +func (a *DomainAddressUnassigned) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + e.EncodeToken(start) + e.EncodeToken(start.End()) + return nil +} + func (a *DomainAddress) MarshalXML(e *xml.Encoder, start xml.StartElement) error { if a.USB != nil { start.Attr = append(start.Attr, xml.Attr{ @@ -4857,6 +4867,11 @@ func (a *DomainAddress) MarshalXML(e *xml.Encoder, start xml.StartElement) error xml.Name{Local: "type"}, "virtio-s390", }) return e.EncodeElement(a.VirtioS390, start) + } else if a.Unassigned != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "unassigned", + }) + return e.EncodeElement(a.Unassigned, start) } else { return nil } @@ -5102,6 +5117,11 @@ func (a *DomainAddressVirtioS390) UnmarshalXML(d *xml.Decoder, start xml.StartEl return nil } +func (a *DomainAddressUnassigned) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + d.Skip() + return nil +} + func (a *DomainAddress) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { var typ string for _, attr := range start.Attr { @@ -5148,6 +5168,9 @@ func (a *DomainAddress) UnmarshalXML(d *xml.Decoder, start xml.StartElement) err } else if typ == "virtio-s390" { a.VirtioS390 = &DomainAddressVirtioS390{} return d.DecodeElement(a.VirtioS390, &start) + } else if typ == "unassigned" { + a.Unassigned = &DomainAddressUnassigned{} + return d.DecodeElement(a.Unassigned, &start) } return nil