From nobody Mon Feb 9 06:26:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1618328330; cv=none; d=zohomail.com; s=zohoarc; b=HWyWImtniQXOmwK9EcjxDTA4JPa+YZO7aEp0o5OJi05rJKPLNGYzY6R6OE9uHvJW4vsodvhvZO4pEqFAmkPgl9aDi3z3rvj6PvD5NbGUnxz9LKdebI8puPO2VhIkBFYrSOCzIFDx4z69J9poQeiCV9vRYxA39m4vqhimsh1IyIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618328330; 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=II41heZUWkbazAdUB2jZjGMkm7DPV1avZIe/iqe82qQ=; b=mMzExKx5fcWlXQZ2+rYPH+jIKQcbRtQXiLNVcBCT2lqJSOlHj+QFqooAnqJdL/unK1t7xmAOYlrCd/XzI5Au9zvBPs7jNHYc3lfEB8NNPNgU3jTsn1balRA1HjGzJPLEvhe1F9G7rbng4sN2FZ6rtWBceJjal+dx8Y8f0Gj3tM0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1618328330452700.2751140393337; Tue, 13 Apr 2021 08:38:50 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-578-rW9qzLmwOzOk1CYG8xeUOA-1; Tue, 13 Apr 2021 11:38:46 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id F087C19251A2; Tue, 13 Apr 2021 15:38: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 CCC305C26D; Tue, 13 Apr 2021 15:38: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 93D4244A62; Tue, 13 Apr 2021 15:38: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 13DFcZpb012893 for ; Tue, 13 Apr 2021 11:38:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8697A2B0A9; Tue, 13 Apr 2021 15:38:35 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id E410550D15 for ; Tue, 13 Apr 2021 15:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618328328; 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=II41heZUWkbazAdUB2jZjGMkm7DPV1avZIe/iqe82qQ=; b=FMJXrlsKBg+D2YQgIG1bt1mLiKdh+kLu8Ox89Zji819vVmIjm4aAu0EKGLpP0QoTsnCxzX SI03DvNyQqTbHi8IUuOdrHd99vnk/CNl+02Bs5FlYBDF6gsuxshzVOuk2uhv6N0q4+0YTh rmsZzoSO3L6RgQP0Chm31mLj/wTkgp0= X-MC-Unique: rW9qzLmwOzOk1CYG8xeUOA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 2/7] qemuMigrationCookieNBDXMLFormat: Format empty element Date: Tue, 13 Apr 2021 17:38:22 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit 518be41aaa3 refactored qemuMigrationCookieNBDXMLFormat to use virXMLFormatElement which in comparison to the previous code doesn't format the element if it's empty. Unfortunately some crusty bits of our migration code use questionable logic to assert use of the old-style storage migration parameters which breaks if no disks are being migrated and the element is not present. While later patches will fix the code, re-instate formatting of empty for increased compatibility. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani --- src/qemu/qemu_migration_cookie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index 41533e4549..52998ddd1b 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -790,7 +790,7 @@ qemuMigrationCookieNBDXMLFormat(qemuMigrationCookieNBD = *nbd, virBufferAsprintf(&childBuf, " capacity=3D'%llu'/>\n", nbd->disks[= i].capacity); } - virXMLFormatElement(buf, "nbd", &attrBuf, &childBuf); + virXMLFormatElementEmpty(buf, "nbd", &attrBuf, &childBuf); } --=20 2.30.2