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