2008-02-20 15:34:52 +00:00
|
|
|
/*
|
|
|
|
* storage_driver.h: core driver for storage APIs
|
|
|
|
*
|
2014-02-03 15:12:57 +00:00
|
|
|
* Copyright (C) 2006-2008, 2014 Red Hat, Inc.
|
2008-02-20 15:34:52 +00:00
|
|
|
* Copyright (C) 2006-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
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2008-02-20 15:34:52 +00:00
|
|
|
*
|
|
|
|
* Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_STORAGE_DRIVER_H__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __VIR_STORAGE_DRIVER_H__
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2014-04-08 06:42:57 +00:00
|
|
|
# include <sys/stat.h>
|
|
|
|
|
2014-08-14 16:05:48 +00:00
|
|
|
# include "domain_conf.h"
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "storage_conf.h"
|
2014-04-08 06:42:57 +00:00
|
|
|
# include "virstoragefile.h"
|
2014-02-03 15:12:57 +00:00
|
|
|
|
2014-04-25 11:45:48 +00:00
|
|
|
int virStorageFileInit(virStorageSourcePtr src);
|
|
|
|
int virStorageFileInitAs(virStorageSourcePtr src,
|
|
|
|
uid_t uid, gid_t gid);
|
2014-04-08 10:07:24 +00:00
|
|
|
void virStorageFileDeinit(virStorageSourcePtr src);
|
2014-02-03 15:12:57 +00:00
|
|
|
|
2014-04-08 10:07:24 +00:00
|
|
|
int virStorageFileCreate(virStorageSourcePtr src);
|
|
|
|
int virStorageFileUnlink(virStorageSourcePtr src);
|
|
|
|
int virStorageFileStat(virStorageSourcePtr src,
|
2014-02-03 15:12:57 +00:00
|
|
|
struct stat *stat);
|
2014-03-07 10:53:18 +00:00
|
|
|
ssize_t virStorageFileReadHeader(virStorageSourcePtr src,
|
|
|
|
ssize_t max_len,
|
|
|
|
char **buf);
|
2014-04-22 14:02:54 +00:00
|
|
|
const char *virStorageFileGetUniqueIdentifier(virStorageSourcePtr src);
|
2014-04-26 16:15:41 +00:00
|
|
|
int virStorageFileAccess(virStorageSourcePtr src, int mode);
|
2014-07-09 14:42:10 +00:00
|
|
|
int virStorageFileChown(virStorageSourcePtr src, uid_t uid, gid_t gid);
|
2008-02-20 15:34:52 +00:00
|
|
|
|
2014-07-09 14:52:06 +00:00
|
|
|
bool virStorageFileSupportsSecurityDriver(virStorageSourcePtr src);
|
|
|
|
|
2014-04-24 10:14:01 +00:00
|
|
|
int virStorageFileGetMetadata(virStorageSourcePtr src,
|
|
|
|
uid_t uid, gid_t gid,
|
2014-09-11 16:28:47 +00:00
|
|
|
bool allow_probe,
|
|
|
|
bool report_broken)
|
2014-04-24 10:14:01 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2014-08-14 16:05:48 +00:00
|
|
|
int virStorageTranslateDiskSourcePool(virConnectPtr conn,
|
|
|
|
virDomainDiskDefPtr def);
|
|
|
|
|
2015-11-02 22:15:41 +00:00
|
|
|
virStoragePoolObjPtr virStoragePoolObjFindPoolByUUID(const unsigned char *uuid)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2014-11-26 16:13:00 +00:00
|
|
|
virStoragePoolPtr
|
|
|
|
storagePoolLookupByTargetPath(virConnectPtr conn,
|
|
|
|
const char *path)
|
|
|
|
ATTRIBUTE_NONNULL(2);
|
|
|
|
|
2016-06-21 22:17:51 +00:00
|
|
|
char *virStoragePoolObjBuildTempFilePath(virStoragePoolObjPtr pool,
|
|
|
|
virStorageVolDefPtr vol)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
|
|
|
|
|
2008-02-20 15:34:52 +00:00
|
|
|
int storageRegister(void);
|
|
|
|
|
|
|
|
#endif /* __VIR_STORAGE_DRIVER_H__ */
|