libvirt/src/storage_file/storage_source.h
Michal Privoznik c8238579fb lib: Drop internal virXXXPtr typedefs
Historically, we declared pointer type to our types:

  typedef struct _virXXX virXXX;
  typedef virXXX *virXXXPtr;

But usefulness of such declaration is questionable, at best.
Unfortunately, we can't drop every such declaration - we have to
carry some over, because they are part of public API (e.g.
virDomainPtr). But for internal types - we can do drop them and
use what every other C project uses 'virXXX *'.

This change was generated by a very ugly shell script that
generated sed script which was then called over each file in the
repository. For the shell script refer to the cover letter:

https://listman.redhat.com/archives/libvir-list/2021-March/msg00537.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-04-13 17:00:38 +02:00

147 lines
4.3 KiB
C

/*
* storage_source.h: file utility functions for FS storage backend
*
* Copyright (C) 2007-2009, 2012-2016 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "storage_source_conf.h"
#ifndef DEV_BSIZE
# define DEV_BSIZE 512
#endif
virStorageSource *
virStorageSourceGetMetadataFromFD(const char *path,
int fd,
int format);
virStorageSource *
virStorageSourceGetMetadataFromBuf(const char *path,
char *buf,
size_t len,
int format)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
virStorageSource *
virStorageSourceChainLookup(virStorageSource *chain,
virStorageSource *startFrom,
const char *name,
const char *diskTarget,
virStorageSource **parent)
ATTRIBUTE_NONNULL(1);
int
virStorageSourceUpdatePhysicalSize(virStorageSource *src,
int fd,
struct stat const *sb);
int
virStorageSourceUpdateBackingSizes(virStorageSource *src,
int fd,
struct stat const *sb);
int
virStorageSourceUpdateCapacity(virStorageSource *src,
char *buf,
ssize_t len);
int
virStorageSourceNewFromBacking(virStorageSource *parent,
virStorageSource **backing);
int
virStorageSourceParseRBDColonString(const char *rbdstr,
virStorageSource *src)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int
virStorageSourceGetRelativeBackingPath(virStorageSource *top,
virStorageSource *base,
char **relpath)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int
virStorageSourceNewFromBackingAbsolute(const char *path,
virStorageSource **src);
int
virStorageSourceInit(virStorageSource *src);
int
virStorageSourceInitAs(virStorageSource *src,
uid_t uid, gid_t gid);
void
virStorageSourceDeinit(virStorageSource *src);
int
virStorageSourceCreate(virStorageSource *src);
int
virStorageSourceUnlink(virStorageSource *src);
int
virStorageSourceStat(virStorageSource *src,
struct stat *st);
ssize_t
virStorageSourceRead(virStorageSource *src,
size_t offset,
size_t len,
char **buf);
int
virStorageSourceAccess(virStorageSource *src,
int mode);
int
virStorageSourceChown(const virStorageSource *src,
uid_t uid,
gid_t gid);
int
virStorageSourceSupportsSecurityDriver(const virStorageSource *src);
int
virStorageSourceSupportsAccess(const virStorageSource *src);
int
virStorageSourceSupportsCreate(const virStorageSource *src);
int
virStorageSourceSupportsBackingChainTraversal(const virStorageSource *src);
int
virStorageSourceGetMetadata(virStorageSource *src,
uid_t uid, gid_t gid,
size_t max_depth,
bool report_broken)
ATTRIBUTE_NONNULL(1);
int
virStorageSourceFetchRelativeBackingPath(virStorageSource *src,
char **relPath)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void
virStorageSourceReportBrokenChain(int errcode,
virStorageSource *src,
virStorageSource *parent);