From nobody Thu May 15 09:53:01 2025 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1510836537356759.8970916323021; Thu, 16 Nov 2017 04:48:57 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 129CA7EA9A; Thu, 16 Nov 2017 12:48:56 +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 DF7971748E; Thu, 16 Nov 2017 12:48:55 +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 A6A231800BDC; Thu, 16 Nov 2017 12:48:55 +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 vAGCmZVd004441 for ; Thu, 16 Nov 2017 07:48:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7A4C11748E; Thu, 16 Nov 2017 12:48:35 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id CDDFB2C7D5; Thu, 16 Nov 2017 12:48:34 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 16 Nov 2017 13:47:59 +0100 Message-Id: <7172387a102e64da86308825ba149ae8ebb13b64.1510836337.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 06/11] qemu: block: Add function to check if storage source allows concurrent access 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 16 Nov 2017 12:48:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Storage source format backing a shared device (e.g. running a cluster filesystem) needs to support the sharing so that metadata are not corrupted. Add a central function for checking this. --- src/qemu/qemu_block.c | 15 +++++++++++++++ src/qemu/qemu_block.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 8b23df822..29a341f14 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -390,6 +390,21 @@ qemuBlockGetNodeData(virJSONValuePtr data) } +/** + * qemuBlockStorageSourceSupportsConcurrentAccess: + * @src: disk storage source + * + * Returns true if the given storage format supports concurrent access fro= m two + * separate processes. + */ +bool +qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src) +{ + /* no need to check in backing chain since only RAW storage supports t= his */ + return src->format =3D=3D VIR_STORAGE_FILE_RAW; +} + + /** * qemuBlockStorageSourceGetURI: * @src: disk storage source diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index b9ee97f48..45485733f 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -54,6 +54,9 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, virHashTablePtr qemuBlockGetNodeData(virJSONValuePtr data); +bool +qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src); + virJSONValuePtr qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src); --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list