From nobody Wed May 1 15:05:16 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; 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 1512058482050386.30897044551205; Thu, 30 Nov 2017 08:14:42 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDCFAC058EDD; Thu, 30 Nov 2017 16:14:40 +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 CC09C620C6; Thu, 30 Nov 2017 16:14: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 951F14BB79; Thu, 30 Nov 2017 16:14:40 +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 vAUGEd8h030797 for ; Thu, 30 Nov 2017 11:14:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5A9AF60D61; Thu, 30 Nov 2017 16:14:39 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id D56C960DCE for ; Thu, 30 Nov 2017 16:14:35 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 30 Nov 2017 17:14:34 +0100 Message-Id: <13190a1e209cf412e3ed4079a84dde5b755e9ddd.1512058458.git.phrdina@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: fix migratable XML for graphics if socket is generated based on config 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 30 Nov 2017 16:14:41 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The graphics code is complex and there are a lot of exceptions and backward compatible combinations. One of them is the possibility to configure "spice_auto_unix_socket" in qemu.conf which will convert all spice graphics with listen type "address" without any address specified to listen type "socket" when the guest is started. We don't format this generated socket into migratable XML to make migration work with older libvirt. However, spice has another exception that if autoport=3D'no' and there is no port configured it is converted to listen type "none". Because of this we need to format autoport=3D'yes' to make sure that the listen type will be the same as the offline XML. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1511407 Signed-off-by: Pavel Hrdina Reviewed-by: Jiri Denemark --- src/conf/domain_conf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b31917dad9..6b35ebf2e9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25159,6 +25159,18 @@ virDomainGraphicsDefFormat(virBufferPtr buf, break; =20 case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET: + /* If socket is auto-generated based on config option we don't + * add any listen element into migratable XML because the orig= inal + * listen type is "address". + * We need to set autoport to make sure that libvirt on destin= ation + * will parse it as listen type "address", without autoport it= is + * parsed as listen type "none". */ + if ((flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) && + glisten->fromConfig) { + virBufferAddStr(buf, " autoport=3D'yes'"); + } + break; + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST: break; } --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list