From nobody Sat Nov 23 18:01:25 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=1723387491; cv=none; d=zohomail.com; s=zohoarc; b=YiBPLQus1qcuVgWAmxhXnHGBv9LvSsw06tUhlA4hZpuhIGJUC3roAnCXHa3Dg187Sc6qQElUp8lWwu5cK1NkcZP2h8q1EkkGD0TywoMmvjkj8L+pZbykFBgblDbvCylW9jfBZP+ceClUVc7CIattzjq+VE3fRAcXS/rPusKGsco= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723387491; 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=P+t5QdraqPsFV9PAEALPPj4psrsX9LeOObCgzoZcW+E=; b=Es2tM/YUyWrhECY1uAFFqc3ybd2+3ErR3IsJFRmkYlo7hVnc8pg9LNbbYe9cBH9SXA/IUzvpLpvHYyl/WJgVv92dd8af9CUkZ7TKkpYSkvMsVHqYCZzW/73DFGPRUX9xvQSrPRKTCO5+VJkIXXAjN8PQ7ZGdMh9bszdH3p3TS48= 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 1723387491942524.659700045498; Sun, 11 Aug 2024 07:44:51 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D0E8014DC; Sun, 11 Aug 2024 10:44:50 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C16AC1576; Sun, 11 Aug 2024 10:44:12 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 196511441; Sun, 11 Aug 2024 10:44:09 -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 6EAAB1433 for ; Sun, 11 Aug 2024 10:44:08 -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 1sd9m5-00FzIb-14; Sun, 11 Aug 2024 16:44:00 +0200 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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=8YOxOMLkGQFSsE7sxmCt4eqb3pNTaGD//ksopiwko8Q=; b=Ok2zpM7+/A5N 1Zsu9KtI0KhUe7enoKCxrkEoZ3pN2QLpkYDFl4BSwPBbRXWZr8ULaSWeTtZHkl/6XhwwgmOlltK1t DdAbpTvZtvQ3cPrio0cCyIIEe2w0nXhlI/SVSWZOOqeSy3YOlEkN+Ixo6pCFf4KzR7/u+gJMlOSQr Jk9Xut5i7Ip1oxDz/EnichE8Nhp9wWOhRddWb493XYE4Io4QbSu+qMpvXOmNwjXBFB1GvMi9KmFRG Lvs4K4rfm5oDLGDbcVyQHWoK0FlnUbYsEzfFmS4H2Wq28ZV3tMQDl1DukCTeyaw04Wx+zed9Av8A4 K+S9APUNDVlCu4xD1cy2AQ==; To: devel@lists.libvirt.org Subject: [PATCH 1/3] conf: add data-file feature and related fields to virStorageSource Date: Sun, 11 Aug 2024 17:34:46 +0300 Message-ID: <20240811144340.60108-2-nikolai.barybin@virtuozzo.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240811144340.60108-1-nikolai.barybin@virtuozzo.com> References: <20240811144340.60108-1-nikolai.barybin@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: UHDLTZMNOMPOQYBR4ES6W3A4Y7OKD7S6 X-Message-ID-Hash: UHDLTZMNOMPOQYBR4ES6W3A4Y7OKD7S6 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: 1723387492388116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Nikolai Barybin --- src/conf/storage_source_conf.c | 8 ++++++++ src/conf/storage_source_conf.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 908bc5fab2..d76de058b9 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 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