From nobody Thu May 15 23:00:04 2025 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 1500896480073167.88783399962983; Mon, 24 Jul 2017 04:41:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E02B978EBF; Mon, 24 Jul 2017 11:41:17 +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 ADA0D6933A; Mon, 24 Jul 2017 11:41:17 +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 5CD6B180597D; Mon, 24 Jul 2017 11:41:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6OBfDQX012089 for ; Mon, 24 Jul 2017 07:41:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id C27696C206; Mon, 24 Jul 2017 11:41:13 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4AB4C61B91 for ; Mon, 24 Jul 2017 11:41:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E02B978EBF 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 E02B978EBF From: Andrea Bolognani To: libvir-list@redhat.com Date: Mon, 24 Jul 2017 13:40:57 +0200 Message-Id: <1500896458-28115-2-git-send-email-abologna@redhat.com> In-Reply-To: <1500896458-28115-1-git-send-email-abologna@redhat.com> References: <1500896458-28115-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/2] conf: Fix backwards migration of pSeries guests 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 24 Jul 2017 11:41:18 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Recent commits made it so that pci-root controllers for pSeries guests are automatically assigned the spapr-pci-host-bridge model name; however, that prevents guests to migrate to older versions of libvirt which don't know about that model name at all, which at the moment is all of them :) To avoid the issue, just strip the model name from PHBs when formatting the migratable XML; guests that use more than one PHB are not going to be migratable anyway. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d88a88e..b5ab97a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21813,7 +21813,30 @@ virDomainControllerDefFormat(virBufferPtr buf, } =20 if (def->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI) { - if (def->opts.pciopts.modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MOD= EL_NAME_NONE) { + bool formatModelName =3D true; + + if (def->opts.pciopts.modelName =3D=3D VIR_DOMAIN_CONTROLLER_PCI_M= ODEL_NAME_NONE) + formatModelName =3D false; + + /* Historically, libvirt didn't support specifying a model name for + * pci-root controllers; starting from 3.6.0, however, pSeries gue= sts + * use pci-root controllers with model name spapr-pci-host-bridge = to + * represent all PHBs, including the default one. + * + * In order to allow migration of pSeries guests from older libvirt + * versions and back, we don't format the model name in the migrat= able + * XML if it's spapr-pci-host-bridge, thus making "no model name" = and + * "spapr-pci-host-bridge model name" basically equivalent. + * + * The spapr-pci-host-bridge device is specific to pSeries. + */ + if (def->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT && + def->opts.pciopts.modelName =3D=3D VIR_DOMAIN_CONTROLLER_PCI_M= ODEL_NAME_SPAPR_PCI_HOST_BRIDGE && + flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) { + formatModelName =3D false; + } + + if (formatModelName) { modelName =3D virDomainControllerPCIModelNameTypeToString(def-= >opts.pciopts.modelName); if (!modelName) { virReportError(VIR_ERR_INTERNAL_ERROR, --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list