From nobody Thu Apr 25 20:37:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1530884614219753.3368951197717; Fri, 6 Jul 2018 06:43:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE1CA308404E; Fri, 6 Jul 2018 13:43:31 +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 1A78090094; Fri, 6 Jul 2018 13:43:31 +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 37A814A460; Fri, 6 Jul 2018 13:43:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66DhRSn010760 for ; Fri, 6 Jul 2018 09:43:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id D01D790094; Fri, 6 Jul 2018 13:43:27 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5AB26C52A for ; Fri, 6 Jul 2018 13:43:27 +0000 (UTC) Received: from mail-vk0-f47.google.com (mail-vk0-f47.google.com [209.85.213.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F51B3001D5C for ; Fri, 6 Jul 2018 13:43:17 +0000 (UTC) Received: by mail-vk0-f47.google.com with SMTP id s23-v6so6830539vks.7 for ; Fri, 06 Jul 2018 06:43:17 -0700 (PDT) Received: from localhost.localdomain ([186.223.119.111]) by smtp.gmail.com with ESMTPSA id q63-v6sm3210707vkf.46.2018.07.06.06.43.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 06:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=INA6roUAgUTffmKF7jg/r6s2sb2vpVJTEsrDX4Be4lw=; b=EeQWiR1ozgrvDNtXHSt9PWZgrmI7dMgZ1PqZvMPmRZtt4R8qNEOi/EJfcTs0+mwGNM qjJyZMP/Gw3drlT55NL7Et39+P8jrgmy4ate0t4YCFxCNsgQ7f4OdOvjKJYk8a2/YZ7B F4hp/97qR9PpohWMOefPTYpBPbrQ3mgrt3slhTUv02L5q08U0Qpk1truwio4zckWbWLQ AATW6cLbBdMqJY+RSCQCI66rTGKn8MatsiKYEaiIh2Ru9aA4W+DDaZ0reTQRVgm5fZ1m PBGdwbXeEkiVcXSYITJegrRp8lL68NH7NWGgql5+pB/i8NJ8tTlD6qoJZi+xmpkbG5vF y2Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=INA6roUAgUTffmKF7jg/r6s2sb2vpVJTEsrDX4Be4lw=; b=tRjt65F/AjGawUjtnldQoW2GOFqtg0Hxu2QSuPZ2WIyx46jeSzhWcVns8/H/Cox3N+ 55pkHFxGXbv5yMqNV2JrIVuA58QEaiKn8p1VB55ma9DVan1OkkZk810fqp26eIKeVkqV wLu8aGC7sXo9w7Z7E3BqYEAjQOsQC1y9GKoh7zkgN+9fQHslVnCbSVvHAfKXNdfyv+oY /6CDs3BjRsE3/LvCGWaXmdt6hEV7ousjEfSGNTO7ggc5VxAks9HAgIcmO6PgmpEP+aDJ C3DFXjK22QO0bjumw4Ygn2vw/aO57ryyYYWG7sUS8KI2dLVtjRa+fmSks1OE1RniQm/c Lvuw== X-Gm-Message-State: APt69E3qtY8BwCSueqCwP9xEN9t10IqG6997erXnMJM519X1TUTjEYcv 3zHhht20vudh9bY6Oibe46Ov8w== X-Google-Smtp-Source: AAOMgpdK8RURIoJ2IBgv6MsNSuXVIIuWu5gAPvBPJte6EDSm+vMgw60/3djylbw67RZ1sI7Sqx5zGQ== X-Received: by 2002:a1f:21c5:: with SMTP id h188-v6mr5647976vkh.191.1530884595884; Fri, 06 Jul 2018 06:43:15 -0700 (PDT) From: Julio Faracco To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 10:43:00 -0300 Message-Id: <20180706134301.5093-2-jcfaracco@gmail.com> In-Reply-To: <20180706134301.5093-1-jcfaracco@gmail.com> References: <20180706134301.5093-1-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 06 Jul 2018 13:43:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 06 Jul 2018 13:43:17 +0000 (UTC) for IP:'209.85.213.47' DOMAIN:'mail-vk0-f47.google.com' HELO:'mail-vk0-f47.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.3 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.213.47 mail-vk0-f47.google.com 209.85.213.47 mail-vk0-f47.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] configure: Adding XFS library/headers check. 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 06 Jul 2018 13:43:33 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This commit checks for xfs.h library to use XFS_IOC_CLONE which is defined into that library file. So, after that it is possible to use thie macro to create reflinks. Signed-off-by: Julio Faracco --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 59d2d09611..a87ca06854 100644 --- a/configure.ac +++ b/configure.ac @@ -625,6 +625,13 @@ if test "$with_linux" =3D "yes"; then AC_CHECK_HEADERS([linux/btrfs.h]) fi =20 +dnl +dnl check for xfs dev headers required by xfs ioctl +dnl +if test "$with_linux" =3D "yes"; then + AC_CHECK_HEADERS([xfs/xfs.h]) +fi + dnl dnl check for DEVLINK_CMD_ESWITCH_GET dnl --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 20:37:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1530884614980371.82861756607736; Fri, 6 Jul 2018 06:43:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA80430E6857; Fri, 6 Jul 2018 13:43:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7564E30001ED; Fri, 6 Jul 2018 13:43:33 +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 1E1AF1800B69; Fri, 6 Jul 2018 13:43:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66DhU2j010773 for ; Fri, 6 Jul 2018 09:43:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 11F2A6253A; Fri, 6 Jul 2018 13:43:30 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06A6F6253B for ; Fri, 6 Jul 2018 13:43:29 +0000 (UTC) Received: from mail-vk0-f67.google.com (mail-vk0-f67.google.com [209.85.213.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8EF0CC0467C3 for ; Fri, 6 Jul 2018 13:43:18 +0000 (UTC) Received: by mail-vk0-f67.google.com with SMTP id h22-v6so6839135vke.4 for ; Fri, 06 Jul 2018 06:43:18 -0700 (PDT) Received: from localhost.localdomain ([186.223.119.111]) by smtp.gmail.com with ESMTPSA id q63-v6sm3210707vkf.46.2018.07.06.06.43.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 06:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=2EIcPYLMbvBcNDQo2GmTu3mzyz35uQPtvD4NdAs0ZXg=; b=r8TVHCOJuidk1XqqiAw2hRebUINRotWcXk73sHnaEWu9OmBsdtQynZyvtIYctLgyYs MvdADm+NjCy68js7IBQCmmNy7IrTpbkw+o97lCOFRJHWFRkMSJYhPRmpX/CPevAiV7xe af6/2cQtrCfd2129XploC1tUqZEtA1b9Qvodcwta+aE7V7aTtOf/n+g8FxBDJPlDhXSo EvBXarIVOMwgpWzKCLnZe+wO1vmN+FoTppNiVO+PJ199CT6+pVlD9Xn2eAmjxU+OiQBY DhgR9PA2ZYfKMLi71QnEzDmCsyCiYnsytqo1UL2yM05jxQjWJuGAe17YW0zf4QCdbPlp Qh6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=2EIcPYLMbvBcNDQo2GmTu3mzyz35uQPtvD4NdAs0ZXg=; b=Rebk1i3RojdO891J22NSA+/1dEqxG2TB5LEzFCQu/aikdCyjKvByNgwl9qm+2PIymW ZBG1znu/CG1P2LteNegsOMiXEG9Ld3umR45iGRv92QHaWHyrIhnFQVFjS0X4NU16GgFy ohbL+4APwJsYFJfOLnXFwxSpozPcOa8/g2nE8qq1m/LsgBkJ7RndI7haipCIxi7yxOTg QOtQcgrqy4iA4I0k36+YaBJUBMyN5rrCqS4u8+yg27g0NOAycLPJP/Ho7gJWeMfnQtZc Ju7MF3Kcy7iELuOJ13szgVhGCIBZ0ybc4JzBsofdKhKejMr8xUSB7fdL+upYjxFALDDR kKHw== X-Gm-Message-State: APt69E3fUOTpvxhculEzs6PGiE6Dc1h+mrKM3NSYNbZi7LfedgCGj6co BKK4Jf34IJTJMSrAZtDaj7BbiQ== X-Google-Smtp-Source: AAOMgpfUgGeGPfA/SZsxgYPcj5QJeBeApPE9/lGUTE/tD7YLw18Ge85qDBdvJD0jqgXv95sYn1aNIg== X-Received: by 2002:a1f:4ec6:: with SMTP id c189-v6mr5801856vkb.188.1530884597366; Fri, 06 Jul 2018 06:43:17 -0700 (PDT) From: Julio Faracco To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 10:43:01 -0300 Message-Id: <20180706134301.5093-3-jcfaracco@gmail.com> In-Reply-To: <20180706134301.5093-1-jcfaracco@gmail.com> References: <20180706134301.5093-1-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 06 Jul 2018 13:43:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 06 Jul 2018 13:43:18 +0000 (UTC) for IP:'209.85.213.67' DOMAIN:'mail-vk0-f67.google.com' HELO:'mail-vk0-f67.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.281 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 209.85.213.67 mail-vk0-f67.google.com 209.85.213.67 mail-vk0-f67.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] storage: Rename btrfsCloneFile to support other filesystems. 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 06 Jul 2018 13:43:34 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This commit renames and adds other macros to support aother filesystems when a reflink is performed. After that, XFS filesystems (and others) with reflink support will be able to clone. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1565004 Signed-off-by: Julio Faracco --- src/storage/storage_util.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index a701a75702..fd1239c6cb 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -36,6 +36,9 @@ # ifndef FS_NOCOW_FL # define FS_NOCOW_FL 0x00800000 /* Do not cow file */ # endif +# ifdef FICLONE +# define REFLINK_IOC_CLONE FICLONE +# endif #endif =20 #if WITH_BLKID @@ -48,6 +51,10 @@ =20 #if HAVE_LINUX_BTRFS_H # include +# define REFLINK_IOC_CLONE BTRFS_IOC_CLONE +#elif HAVE_XFS_XFS_H +# include +# define REFLINK_IOC_CLONE XFS_IOC_CLONE #endif =20 #include "datatypes.h" @@ -80,22 +87,23 @@ VIR_LOG_INIT("storage.storage_util"); * Perform the O(1) btrfs clone operation, if possible. * Upon success, return 0. Otherwise, return -1 and set errno. */ -#if HAVE_LINUX_BTRFS_H +#ifdef REFLINK_IOC_CLONE static inline int -btrfsCloneFile(int dest_fd, int src_fd) +reflinkCloneFile(int dest_fd, int src_fd) { - return ioctl(dest_fd, BTRFS_IOC_CLONE, src_fd); + return ioctl(dest_fd, REFLINK_IOC_CLONE, src_fd); } #else static inline int -btrfsCloneFile(int dest_fd ATTRIBUTE_UNUSED, - int src_fd ATTRIBUTE_UNUSED) +reflinkCloneFile(int dest_fd ATTRIBUTE_UNUSED, + int src_fd ATTRIBUTE_UNUSED) { errno =3D ENOTSUP; return -1; } #endif =20 + static int ATTRIBUTE_NONNULL(2) virStorageBackendCopyToFD(virStorageVolDefPtr vol, virStorageVolDefPtr inputvol, @@ -142,7 +150,7 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol, } =20 if (reflink_copy) { - if (btrfsCloneFile(fd, inputfd) < 0) { + if (reflinkCloneFile(fd, inputfd) < 0) { ret =3D -errno; virReportSystemError(errno, _("failed to clone files from '%s'"), --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list