From nobody Mon Feb 9 05:46:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; 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 8.43.85.245 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=1725719461; cv=none; d=zohomail.com; s=zohoarc; b=M+is00q2XnYT9MAMe9zOcPLCC6CJZk2POQSJZsjG/lV5GRh32qHlB4zUvaJxay7r1sqIHkVcqNwYc9FSwIeY447hlrP0tO2Wfs/PHTB2I2mRrH9NyHff83ZD02YL4Kn0nMBrX5/Nq5l9IVJX/RU/6rCcFW0b7lrm/vkzEvsAXz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725719461; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=uN2z/ZDcdxgiPvZVNCuggDFMSh4sG2sDOlk0KhqCqXA=; b=exIYe/n+fpeQa01l7CFV90zFq9GZWqvZ8LDjqOETlQJstuaoJbz8IahbRiLnuBS4Cm22VlmKuPT0iSaL+UzJdaD6xOwNFfH/3hwXhOncxsRqWEXmw7rIae+muOzvTCSlBdavpbFvyfr5imkq1NRQ2Ujld6WDOu+uQCDJ/mw+ZF4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 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 [8.43.85.245]) by mx.zohomail.com with SMTPS id 1725719461483407.49362066441165; Sat, 7 Sep 2024 07:31:01 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 64F5E17DA; Sat, 7 Sep 2024 10:31:00 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 351A417F0; Sat, 7 Sep 2024 10:30:42 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0E72B17DD; Sat, 7 Sep 2024 10:30:39 -0400 (EDT) Received: from relay.virtuozzo.com (relay.virtuozzo.com [130.117.225.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 062591876 for ; Sat, 7 Sep 2024 10:30:32 -0400 (EDT) Received: from [130.117.225.1] (helo=vz9-barybin-2.ch-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1smwPs-001ZxE-03; Sat, 07 Sep 2024 16:30:26 +0200 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=0msuzy2PBroTqbsuSWi2ZIkql6Nt9zl1G0e6caf3LaQ=; b=nNnpqVC4VnfE R9s5gK/5XDbjD5NchU4Mqbkc+tbARdMGeFQTYeD/juqXAJ8BCMil2w5ofz0yTCR+WgHO4YVfN1u3Y SKz4SRBpusvDA9h8eB9EfsDyJcLamLdYewyFZhljZmi0cJBqXstkdGAc3TIEuEh7f9nV25/mM5Nat mEmEDiQdPQn0VvnRm5TJ+LCqJ3RW+ZFYHgR7q8ZAraYyxQTdvIXv+UNjmoLOhuWk3Uu6bdIvrdCv6 F+5I0Xla/MQC/Nsd1hKwdkculpZddlCM5Pj50sG8CbVwJU9uim13FgppV9NMZQ6Ldo1AqEMn1eL63 5kq6B3fZy9n3ar3LMb7v8g==; To: devel@lists.libvirt.org Subject: [PATCH v2 01/13] conf: add data-file feature and related fields to virStorageSource Date: Sat, 7 Sep 2024 17:15:17 +0300 Message-ID: <20240907143006.50677-3-nikolai.barybin@virtuozzo.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240907143006.50677-1-nikolai.barybin@virtuozzo.com> References: <20240907143006.50677-1-nikolai.barybin@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GCPWZGAN5HR46OH6RK5LUZUC5SDNUQWH X-Message-ID-Hash: GCPWZGAN5HR46OH6RK5LUZUC5SDNUQWH X-MailFrom: nikolai.barybin@virtuozzo.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: den@openvz.org, Nikolai Barybin X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Nikolai Barybin via Devel Reply-To: Nikolai Barybin X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1725719462582116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolai Barybin --- src/conf/storage_source_conf.c | 11 +++++++++++ src/conf/storage_source_conf.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 908bc5fab2..5d197ee3ca 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -69,6 +69,7 @@ VIR_ENUM_IMPL(virStorageFileFeature, VIR_STORAGE_FILE_FEATURE_LAST, "lazy_refcounts", "extended_l2", + "data_file", ); =20 =20 @@ -826,6 +827,7 @@ virStorageSourceCopy(const virStorageSource *src, def->relPath =3D g_strdup(src->relPath); def->backingStoreRaw =3D g_strdup(src->backingStoreRaw); def->backingStoreRawFormat =3D src->backingStoreRawFormat; + def->dataFileRaw =3D g_strdup(src->dataFileRaw); def->snapshot =3D g_strdup(src->snapshot); def->configFile =3D g_strdup(src->configFile); def->nodenameformat =3D g_strdup(src->nodenameformat); @@ -891,6 +893,12 @@ virStorageSourceCopy(const virStorageSource *src, return NULL; } =20 + if (src->dataFileStore) { + if (!(def->dataFileStore =3D virStorageSourceCopy(src->dataFileSto= re, + false))) + return NULL; + } + if (src->fdtuple) def->fdtuple =3D g_object_ref(src->fdtuple); =20 @@ -1171,6 +1179,9 @@ virStorageSourceClear(virStorageSource *def) VIR_FREE(def->nodenamestorage); VIR_FREE(def->nodenameformat); =20 + VIR_FREE(def->dataFileRaw); + g_clear_pointer(&def->dataFileStore, virObjectUnref); + virStorageSourceBackingStoreClear(def); =20 VIR_FREE(def->tlsAlias); diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index 05b4bda16c..fa27e61204 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -88,6 +88,7 @@ VIR_ENUM_DECL(virStorageFileFormat); typedef enum { VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS =3D 0, VIR_STORAGE_FILE_FEATURE_EXTENDED_L2, + VIR_STORAGE_FILE_FEATURE_DATA_FILE, =20 VIR_STORAGE_FILE_FEATURE_LAST } virStorageFileFeature; @@ -359,6 +360,9 @@ struct _virStorageSource { /* backing chain of the storage source */ virStorageSource *backingStore; =20 + /* qcow2 data file source */ + virStorageSource *dataFileStore; + /* metadata for storage driver access to remote and local volumes */ void *drv; =20 @@ -369,6 +373,7 @@ struct _virStorageSource { /* Name of the child backing store recorded in metadata of the * current file. */ char *backingStoreRaw; + char *dataFileRaw; virStorageFileFormat backingStoreRawFormat; =20 /* metadata that allows identifying given storage source */ --=20 2.43.5