From nobody Sun Oct 25 16:49:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1792415783; cv=none; d=zohomail.com; s=zohoarc; b=JC0RNLdYgNmr2EzgWCHcDsCezlUzoP/U+z5uoGJw9bOPUzkjXZUS6NmrBTTuD641Cw7Xdl0OaLDVDhaf5wrbo3uz1tZbdkoeWe+2nZCVDDzPLhyGWSr+YIBoQOjWtTdfgxFXyeLgGW8FC02+ECG2jgOPDfzEeCMPvbTrqs+JJ1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792415783; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=kILMFjy8X2zCcBWo3yLG7sYcaObs/jX5x8ZHV7S87fE=; b=TGIufd7pd5Rfbb5NU/npTYd/YeeWa2RuDhyK9LuCd0d/O85DDzT6A2Vsh5pXAYbWAY6UfnrlqMcV2qbOfOMmO1bVDKGHcNrd/MCdDuIKiwJCczNbZMXPCz4XHmzTN9bqC2UJsvv/T9DA7TA8VSwicfkQTltMfta/Fk3QemWHyLg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1792415782949481.35009592972574; Mon, 19 Oct 2026 06:16:22 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id A75AE41BC8; Mon, 19 Oct 2026 09:16:21 -0400 (EDT) Received: from [172.19.199.16] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 30F8141C0A; Mon, 19 Oct 2026 09:13:54 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id E13B041962; Mon, 19 Oct 2026 09:13:35 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id DB14741960 for ; Mon, 19 Oct 2026 09:13:34 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-505-VbysGE7VPACbdDBrdHROYQ-1; Mon, 19 Oct 2026 13:13:33 +0000 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 815DC1954227 for ; Mon, 19 Oct 2026 13:13:31 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.8]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D1C3A1956040 for ; Mon, 19 Oct 2026 13:13:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS, SPF_HELO_PASS autolearn=no autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792415614; h=from:from: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; bh=kILMFjy8X2zCcBWo3yLG7sYcaObs/jX5x8ZHV7S87fE=; b=A8ZDNxlTrvHYc4hSnilTq6pbPPp6VkrGV00NyrE9aghOFTcq2dmwSugp8Wxsawbat5Cm3n /17e1CXGP0JQ3V4H1ueMzyYP3Zx5LX5h1JkGFJ+U6dlVyp2NmrZxGi4j7B3Y44+NOzigd9 u7MYK/MeT7rN0f4pa7QfAJEU2y7AvnM= X-MC-Unique: VbysGE7VPACbdDBrdHROYQ-1 X-Mimecast-MFC-AGG-ID: VbysGE7VPACbdDBrdHROYQ_1792415612 To: devel@lists.libvirt.org Subject: [PATCH 1/4] schemas: Introduce 'fdgroup' type and refactor uses Date: Mon, 19 Oct 2026 15:13:25 +0200 Message-ID: <5eb00fd81cecc0b83cdb363ec30ca90f52c948b2.1792415127.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6bhqc1os-8nbFVj5HtoJoSNf7m68ujz65ogdP-T-0Ww_1792415612 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 77LRGICZF234SWX7VQMSPKWGU5L772CH X-Message-ID-Hash: 77LRGICZF234SWX7VQMSPKWGU5L772CH X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1792415785987158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Add a common definition of the 'fdgroup' type used for named FDs passed to a VM. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/schemas/domainbackup.rng | 2 +- src/conf/schemas/domaincommon.rng | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/conf/schemas/domainbackup.rng b/src/conf/schemas/domainbac= kup.rng index 91cf2a7bbd..7140dd7516 100644 --- a/src/conf/schemas/domainbackup.rng +++ b/src/conf/schemas/domainbackup.rng @@ -94,7 +94,7 @@ fd - + diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index d1b10c1c5f..9a74e101a9 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -249,6 +249,16 @@ + + + + + + + + + + @@ -1419,9 +1429,7 @@ - - - + @@ -2006,9 +2014,7 @@ - - - + --=20 2.56.0 From nobody Sun Oct 25 16:49:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1792415853; cv=none; d=zohomail.com; s=zohoarc; b=RNfgZelDSNOJZrxQEM5wp6XPUFdWNRfmWKgRWEarSE878kDWrUY43K9JqlDXERsYSRCngCcgaEaTWUVne8EGUvalRJIsycCWgV1cZYHwLp7NtW2aowYxnJJhkMk/SqQxWecTlwWX+BFaQoVWlOOp+kr7QFHTOk6N8psaCF79qCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792415853; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=cBwxfpQMIrsmO7ScAzS/qdw/Gi3FAi8nBxPu7IUV8iE=; b=EsNkAa3Y73i/fjjZIXclqRtyhDJtbgK3kpGRvDCxs/9XHuoRAqBnhaNTFPHJWFN6zSuUnc2reTCwO6QHsXgGwBkPIOU0aYQdaC7eSWV1fRai0wI3XfvC1OPzRs/6hYwKQbhdE8db5mEfoDNHxdb5yMT8aukmbweNze5iZ50u1ZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1792415853922305.5029492754129; Mon, 19 Oct 2026 06:17:33 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 9D70D41C10; Mon, 19 Oct 2026 09:17:32 -0400 (EDT) Received: from [172.19.199.16] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 44CCE41C77; Mon, 19 Oct 2026 09:13:58 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 86DA04187C; Mon, 19 Oct 2026 09:13:36 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 4419541987 for ; Mon, 19 Oct 2026 09:13:35 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-WCNwc9ENNB2n4-zwl2JSyw-1; Mon, 19 Oct 2026 13:13:33 +0000 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B94BE180049F for ; Mon, 19 Oct 2026 13:13:32 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.8]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 01F94195607F for ; Mon, 19 Oct 2026 13:13:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792415614; h=from:from: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; bh=cBwxfpQMIrsmO7ScAzS/qdw/Gi3FAi8nBxPu7IUV8iE=; b=CfXTZsY8s1a2g4XtzxChuqAQCMlpwKkpzF3TlQe4txbHuK2/N52YJeu2RcP8FivfDMLobD i+0wAOHlASxwNqsd0YGcP3b2Vm69morPOYbc2kbP3Mw7xDiNtjjoZOqaMw0hnt/B2ESohe M6sqGHaaTiTxDQqczaWPSzHrXvGp7rI= X-MC-Unique: WCNwc9ENNB2n4-zwl2JSyw-1 X-Mimecast-MFC-AGG-ID: WCNwc9ENNB2n4-zwl2JSyw_1792415612 To: devel@lists.libvirt.org Subject: [PATCH 2/4] qemu: don't create files for fd-passed new images Date: Mon, 19 Oct 2026 15:13:26 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: GF2-cGOdbri97l4dIJEv4o5yVzCukmadYYLsuTaTd1k_1792415612 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SIU6UMOHZFRQTNC2KY7RXGNPWYPZBD3E X-Message-ID-Hash: SIU6UMOHZFRQTNC2KY7RXGNPWYPZBD3E X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1792415855119158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Code paths which create a file, such as snapshots or backups technically make use of FD-passed new images, but would still attempt to create the file based on the path, which is not desired as the path may not exist in the environment. Skip the creation when FD passing is in use. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_backup.c | 1 + src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_snapshot.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index a0544c83dc..b4e5b7347f 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -451,6 +451,7 @@ qemuBackupDiskPrepareOneStorage(virDomainObj *vm, if (!reuse_external && dd->store->type =3D=3D VIR_STORAGE_TYPE_FILE && + !virStorageSourceIsFD(dd->store) && virStorageSourceSupportsCreate(dd->store)) { if (virFileExists(dd->store->path)) { diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5922065897..fa5b589c29 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14904,7 +14904,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, /* pre-create the image file. This is required so that libvirt can pro= perly * label the image for access by qemu */ - if (!existing) { + if (!existing && !virStorageSourceIsFD(mirror)) { if (supports_create) { if (virStorageSourceCreate(mirror) < 0) { virReportSystemError(errno, "%s", _("failed to create copy= target")); diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 07548ca62e..f3d5b066f3 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1351,7 +1351,7 @@ qemuSnapshotDiskPrepareOne(qemuSnapshotDiskContext *s= napctxt, dd->initialized =3D true; - if (!reuse) { + if (!reuse && !virStorageSourceIsFD(dd->src)) { /* pre-create the image file so that we can label it before ha= nding it to qemu */ if (dd->src->type !=3D VIR_STORAGE_TYPE_BLOCK) { if (virStorageSourceCreate(dd->src) < 0) { --=20 2.56.0 From nobody Sun Oct 25 16:49:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1792415919; cv=none; d=zohomail.com; s=zohoarc; b=aTSVxhhs1lojtB2GWonrJ9zl7vURlG05UEv/MNKfC32q1DoaJmiIxilv78ZjQgI4aYL2i1nd9Txky492l6kM6dXU42E3DMbOlcE6gjSfz2E4iDgjOwdA6ElbQXMQ6ETcMjYKROjBuf1lixFhWWMA5Qrte/gFETYnXbCnnJsijS8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792415919; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=b0dJCimKaHlDPVa+kaw+QCrI1dVpyULLfwpJEa2pFAA=; b=aSugdYOzqWEbCjwqKHIgxfBZvW1UHE7da9FEJGN7xFJyr4DLFOvo/FsG0TB//pJO1GDibCPhnc5JJt+wbEB0wGVicoDqmwEgsntVNmajpJFH7+cnyAidNvn7XSW0F4PnTkRmJnqmRXH2CJbTKc2JMEV1jkXyzWVABxtVF4y++Rg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1792415919500266.1257021818286; Mon, 19 Oct 2026 06:18:39 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8487941ADD; Mon, 19 Oct 2026 09:18:38 -0400 (EDT) Received: from [172.19.199.16] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 59E6441CE7; Mon, 19 Oct 2026 09:14:05 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2439F4187C; Mon, 19 Oct 2026 09:13:37 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 6CFCD41960 for ; Mon, 19 Oct 2026 09:13:36 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-Fib2RYFOOimcfOj-Xe8vng-1; Mon, 19 Oct 2026 13:13:34 +0000 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CBD901800BEC for ; Mon, 19 Oct 2026 13:13:33 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.8]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 285581956040 for ; Mon, 19 Oct 2026 13:13:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792415616; h=from:from: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; bh=b0dJCimKaHlDPVa+kaw+QCrI1dVpyULLfwpJEa2pFAA=; b=dcn685XVMsQ9vfi8XVYkSBycNJZjpXzpOixA59CtPNYleZSPXq1eJl76TEuPYW44OeQ1A/ /hciGdCkjW0mm2hMTMdyI7yIPNkbBNXMo2SYMsKvi7NBuwdjfIpAotxxRx/8g4KT8GWr/p csRN3Yj/0ge9Rgsu1Ufm5Y4tEwhDYRg= X-MC-Unique: Fib2RYFOOimcfOj-Xe8vng-1 X-Mimecast-MFC-AGG-ID: Fib2RYFOOimcfOj-Xe8vng_1792415614 To: devel@lists.libvirt.org Subject: [PATCH 3/4] backup: Allow FD-passing for backup output/scratch file Date: Mon, 19 Oct 2026 15:13:27 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: g69Tl3Q3bzY6RqnNgJ_t82GZdD2TIZTjNCYJJgcFJD0_1792415614 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZPS5HGAMPVGIMZQASTE45V4TZOULY3JT X-Message-ID-Hash: ZPS5HGAMPVGIMZQASTE45V4TZOULY3JT X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1792415920187158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Allow clients to pass in FD for the scratch or output file of the backup. All code is in place now, it just needs to be allowed in the schema. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/schemas/domainbackup.rng | 2 ++ tests/domainbackupxml2xmlin/backup-pull-fd.xml | 4 ++-- tests/domainbackupxml2xmlout/backup-pull-fd.xml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/conf/schemas/domainbackup.rng b/src/conf/schemas/domainbac= kup.rng index 7140dd7516..745a91c33c 100644 --- a/src/conf/schemas/domainbackup.rng +++ b/src/conf/schemas/domainbackup.rng @@ -187,6 +187,7 @@ + @@ -269,6 +270,7 @@ + diff --git a/tests/domainbackupxml2xmlin/backup-pull-fd.xml b/tests/domainb= ackupxml2xmlin/backup-pull-fd.xml index 02ae20d665..1a9765d988 100644 --- a/tests/domainbackupxml2xmlin/backup-pull-fd.xml +++ b/tests/domainbackupxml2xmlin/backup-pull-fd.xml @@ -3,11 +3,11 @@ - + - + diff --git a/tests/domainbackupxml2xmlout/backup-pull-fd.xml b/tests/domain= backupxml2xmlout/backup-pull-fd.xml index 16b9b0be50..348fc21134 100644 --- a/tests/domainbackupxml2xmlout/backup-pull-fd.xml +++ b/tests/domainbackupxml2xmlout/backup-pull-fd.xml @@ -3,11 +3,11 @@ - + - + --=20 2.56.0 From nobody Sun Oct 25 16:49:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1792416009; cv=none; d=zohomail.com; s=zohoarc; b=YhwL8qB2/WZO1eP3s/x401evURoP2u0/91Q/zfe2dLJ0Ea1Ut8/q3LCevobpG9Rb65jcBqi1IbVNuWbQbV5eOTnToZwOjyZFq6N5kvQCHZQevKmCFC6Ql13xAHHiUrwSyxBlr+i5Q3DYnopwK4ejxL5UOwAEdzRK53UcAudYBAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792416009; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=4+xMe058OWxKqqct1tZBeOucTh51pmruFJB0wOWINPQ=; b=TlQldV18ZPxjFraPnv08E87weRHRz48DgENc3IRVMzYSGeP6Sn6tAlvLEMW86f5ztm9CkqrG3cm8XKAlb/bhu1mpCqpqGlsZSYZPKkzfrDsEi+GLP6WRtKaeIsGNXVpb8WJr0co6hHp7XL3exip0wxEnRgj9Yt6pRBs8HrHHEVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1792416009629617.7911901409502; Mon, 19 Oct 2026 06:20:09 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id D8B5F419DB; Mon, 19 Oct 2026 09:20:07 -0400 (EDT) Received: from [172.19.199.16] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id DBFB641D20; Mon, 19 Oct 2026 09:14:13 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id D58AE41962; Mon, 19 Oct 2026 09:13:38 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B95AA41830 for ; Mon, 19 Oct 2026 09:13:37 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-370-ye0eA9ejM5yq4_oYjVYT1g-1; Mon, 19 Oct 2026 13:13:36 +0000 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 280B11800EFA for ; Mon, 19 Oct 2026 13:13:35 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.8]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4A2481956040 for ; Mon, 19 Oct 2026 13:13:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792415617; h=from:from: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; bh=4+xMe058OWxKqqct1tZBeOucTh51pmruFJB0wOWINPQ=; b=ZUsi0Y0pmsoksK7LfpgdyE6iQi1+1VVTKxXzEsijUhL8lR096aMqIDrtySSEugYCWRS7fh EXt6wpxTaCe/yv33Tq0OEgQiNkQ5FFhtkee+2j4BJexIkwKTkOez4l6ZerKpL7EpGjf8WO 5YduDVg83kQogQCd54EbxVUW66BY5gY= X-MC-Unique: ye0eA9ejM5yq4_oYjVYT1g-1 X-Mimecast-MFC-AGG-ID: ye0eA9ejM5yq4_oYjVYT1g_1792415615 To: devel@lists.libvirt.org Subject: [PATCH 4/4] backup: Add support for sparsifying output images of full backups Date: Mon, 19 Oct 2026 15:13:28 +0200 Message-ID: <9bd71364bd5f8938fbe162edb4896359fade5b04.1792415127.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EEXHwlq_i2Zld5RmbtUPM2r0YfaUY9WHM1lXbVu1mTI_1792415615 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: KNUP4QBOIXA4Y3NAEUXPDXM6T2GO4IJK X-Message-ID-Hash: KNUP4QBOIXA4Y3NAEUXPDXM6T2GO4IJK X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1792416014107158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa When taking a full backup of a VM which has potentially fully-allocated zero blocks the output image will not be sparse. Add an option to sparsify full backups so that they potentially skip large blocks of NUL blocks. For incremental backup images this is obviously not possible as any NUL blocks were actually zeroed-out by the VM so they need to be written as-is. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/formatbackup.rst | 5 +++++ src/conf/backup_conf.c | 18 +++++++++++++++++- src/conf/backup_conf.h | 2 ++ src/conf/schemas/domainbackup.rng | 10 ++++++++++ src/qemu/qemu_backup.c | 5 +++++ .../backup-push-sparsify.xml | 12 ++++++++++++ .../backup-push-sparsify.xml | 19 +++++++++++++++++++ tests/genericxml2xmltest.c | 1 + 8 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 tests/domainbackupxml2xmlin/backup-push-sparsify.xml create mode 100644 tests/domainbackupxml2xmlout/backup-push-sparsify.xml diff --git a/docs/formatbackup.rst b/docs/formatbackup.rst index 24857eaf72..db7ccf802b 100644 --- a/docs/formatbackup.rst +++ b/docs/formatbackup.rst @@ -115,6 +115,11 @@ were supplied). The following child elements and attri= butes are supported: for an incremental backup exported via NBD export name for the gi= ven disk. Valid only for pull mode backups. + ``sparsify`` + Valid only for ``full`` push mode backups. + Requests that any zero blocks are un-allocated in the backup file= even + when they were allocated in the source. :since:`Since 12.9.0` + ``type`` A mandatory attribute to describe the type of the disk, except wh= en ``backup=3D'no'`` is used. Valid values include ``file``, or ``bl= ock``. diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index b20292af3d..87a5b64116 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -129,7 +129,11 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node, if (def->backup =3D=3D VIR_TRISTATE_BOOL_NO) return 0; - if (!push) { + if (push) { + if (virXMLPropTristateBool(node, "sparsify", VIR_XML_PROP_NONE, + &def->sparsify) < 0) + return -1; + } else { def->exportname =3D virXMLPropString(node, "exportname"); def->exportbitmap =3D virXMLPropString(node, "exportbitmap"); } @@ -325,6 +329,10 @@ virDomainBackupDiskDefFormat(virBuffer *buf, virBufferEscapeString(&attrBuf, " exportname=3D'%s'", disk->export= name); virBufferEscapeString(&attrBuf, " exportbitmap=3D'%s'", disk->expo= rtbitmap); + if (disk->sparsify !=3D VIR_TRISTATE_BOOL_ABSENT) + virBufferAsprintf(&attrBuf, " sparsify=3D'%s'", + virTristateBoolTypeToString(disk->sparsify)); + if (disk->store->id !=3D 0) virBufferAsprintf(&attrBuf, " index=3D'%u'", disk->store->id); @@ -535,6 +543,14 @@ virDomainBackupAlignDisks(virDomainBackupDef *def, if (!backupdisk->incremental && backupdisk->backupmode =3D=3D VIR_DOMAIN_BACKUP_DISK_BACKUP_MO= DE_INCREMENTAL) backupdisk->incremental =3D g_strdup(def->incremental); + + if (backupdisk->sparsify =3D=3D VIR_TRISTATE_BOOL_YES && + backupdisk->backupmode =3D=3D VIR_DOMAIN_BACKUP_DISK_BACKUP_MO= DE_INCREMENTAL) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The 'sparsify' mode of disk '%1$s' can be us= ed only for full backup"), + backupdisk->name); + return -1; + } } return 0; diff --git a/src/conf/backup_conf.h b/src/conf/backup_conf.h index f90a4dcaee..49417ca90d 100644 --- a/src/conf/backup_conf.h +++ b/src/conf/backup_conf.h @@ -65,6 +65,8 @@ struct _virDomainBackupDiskDef { char *exportname; /* name of the NBD export for pull mode backup */ char *exportbitmap; /* name of the bitmap exposed in NBD for pull mode= backup */ + virTristateBool sparsify; /* sparsify full backup output file */ + /* details of target for push-mode, or of the scratch file for pull-mo= de */ virStorageSource *store; diff --git a/src/conf/schemas/domainbackup.rng b/src/conf/schemas/domainbac= kup.rng index 745a91c33c..7924420815 100644 --- a/src/conf/schemas/domainbackup.rng +++ b/src/conf/schemas/domainbackup.rng @@ -175,9 +175,19 @@ + + + + + + + + + + file diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index b4e5b7347f..d46d488b03 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -315,6 +315,11 @@ qemuBackupDiskPrepareDataOne(virDomainObj *vm, dd->backingStore =3D dd->terminator =3D virStorageSourceNew(); } + if (backupdisk->sparsify =3D=3D VIR_TRISTATE_BOOL_YES) { + backupdisk->store->detect_zeroes =3D VIR_DOMAIN_DISK_DETECT_ZEROES= _UNMAP; + backupdisk->store->discard =3D VIR_DOMAIN_DISK_DISCARD_UNMAP; + } + if (qemuDomainPrepareStorageSourceBlockdev(NULL, dd->store, priv, cfg)= < 0) return -1; diff --git a/tests/domainbackupxml2xmlin/backup-push-sparsify.xml b/tests/d= omainbackupxml2xmlin/backup-push-sparsify.xml new file mode 100644 index 0000000000..e8403da037 --- /dev/null +++ b/tests/domainbackupxml2xmlin/backup-push-sparsify.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/domainbackupxml2xmlout/backup-push-sparsify.xml b/tests/= domainbackupxml2xmlout/backup-push-sparsify.xml new file mode 100644 index 0000000000..d402f8acd4 --- /dev/null +++ b/tests/domainbackupxml2xmlout/backup-push-sparsify.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index 269de3501f..7a8074bbe5 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -267,6 +267,7 @@ mymain(void) DO_TEST_BACKUP("backup-push"); DO_TEST_BACKUP("backup-push-seclabel"); DO_TEST_BACKUP("backup-push-encrypted"); + DO_TEST_BACKUP("backup-push-sparsify"); DO_TEST_BACKUP_FULL("backup-pull-internal-invalid", true); --=20 2.56.0