From nobody Mon Sep 16 19:31:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1679081310; cv=none; d=zohomail.com; s=zohoarc; b=HVww3ln3GAZdjHZf3JFYvvyd7FNoeqHddX25mOFE5IT1fZVQ2x2oEuz/xeL0gdrpLgQsO9EOyJ4wT7SwougvW9ktuk2EKQX53X5Ah71mQ9znTwTZXSXaEZGK+01UFA6mmpSwnhXI7efqayhvQ5+CYfdag4PMugRaZBduynHxdIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679081310; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rH7VrdFBqwl6Cp4a+OCno2OFn7RtEHfhgHfWl7A8U3c=; b=ibjy7dMJM8v9FWfcPf1rzRyvppK7+BgWpkuulQOn6b+FY3Reb/N4MswAvyJHcDaNpbG7O6p2LrEvAQgHpXCrmHhZ+48zEHgYbzJbVfPBAETkWd/c28FxdqU4g1KkMiDwP9cHiZzd7fM35b3RY6+9GRx+puOgdHaMEZkkZ2BwN7I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1679081310790170.55772222120254; Fri, 17 Mar 2023 12:28:30 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-5ExWhbAkOg2tXe8fUmnE8Q-1; Fri, 17 Mar 2023 15:28:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41FCA8030DA; Fri, 17 Mar 2023 19:28:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F15F2166B2C; Fri, 17 Mar 2023 19:28:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C5A3B1946A69; Fri, 17 Mar 2023 19:27:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DB12119466DF for ; Fri, 17 Mar 2023 19:27:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CE36A40C6E68; Fri, 17 Mar 2023 19:27:56 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.226.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 60EAE40C6E67 for ; Fri, 17 Mar 2023 19:27:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679081309; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=rH7VrdFBqwl6Cp4a+OCno2OFn7RtEHfhgHfWl7A8U3c=; b=JgJZacdTjNaqgYWxCkkdkm5cuR0ziykqhbY+7AnhAuj1GZffcAUqu6KGrb1Bg1Jx7rAxZk +vEQO+lSZTXVndz76HXOc4xeLewgxvpocFgjvDeYjdT/hknQC/YMAO32J/gBzKwuBr+n1H ge2G4HBXnp0BHCfa7T36cW/UZeG92o8= X-MC-Unique: 5ExWhbAkOg2tXe8fUmnE8Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 10/15] conf: Don't format firmware type/features when migrating Date: Fri, 17 Mar 2023 20:27:42 +0100 Message-Id: <20230317192747.1311223-11-abologna@redhat.com> In-Reply-To: <20230317192747.1311223-1-abologna@redhat.com> References: <20230317192747.1311223-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1679081312767100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The combination of explicit firmware paths, which we now produce in all cases, and firmware autoselection knobs is explicitly rejected by libvirt 8.6.0 and newer. Right now we produce inherently migratable XML in all cases, since we always strip those bits, but that's going to change soon. To prepare for that, make sure that we always skip the problematic elements and attributes when preparing a migratable XML. The destination will simply receive a fully specified firmware configuration, which is indistinguishable from one that was manually provided by the user and is thus accepted by any old version of libvirt, regardless of whether or not firmware autoselection was used on the source host. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9ef50c818b..9f49c6e62d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27382,6 +27382,7 @@ virDomainDefFormatInternalSetRootName(virDomainDef = *def, const char *type =3D NULL; int n; size_t i; + bool migratable =3D !!(flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE); =20 virCheckFlags(VIR_DOMAIN_DEF_FORMAT_COMMON_FLAGS | VIR_DOMAIN_DEF_FORMAT_STATUS | @@ -27476,7 +27477,7 @@ virDomainDefFormatInternalSetRootName(virDomainDef = *def, } =20 virBufferAddLit(buf, "os.firmware) + if (def->os.firmware && !migratable) virBufferAsprintf(buf, " firmware=3D'%s'", virDomainOsDefFirmwareTypeToString(def->os.firmw= are)); virBufferAddLit(buf, ">\n"); @@ -27499,7 +27500,7 @@ virDomainDefFormatInternalSetRootName(virDomainDef = *def, virBufferAsprintf(buf, ">%s\n", virDomainOSTypeToString(def->os.type)); =20 - if (def->os.firmwareFeatures) { + if (def->os.firmwareFeatures && !migratable) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); =20 --=20 2.39.2