From nobody Thu Nov 21 16:26:17 2024 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=1732119332; cv=none; d=zohomail.com; s=zohoarc; b=hrJ/xct5O5Gkq5GDAFltWK2y6JR21FlLBAWaMcs1jaJZdmvyVX8OO3xy7aRxRm4rrOT2zYebEfB9f1vK1Q7sYI4QJ57XrXmr3TQIovFHGTGt+/XX5ZJpnCXvaEDzQWGXYFT82B8VLVS87X25EBv2gJoXf4Yx6a/l8+6vR3J5GCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732119332; 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=0aZXOzfauhro0fW1dUXB/UVJtG79cgBKIIqi07OH+iY=; b=ByrDnqIKACnXEF2b9sLLGj3GQmMIIDMpdIaIxK1Z8owvxw8ErmMHq9CvgtkhI/SmX5KiCyb8/EmVrbVqfCffHV/fxL4iNk6Se1ADHu5+gdB0V9fApnE4tIDcezrcTb6AO+wIDCw5tEl7ffy5ynKsCqbhd1M+BBSZsy7uM6zLi5A= 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 1732119332444990.5994771954018; Wed, 20 Nov 2024 08:15:32 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 6EACA1983; Wed, 20 Nov 2024 11:15:31 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id DF3B51517; Wed, 20 Nov 2024 11:10:11 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9C91015F2; Wed, 20 Nov 2024 11:10:04 -0500 (EST) 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 D53BD1557 for ; Wed, 20 Nov 2024 11:09:47 -0500 (EST) 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 1tDn0V-0005yc-2s; Wed, 20 Nov 2024 16:52:43 +0100 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,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,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=0+Jd78QPcCwfTRJknaLxrclYlNnRL7lOqZ34XHd5M/s=; b=EIvtxDShn00h 9tgOLnlzqzP7powfRPyQw3Gv4998ihVn5iqsg/HuIR7zyOQEyUDioqt/7pBVCHUdb3eIAtEEz4Hyn EQ1n9MzSEEKzzQKifin6jJD80iNmFYAYKRlyzvIkEFcxlcGzdt+sKyY+SDY1YGEK9CPPEiwchv2bu SijHHAApY+DtiEaYmGn79CUsAK6z5Y5aWM0xJNUzPepaX1UxT49p5EFMinVEac9Rfa6Ut5/RYHR8s xktXi18bDPC9ZINGz2+a2GeWwmxssg1wbDlgUISDhaaswAv+A/EXCk2gp8kLmne7A8kTylDXgPfYO xljSADeVk+3xE07NOPX2Fw==; To: devel@lists.libvirt.org Subject: [PATCH 01/15] conf: add data-file feature and related fields to virStorageSource Date: Wed, 20 Nov 2024 18:48:36 +0300 Message-ID: <20241120155229.1259-2-nikolai.barybin@virtuozzo.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241120155229.1259-1-nikolai.barybin@virtuozzo.com> References: <20241120155229.1259-1-nikolai.barybin@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CVIJ23PRRI6WRECL4FSR4V3TZDDE24CL X-Message-ID-Hash: CVIJ23PRRI6WRECL4FSR4V3TZDDE24CL 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: 1732119333341116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolai Barybin Reviewed-by: Peter Krempa --- src/conf/storage_source_conf.c | 10 ++++++++++ src/conf/storage_source_conf.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 5b9a80f100..d4e39b9b57 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -829,6 +829,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); @@ -894,6 +895,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 @@ -1174,6 +1181,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 a507116007..aa2aa680de 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -359,6 +359,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 +372,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