From nobody Sun Feb 8 12:43:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607961388; cv=none; d=zohomail.com; s=zohoarc; b=AA22rvbWoVlXdGKUZEKQXu++9Sy9CVD8r2kxVOXNXPzO4oxyGToMc9S5Nz1tU/5dbNOgSYTQM9A2c2Md7oFJwFVBfuHgbJlMoLdO5w/yVZFAI4wYb9GwICL3/QI0G5R9riy3YDyooJsl0lVDPo/iu8FMrtwQ1m8l8sARQ/JrzF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607961388; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LIAp760JGve8dI0j0ygpGmOjlnCGyhnWD/IDHTE8Rqc=; b=EiGICkcMcfUyqEnfJqPWyyfWvE9CQSAD3XYmwLtGhDDD7kF8xp5pnVW0JbIUWjQahr8xFBEhCU5CvztwqH0Pt0sqWtjgAQ1C0l14d0ERnuqTNiUseOiIhFWXcZGqtFOAasD5138yC3/VKkaLH8jV6+xUZw0KgXb+izNpfhBhsv0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1607961388698712.2493164960194; Mon, 14 Dec 2020 07:56:28 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-348-2ttRYRHjO7SIuzxTwjZYTg-1; Mon, 14 Dec 2020 10:56:21 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 96A921936B7A; Mon, 14 Dec 2020 15:56:13 +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 6F3C262467; Mon, 14 Dec 2020 15:56:13 +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 30BF31809CAD; Mon, 14 Dec 2020 15:56:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BEFtoS5028568 for ; Mon, 14 Dec 2020 10:55:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 64D6717B77; Mon, 14 Dec 2020 15:55:50 +0000 (UTC) Received: from antique-work.lan (unknown [10.40.194.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id D60E65D6D5 for ; Mon, 14 Dec 2020 15:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607961384; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=LIAp760JGve8dI0j0ygpGmOjlnCGyhnWD/IDHTE8Rqc=; b=J4XYgZnD+M22pIwDGCZbdRS8rQ4A4zjJGmELBHoIvyM69YtOOWooUSq9ShbYDBinWSzrNH 5bGeN3+ECdL/2X43gJyAjN8W49RuoweMx5rPYBbqdQvfwg1YttRqYulbQvLi71W/PlSXLS FPQJufd6avagQ/+vhDBfwDSdMy1Wg/Y= X-MC-Unique: 2ttRYRHjO7SIuzxTwjZYTg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 08/17] virstoragefile: move virStorageFileIsClusterFS into virfile Date: Mon, 14 Dec 2020 16:55:28 +0100 Message-Id: <699fa95140f57992834b85055d80003914fa85e4.1607960951.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 2 +- src/qemu/qemu_migration.c | 2 +- src/util/virfile.c | 12 ++++++++++++ src/util/virfile.h | 1 + src/util/virstoragefile.c | 11 ----------- src/util/virstoragefile.h | 1 - 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 2d1cb7786d..57f3b12000 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2087,6 +2087,7 @@ virFileGetXAttr; virFileGetXAttrQuiet; virFileInData; virFileIsCDROM; +virFileIsClusterFS; virFileIsDir; virFileIsExecutable; virFileIsLink; @@ -3144,7 +3145,6 @@ virStorageFileGetSCSIKey; virStorageFileGetUniqueIdentifier; virStorageFileInit; virStorageFileInitAs; -virStorageFileIsClusterFS; virStorageFileParseBackingStoreStr; virStorageFileParseChainIndex; virStorageFileProbeFormat; diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index fcb33d0364..16c9f18e0a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1461,7 +1461,7 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def, } else if (rc =3D=3D 0) { unsafe =3D true; } - if ((rc =3D virStorageFileIsClusterFS(src)) < 0) + if ((rc =3D virFileIsClusterFS(src)) < 0) return false; else if (rc =3D=3D 1) continue; diff --git a/src/util/virfile.c b/src/util/virfile.c index 6e16780e30..3f58b98248 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3709,6 +3709,18 @@ int virFileIsSharedFS(const char *path) } =20 =20 +int virFileIsClusterFS(const char *path) +{ + /* These are coherent cluster filesystems known to be safe for + * migration with cache !=3D none + */ + return virFileIsSharedFSType(path, + VIR_FILE_SHFS_GFS2 | + VIR_FILE_SHFS_OCFS | + VIR_FILE_SHFS_CEPH); +} + + #if defined(__linux__) && defined(WITH_SYS_MOUNT_H) int virFileSetupDev(const char *path, diff --git a/src/util/virfile.h b/src/util/virfile.h index 45b75a059e..733d652ac9 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -223,6 +223,7 @@ enum { =20 int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL= (1); int virFileIsSharedFS(const char *path) ATTRIBUTE_NONNULL(1); +int virFileIsClusterFS(const char *path) ATTRIBUTE_NONNULL(1); int virFileIsMountPoint(const char *file) ATTRIBUTE_NONNULL(1); int virFileIsCDROM(const char *path) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 66694bfcc0..3db85d8b89 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1193,17 +1193,6 @@ virStorageFileGetMetadataFromFD(const char *path, } =20 =20 -int virStorageFileIsClusterFS(const char *path) -{ - /* These are coherent cluster filesystems known to be safe for - * migration with cache !=3D none - */ - return virFileIsSharedFSType(path, - VIR_FILE_SHFS_GFS2 | - VIR_FILE_SHFS_OCFS | - VIR_FILE_SHFS_CEPH); -} - #ifdef WITH_UDEV /* virStorageFileGetSCSIKey * @path: Path to the SCSI device diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 94bb889d84..2452b967b2 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -420,7 +420,6 @@ virStorageSourcePtr virStorageFileChainLookup(virStorag= eSourcePtr chain, virStorageSourcePtr *parent) ATTRIBUTE_NONNULL(1); =20 -int virStorageFileIsClusterFS(const char *path); bool virStorageIsFile(const char *path); bool virStorageIsRelative(const char *backing); =20 --=20 2.28.0