From nobody Sat May 4 14:25:01 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 1493203867926121.9818830790233; Wed, 26 Apr 2017 03:51:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5B01804FA; Wed, 26 Apr 2017 10:51:05 +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 6B08C87422; Wed, 26 Apr 2017 10:51:05 +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 B2DF618521CD; Wed, 26 Apr 2017 10:51:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v3QAp2u6018977 for ; Wed, 26 Apr 2017 06:51:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5AFBA174B6; Wed, 26 Apr 2017 10:51:02 +0000 (UTC) Received: from antique-work.brq.redhat.com (dhcp129-230.brq.redhat.com [10.34.129.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id D85D17D667 for ; Wed, 26 Apr 2017 10:50:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E5B01804FA Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.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 E5B01804FA From: Pavel Hrdina To: libvir-list@redhat.com Date: Wed, 26 Apr 2017 12:50:57 +0200 Message-Id: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: format only relevant attributes for graphics based on listen type 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 26 Apr 2017 10:51:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch changes following output: ... ... into this output: ... ... Signed-off-by: Pavel Hrdina --- src/conf/domain_conf.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fe9b7c7273..88bcd6c052 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23297,7 +23297,8 @@ virDomainGraphicsDefFormat(virBufferPtr buf, return -1; } =20 - if (glisten->type =3D=3D VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET) { + switch (glisten->type) { + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET: /* To not break migration we shouldn't print the 'socket' attr= ibute * if it's auto-generated or if it's based on config option fr= om * qemu.conf. If the socket is provided by user we need to pr= int it @@ -23307,7 +23308,10 @@ virDomainGraphicsDefFormat(virBufferPtr buf, (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE))) { virBufferEscapeString(buf, " socket=3D'%s'", glisten->sock= et); } - } else { + break; + + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS: + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK: if (def->data.vnc.port && (!def->data.vnc.autoport || !(flags & VIR_DOMAIN_DEF_FORMA= T_INACTIVE))) virBufferAsprintf(buf, " port=3D'%d'", @@ -23325,6 +23329,10 @@ virDomainGraphicsDefFormat(virBufferPtr buf, virBufferAsprintf(buf, " websocket=3D'%d'", def->data.vnc.= websocket); =20 virDomainGraphicsListenDefFormatAddr(buf, glisten, flags); + break; + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE: + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST: + break; } =20 if (def->data.vnc.keymap) --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list