From nobody Sun Apr 28 00:19:26 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 1520178134230583.8682449499498; Sun, 4 Mar 2018 07:42:14 -0800 (PST) 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 0D1903DE42; Sun, 4 Mar 2018 15:42:12 +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 7A09317AD5; Sun, 4 Mar 2018 15:42:09 +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 8A98F4A46E; Sun, 4 Mar 2018 15:42:04 +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 w24Fg3Is024596 for ; Sun, 4 Mar 2018 10:42:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3CD8A17120; Sun, 4 Mar 2018 15:42:03 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 349957A2E1 for ; Sun, 4 Mar 2018 15:42:00 +0000 (UTC) Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) (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 5C0A449016 for ; Sun, 4 Mar 2018 15:41:59 +0000 (UTC) Received: by mail-qk0-f194.google.com with SMTP id v124so17786451qkh.11 for ; Sun, 04 Mar 2018 07:41:59 -0800 (PST) Received: from ryzen.goodwu.net (pool-72-89-98-128.nycmny.fios.verizon.net. [72.89.98.128]) by smtp.gmail.com with ESMTPSA id t24sm771029qtn.77.2018.03.04.07.41.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Mar 2018 07:41:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isi-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=H3Ka59Smc5hiJtusOjx1DnkAhTOEcQVLRh+5dJpHuNY=; b=kVP15rItZc5GWbPJ1cNPsMcUr3IjtoAQd5TEMFc43mLaJmdnGViJ/Yb2f6Ii5HNbPv RLQBWRCSp+lpuom0f8qnLaInqjOwF7LDsRGFBmwu7z8Iv94w7cQ+6jww/Ptj2fb3VVPG ShEG/E5aeP6lGxCXmrKbt8Ofudck0s+D+u15MAnsPsAq/4pi7tLR1WNUMm4IjZv8aE/3 WAQWwJnJQejsyq0y3noYVuPmRd45W7k+sr8dNfIXltLmmTLn2i9dyqQ587oI7HGCVXig k7t6rv1KbdrpVmwX8lw4KEb9ycJPB3VCCofqlCBrZUpKCX65uoRdEIy0CvjW6PmTN/DD YEgw== 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; bh=H3Ka59Smc5hiJtusOjx1DnkAhTOEcQVLRh+5dJpHuNY=; b=SI1GMaaT2UXFCJ22bHryAwIRIX8MWJOaGOy+0HdXun1gQmSkVmfnA5Ziv9qkLX/ygO NSHCuFnFoWeP/PEKuCeOb0SH9736LX+quDAOtsMuJGShKtqqnf88Z+wFrbDYgZfD9edR jTcCrXfihphTVdRQruQV5Fg4wssuJFsK8IDBPIF9yklP3EHmmeK7eoIIOMzNFxdBY1L5 xnVlMsSiKlmN6RdjiglRTsWTiS9dvM5qg8a5u0nAOvpo4tk3LOmb8F024U0EoAJPylZ7 cBfaa0qNw6h6zFJXQ4jXS+HPGRIXcAFbI0uLr5kSHu1Zbzgqv0+0G8oFxXJtC4mJ7PkS mJ9A== X-Gm-Message-State: AElRT7GvN8f/ArcgjW7r0oUETzS0c1W1UV/bsduHPhzXLHMe/FnLvhWN SlJ+YVQ7eom2DFZH/EcW+FoBrVM2 X-Google-Smtp-Source: AG47ELszMT1C1TRO1zB94n7CXqeNCghhugxqYHm7V9GQ+dF8nELGSIv7X2Rlzg/zEs/TNkBFtzsBgw== X-Received: by 10.55.27.18 with SMTP id b18mr17065367qkb.355.1520178118151; Sun, 04 Mar 2018 07:41:58 -0800 (PST) From: Ryan Goodfellow To: libvir-list@redhat.com Date: Sun, 4 Mar 2018 10:41:43 -0500 Message-Id: <20180304154143.101971-1-rgoodfel@isi.edu> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 04 Mar 2018 15:41:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 04 Mar 2018 15:41:59 +0000 (UTC) for IP:'209.85.220.194' DOMAIN:'mail-qk0-f194.google.com' HELO:'mail-qk0-f194.google.com' FROM:'rgoodfel@isi.edu' RCPT:'' X-RedHat-Spam-Score: -0.03 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL) 209.85.220.194 mail-qk0-f194.google.com 209.85.220.194 mail-qk0-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Ryan Goodfellow Subject: [libvirt] [PATCH go-xml] fix type tag for rdp and destkop graphics devices 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.29]); Sun, 04 Mar 2018 15:42:12 +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" The current behavior is to generate a type=3D"vnc" tag in the element generated from either a DomainGrapicRDP or DomainGraphicDesktop. The correct tags should be type=3D"rdp" and type=3D"desktop" respectively. This commit emits the correct tags and adds a test for correct graphics device tagging. --- domain.go | 4 ++-- domain_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/domain.go b/domain.go index ea53dfc..1de4ade 100644 --- a/domain.go +++ b/domain.go @@ -4226,12 +4226,12 @@ func (a *DomainGraphic) MarshalXML(e *xml.Encoder, = start xml.StartElement) error return e.EncodeElement(a.VNC, start) } else if a.RDP !=3D nil { start.Attr =3D append(start.Attr, xml.Attr{ - xml.Name{Local: "type"}, "vnc", + xml.Name{Local: "type"}, "rdp", }) return e.EncodeElement(a.RDP, start) } else if a.Desktop !=3D nil { start.Attr =3D append(start.Attr, xml.Attr{ - xml.Name{Local: "type"}, "vnc", + xml.Name{Local: "type"}, "desktop", }) return e.EncodeElement(a.Desktop, start) } else if a.Spice !=3D nil { diff --git a/domain_test.go b/domain_test.go index 7c9d3a2..1715e01 100644 --- a/domain_test.go +++ b/domain_test.go @@ -3782,6 +3782,32 @@ var domainTestData =3D []struct { ``, }, }, + { + Object: &Domain{ + Name: "demo", + Devices: &DomainDeviceList{ + Graphics: []DomainGraphic{ + DomainGraphic{SDL: &DomainGraphicSDL{}}, + DomainGraphic{VNC: &DomainGraphicVNC{}}, + DomainGraphic{RDP: &DomainGraphicRDP{}}, + DomainGraphic{Desktop: &DomainGraphicDesktop{}}, + DomainGraphic{Spice: &DomainGraphicSpice{}}, + }, + }, + }, + Expected: []string{ + ``, + ` demo`, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ` `, + ``, + }, + }, } =20 func TestDomain(t *testing.T) { --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list