mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
util: extract virStorageFile code into storage_source
Up until now we had a runtime code and XML related code in the same source file inside util directory. This patch takes the runtime part and extracts it into the new storage_file directory. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
296032bfb2
commit
01f7ade912
@ -225,6 +225,7 @@
|
|||||||
@SRCDIR@src/storage/storage_util.c
|
@SRCDIR@src/storage/storage_util.c
|
||||||
@SRCDIR@src/storage_file/storage_file_backend_fs.c
|
@SRCDIR@src/storage_file/storage_file_backend_fs.c
|
||||||
@SRCDIR@src/storage_file/storage_file_backend_gluster.c
|
@SRCDIR@src/storage_file/storage_file_backend_gluster.c
|
||||||
|
@SRCDIR@src/storage_file/storage_source.c
|
||||||
@SRCDIR@src/test/test_driver.c
|
@SRCDIR@src/test/test_driver.c
|
||||||
@SRCDIR@src/util/iohelper.c
|
@SRCDIR@src/util/iohelper.c
|
||||||
@SRCDIR@src/util/viralloc.c
|
@SRCDIR@src/util/viralloc.c
|
||||||
|
@ -1618,6 +1618,36 @@ virSecurityManagerVerify;
|
|||||||
virSecurityXATTRNamespaceDefined;
|
virSecurityXATTRNamespaceDefined;
|
||||||
|
|
||||||
|
|
||||||
|
# storage_file/storage_source.h
|
||||||
|
virStorageFileAccess;
|
||||||
|
virStorageFileChainLookup;
|
||||||
|
virStorageFileChown;
|
||||||
|
virStorageFileCreate;
|
||||||
|
virStorageFileDeinit;
|
||||||
|
virStorageFileGetBackingStoreStr;
|
||||||
|
virStorageFileGetMetadata;
|
||||||
|
virStorageFileGetMetadataFromBuf;
|
||||||
|
virStorageFileGetMetadataFromFD;
|
||||||
|
virStorageFileGetRelativeBackingPath;
|
||||||
|
virStorageFileGetUniqueIdentifier;
|
||||||
|
virStorageFileInit;
|
||||||
|
virStorageFileInitAs;
|
||||||
|
virStorageFileRead;
|
||||||
|
virStorageFileReportBrokenChain;
|
||||||
|
virStorageFileStat;
|
||||||
|
virStorageFileSupportsAccess;
|
||||||
|
virStorageFileSupportsBackingChainTraversal;
|
||||||
|
virStorageFileSupportsCreate;
|
||||||
|
virStorageFileSupportsSecurityDriver;
|
||||||
|
virStorageFileUnlink;
|
||||||
|
virStorageSourceNewFromBacking;
|
||||||
|
virStorageSourceNewFromBackingAbsolute;
|
||||||
|
virStorageSourceParseRBDColonString;
|
||||||
|
virStorageSourceUpdateBackingSizes;
|
||||||
|
virStorageSourceUpdateCapacity;
|
||||||
|
virStorageSourceUpdatePhysicalSize;
|
||||||
|
|
||||||
|
|
||||||
# util/glibcompat.h
|
# util/glibcompat.h
|
||||||
vir_g_canonicalize_filename;
|
vir_g_canonicalize_filename;
|
||||||
vir_g_fsync;
|
vir_g_fsync;
|
||||||
@ -3126,36 +3156,15 @@ virStorageAuthDefCopy;
|
|||||||
virStorageAuthDefFormat;
|
virStorageAuthDefFormat;
|
||||||
virStorageAuthDefFree;
|
virStorageAuthDefFree;
|
||||||
virStorageAuthDefParse;
|
virStorageAuthDefParse;
|
||||||
virStorageFileAccess;
|
|
||||||
virStorageFileCanonicalizePath;
|
virStorageFileCanonicalizePath;
|
||||||
virStorageFileChainLookup;
|
|
||||||
virStorageFileChown;
|
|
||||||
virStorageFileCreate;
|
|
||||||
virStorageFileDeinit;
|
|
||||||
virStorageFileFeatureTypeFromString;
|
virStorageFileFeatureTypeFromString;
|
||||||
virStorageFileFeatureTypeToString;
|
virStorageFileFeatureTypeToString;
|
||||||
virStorageFileFormatTypeFromString;
|
virStorageFileFormatTypeFromString;
|
||||||
virStorageFileFormatTypeToString;
|
virStorageFileFormatTypeToString;
|
||||||
virStorageFileGetBackingStoreStr;
|
|
||||||
virStorageFileGetMetadata;
|
|
||||||
virStorageFileGetMetadataFromBuf;
|
|
||||||
virStorageFileGetMetadataFromFD;
|
|
||||||
virStorageFileGetNPIVKey;
|
virStorageFileGetNPIVKey;
|
||||||
virStorageFileGetRelativeBackingPath;
|
|
||||||
virStorageFileGetSCSIKey;
|
virStorageFileGetSCSIKey;
|
||||||
virStorageFileGetUniqueIdentifier;
|
|
||||||
virStorageFileInit;
|
|
||||||
virStorageFileInitAs;
|
|
||||||
virStorageFileParseBackingStoreStr;
|
virStorageFileParseBackingStoreStr;
|
||||||
virStorageFileParseChainIndex;
|
virStorageFileParseChainIndex;
|
||||||
virStorageFileRead;
|
|
||||||
virStorageFileReportBrokenChain;
|
|
||||||
virStorageFileStat;
|
|
||||||
virStorageFileSupportsAccess;
|
|
||||||
virStorageFileSupportsBackingChainTraversal;
|
|
||||||
virStorageFileSupportsCreate;
|
|
||||||
virStorageFileSupportsSecurityDriver;
|
|
||||||
virStorageFileUnlink;
|
|
||||||
virStorageIsFile;
|
virStorageIsFile;
|
||||||
virStorageIsRelative;
|
virStorageIsRelative;
|
||||||
virStorageNetHostDefClear;
|
virStorageNetHostDefClear;
|
||||||
@ -3191,18 +3200,12 @@ virStorageSourceIsSameLocation;
|
|||||||
virStorageSourceNetCookiesValidate;
|
virStorageSourceNetCookiesValidate;
|
||||||
virStorageSourceNetworkAssignDefaultPorts;
|
virStorageSourceNetworkAssignDefaultPorts;
|
||||||
virStorageSourceNew;
|
virStorageSourceNew;
|
||||||
virStorageSourceNewFromBacking;
|
|
||||||
virStorageSourceNewFromBackingAbsolute;
|
|
||||||
virStorageSourceNVMeDefFree;
|
virStorageSourceNVMeDefFree;
|
||||||
virStorageSourceParseRBDColonString;
|
|
||||||
virStorageSourcePoolDefFree;
|
virStorageSourcePoolDefFree;
|
||||||
virStorageSourcePoolModeTypeFromString;
|
virStorageSourcePoolModeTypeFromString;
|
||||||
virStorageSourcePoolModeTypeToString;
|
virStorageSourcePoolModeTypeToString;
|
||||||
virStorageSourcePrivateDataFormatRelPath;
|
virStorageSourcePrivateDataFormatRelPath;
|
||||||
virStorageSourcePrivateDataParseRelPath;
|
virStorageSourcePrivateDataParseRelPath;
|
||||||
virStorageSourceUpdateBackingSizes;
|
|
||||||
virStorageSourceUpdateCapacity;
|
|
||||||
virStorageSourceUpdatePhysicalSize;
|
|
||||||
virStorageTypeFromString;
|
virStorageTypeFromString;
|
||||||
virStorageTypeToString;
|
virStorageTypeToString;
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ if conf.has('WITH_LIBXL')
|
|||||||
include_directories: [
|
include_directories: [
|
||||||
conf_inc_dir,
|
conf_inc_dir,
|
||||||
hypervisor_inc_dir,
|
hypervisor_inc_dir,
|
||||||
|
storage_file_inc_dir,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "domain_conf.h"
|
#include "domain_conf.h"
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virstoragefile.h"
|
#include "storage_source.h"
|
||||||
#include "xen_xl.h"
|
#include "xen_xl.h"
|
||||||
#include "libxl_capabilities.h"
|
#include "libxl_capabilities.h"
|
||||||
#include "libxl_conf.h"
|
#include "libxl_conf.h"
|
||||||
|
@ -104,6 +104,7 @@ if conf.has('WITH_QEMU')
|
|||||||
include_directories: [
|
include_directories: [
|
||||||
conf_inc_dir,
|
conf_inc_dir,
|
||||||
hypervisor_inc_dir,
|
hypervisor_inc_dir,
|
||||||
|
storage_file_inc_dir,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "qemu_checkpoint.h"
|
#include "qemu_checkpoint.h"
|
||||||
#include "qemu_command.h"
|
#include "qemu_command.h"
|
||||||
|
|
||||||
|
#include "storage_source.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virbuffer.h"
|
#include "virbuffer.h"
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "qemu_alias.h"
|
#include "qemu_alias.h"
|
||||||
#include "qemu_security.h"
|
#include "qemu_security.h"
|
||||||
|
|
||||||
|
#include "storage_source.h"
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "virstoragefile.h"
|
#include "virstoragefile.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include "virtime.h"
|
#include "virtime.h"
|
||||||
#include "virnetdevopenvswitch.h"
|
#include "virnetdevopenvswitch.h"
|
||||||
#include "virstoragefile.h"
|
#include "virstoragefile.h"
|
||||||
|
#include "storage_source.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virthreadjob.h"
|
#include "virthreadjob.h"
|
||||||
#include "virprocess.h"
|
#include "virprocess.h"
|
||||||
|
@ -84,6 +84,7 @@
|
|||||||
#include "virhook.h"
|
#include "virhook.h"
|
||||||
#include "virstoragefile.h"
|
#include "virstoragefile.h"
|
||||||
#include "virstoragefileprobe.h"
|
#include "virstoragefileprobe.h"
|
||||||
|
#include "storage_source.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "virfdstream.h"
|
#include "virfdstream.h"
|
||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
#include "virnetdevmidonet.h"
|
#include "virnetdevmidonet.h"
|
||||||
#include "device_conf.h"
|
#include "device_conf.h"
|
||||||
#include "virstoragefile.h"
|
#include "virstoragefile.h"
|
||||||
|
#include "storage_source.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virtime.h"
|
#include "virtime.h"
|
||||||
#include "virqemu.h"
|
#include "virqemu.h"
|
||||||
|
@ -95,6 +95,7 @@
|
|||||||
#include "viridentity.h"
|
#include "viridentity.h"
|
||||||
#include "virthreadjob.h"
|
#include "virthreadjob.h"
|
||||||
#include "virutil.h"
|
#include "virutil.h"
|
||||||
|
#include "storage_source.h"
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virdomainsnapshotobjlist.h"
|
#include "virdomainsnapshotobjlist.h"
|
||||||
#include "virqemu.h"
|
#include "virqemu.h"
|
||||||
|
#include "storage_source.h"
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ if conf.has('WITH_LIBVIRTD') and conf.has('WITH_APPARMOR')
|
|||||||
conf_inc_dir,
|
conf_inc_dir,
|
||||||
hypervisor_inc_dir,
|
hypervisor_inc_dir,
|
||||||
include_directories('.'),
|
include_directories('.'),
|
||||||
|
include_directories('../storage_file'),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include "security_driver.h"
|
#include "security_driver.h"
|
||||||
#include "security_apparmor.h"
|
#include "security_apparmor.h"
|
||||||
|
#include "storage_source.h"
|
||||||
#include "domain_conf.h"
|
#include "domain_conf.h"
|
||||||
#include "virxml.h"
|
#include "virxml.h"
|
||||||
#include "viruuid.h"
|
#include "viruuid.h"
|
||||||
@ -46,7 +47,6 @@
|
|||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
#include "virrandom.h"
|
#include "virrandom.h"
|
||||||
#include "virstoragefile.h"
|
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virgettext.h"
|
#include "virgettext.h"
|
||||||
#include "virhostdev.h"
|
#include "virhostdev.h"
|
||||||
|
@ -79,6 +79,7 @@ if conf.has('WITH_STORAGE')
|
|||||||
],
|
],
|
||||||
include_directories: [
|
include_directories: [
|
||||||
conf_inc_dir,
|
conf_inc_dir,
|
||||||
|
include_directories('../storage_file'),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -162,6 +163,9 @@ if conf.has('WITH_STORAGE_GLUSTER')
|
|||||||
'deps': [
|
'deps': [
|
||||||
glusterfs_dep,
|
glusterfs_dep,
|
||||||
],
|
],
|
||||||
|
'include': [
|
||||||
|
include_directories('../storage_file'),
|
||||||
|
],
|
||||||
'install_dir': storage_backend_install_dir,
|
'install_dir': storage_backend_install_dir,
|
||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "viruri.h"
|
#include "viruri.h"
|
||||||
#include "storage_util.h"
|
#include "storage_util.h"
|
||||||
|
#include "storage_source.h"
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_STORAGE
|
#define VIR_FROM_THIS VIR_FROM_STORAGE
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@
|
|||||||
#include "virstoragefile.h"
|
#include "virstoragefile.h"
|
||||||
#include "virstoragefileprobe.h"
|
#include "virstoragefileprobe.h"
|
||||||
#include "storage_util.h"
|
#include "storage_util.h"
|
||||||
|
#include "storage_source.h"
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "virjson.h"
|
#include "virjson.h"
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
storage_file_sources = [
|
||||||
|
'storage_source.c',
|
||||||
|
]
|
||||||
|
|
||||||
stoarge_file_fs_sources = [
|
stoarge_file_fs_sources = [
|
||||||
'storage_file_backend_fs.c',
|
'storage_file_backend_fs.c',
|
||||||
]
|
]
|
||||||
@ -8,6 +12,18 @@ storage_file_gluster_sources = [
|
|||||||
|
|
||||||
storage_file_install_dir = libdir / 'libvirt' / 'storage-file'
|
storage_file_install_dir = libdir / 'libvirt' / 'storage-file'
|
||||||
|
|
||||||
|
virt_storage_file_lib = static_library(
|
||||||
|
'virt_storage_file',
|
||||||
|
[
|
||||||
|
storage_file_sources,
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
src_dep,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
libvirt_libs += virt_storage_file_lib
|
||||||
|
|
||||||
if conf.has('WITH_STORAGE')
|
if conf.has('WITH_STORAGE')
|
||||||
virt_modules += {
|
virt_modules += {
|
||||||
'name': 'virt_storage_file_fs',
|
'name': 'virt_storage_file_fs',
|
||||||
@ -36,3 +52,5 @@ if conf.has('WITH_STORAGE_GLUSTER')
|
|||||||
'install_dir': storage_file_install_dir,
|
'install_dir': storage_file_install_dir,
|
||||||
}
|
}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
storage_file_inc_dir = include_directories('.')
|
||||||
|
2614
src/storage_file/storage_source.c
Normal file
2614
src/storage_file/storage_source.c
Normal file
File diff suppressed because it is too large
Load Diff
148
src/storage_file/storage_source.h
Normal file
148
src/storage_file/storage_source.h
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
/*
|
||||||
|
* 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 "virstoragefile.h"
|
||||||
|
|
||||||
|
#ifndef DEV_BSIZE
|
||||||
|
# define DEV_BSIZE 512
|
||||||
|
#endif
|
||||||
|
|
||||||
|
virStorageSourcePtr
|
||||||
|
virStorageFileGetMetadataFromFD(const char *path,
|
||||||
|
int fd,
|
||||||
|
int format);
|
||||||
|
|
||||||
|
virStorageSourcePtr
|
||||||
|
virStorageFileGetMetadataFromBuf(const char *path,
|
||||||
|
char *buf,
|
||||||
|
size_t len,
|
||||||
|
int format)
|
||||||
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
|
virStorageSourcePtr
|
||||||
|
virStorageFileChainLookup(virStorageSourcePtr chain,
|
||||||
|
virStorageSourcePtr startFrom,
|
||||||
|
const char *name,
|
||||||
|
unsigned int idx,
|
||||||
|
virStorageSourcePtr *parent)
|
||||||
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
|
||||||
|
int fd,
|
||||||
|
struct stat const *sb);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageSourceUpdateBackingSizes(virStorageSourcePtr src,
|
||||||
|
int fd,
|
||||||
|
struct stat const *sb);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageSourceUpdateCapacity(virStorageSourcePtr src,
|
||||||
|
char *buf,
|
||||||
|
ssize_t len);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageSourceNewFromBacking(virStorageSourcePtr parent,
|
||||||
|
virStorageSourcePtr *backing);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageSourceParseRBDColonString(const char *rbdstr,
|
||||||
|
virStorageSourcePtr src)
|
||||||
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileGetRelativeBackingPath(virStorageSourcePtr top,
|
||||||
|
virStorageSourcePtr base,
|
||||||
|
char **relpath)
|
||||||
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageSourceNewFromBackingAbsolute(const char *path,
|
||||||
|
virStorageSourcePtr *src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileInit(virStorageSourcePtr src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileInitAs(virStorageSourcePtr src,
|
||||||
|
uid_t uid, gid_t gid);
|
||||||
|
|
||||||
|
void
|
||||||
|
virStorageFileDeinit(virStorageSourcePtr src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileCreate(virStorageSourcePtr src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileUnlink(virStorageSourcePtr src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileStat(virStorageSourcePtr src,
|
||||||
|
struct stat *st);
|
||||||
|
|
||||||
|
ssize_t
|
||||||
|
virStorageFileRead(virStorageSourcePtr src,
|
||||||
|
size_t offset,
|
||||||
|
size_t len,
|
||||||
|
char **buf);
|
||||||
|
|
||||||
|
const char *
|
||||||
|
virStorageFileGetUniqueIdentifier(virStorageSourcePtr src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileAccess(virStorageSourcePtr src,
|
||||||
|
int mode);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileChown(const virStorageSource *src,
|
||||||
|
uid_t uid,
|
||||||
|
gid_t gid);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileSupportsSecurityDriver(const virStorageSource *src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileSupportsAccess(const virStorageSource *src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileSupportsCreate(const virStorageSource *src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileSupportsBackingChainTraversal(const virStorageSource *src);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileGetMetadata(virStorageSourcePtr src,
|
||||||
|
uid_t uid, gid_t gid,
|
||||||
|
bool report_broken)
|
||||||
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
|
int
|
||||||
|
virStorageFileGetBackingStoreStr(virStorageSourcePtr src,
|
||||||
|
char **backing)
|
||||||
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
|
void
|
||||||
|
virStorageFileReportBrokenChain(int errcode,
|
||||||
|
virStorageSourcePtr src,
|
||||||
|
virStorageSourcePtr parent);
|
File diff suppressed because it is too large
Load Diff
@ -388,18 +388,6 @@ struct _virStorageSource {
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageSource, virObjectUnref);
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageSource, virObjectUnref);
|
||||||
|
|
||||||
|
|
||||||
#ifndef DEV_BSIZE
|
|
||||||
# define DEV_BSIZE 512
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virStorageSourcePtr virStorageFileGetMetadataFromFD(const char *path,
|
|
||||||
int fd,
|
|
||||||
int format);
|
|
||||||
virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
|
|
||||||
char *buf,
|
|
||||||
size_t len,
|
|
||||||
int format)
|
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
||||||
int virStorageFileParseChainIndex(const char *diskTarget,
|
int virStorageFileParseChainIndex(const char *diskTarget,
|
||||||
const char *name,
|
const char *name,
|
||||||
unsigned int *chainIndex)
|
unsigned int *chainIndex)
|
||||||
@ -410,13 +398,6 @@ int virStorageFileParseBackingStoreStr(const char *str,
|
|||||||
unsigned int *chainIndex)
|
unsigned int *chainIndex)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
|
||||||
|
|
||||||
virStorageSourcePtr virStorageFileChainLookup(virStorageSourcePtr chain,
|
|
||||||
virStorageSourcePtr startFrom,
|
|
||||||
const char *name,
|
|
||||||
unsigned int idx,
|
|
||||||
virStorageSourcePtr *parent)
|
|
||||||
ATTRIBUTE_NONNULL(1);
|
|
||||||
|
|
||||||
bool virStorageIsFile(const char *path);
|
bool virStorageIsFile(const char *path);
|
||||||
bool virStorageIsRelative(const char *backing);
|
bool virStorageIsRelative(const char *backing);
|
||||||
|
|
||||||
@ -469,15 +450,6 @@ bool virStorageSourceIsEmpty(virStorageSourcePtr src);
|
|||||||
bool virStorageSourceIsBlockLocal(const virStorageSource *src);
|
bool virStorageSourceIsBlockLocal(const virStorageSource *src);
|
||||||
virStorageSourcePtr virStorageSourceNew(void);
|
virStorageSourcePtr virStorageSourceNew(void);
|
||||||
void virStorageSourceBackingStoreClear(virStorageSourcePtr def);
|
void virStorageSourceBackingStoreClear(virStorageSourcePtr def);
|
||||||
int virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
|
|
||||||
int fd, struct stat const *sb);
|
|
||||||
int virStorageSourceUpdateBackingSizes(virStorageSourcePtr src,
|
|
||||||
int fd, struct stat const *sb);
|
|
||||||
int virStorageSourceUpdateCapacity(virStorageSourcePtr src,
|
|
||||||
char *buf, ssize_t len);
|
|
||||||
|
|
||||||
int virStorageSourceNewFromBacking(virStorageSourcePtr parent,
|
|
||||||
virStorageSourcePtr *backing);
|
|
||||||
|
|
||||||
int virStorageSourceNetCookiesValidate(virStorageSourcePtr src);
|
int virStorageSourceNetCookiesValidate(virStorageSourcePtr src);
|
||||||
|
|
||||||
@ -488,10 +460,6 @@ bool virStorageSourceIsSameLocation(virStorageSourcePtr a,
|
|||||||
virStorageSourcePtr b)
|
virStorageSourcePtr b)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int virStorageSourceParseRBDColonString(const char *rbdstr,
|
|
||||||
virStorageSourcePtr src)
|
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*virStorageFileSimplifyPathReadlinkCallback)(const char *path,
|
(*virStorageFileSimplifyPathReadlinkCallback)(const char *path,
|
||||||
char **link,
|
char **link,
|
||||||
@ -500,14 +468,6 @@ char *virStorageFileCanonicalizePath(const char *path,
|
|||||||
virStorageFileSimplifyPathReadlinkCallback cb,
|
virStorageFileSimplifyPathReadlinkCallback cb,
|
||||||
void *cbdata);
|
void *cbdata);
|
||||||
|
|
||||||
int virStorageFileGetRelativeBackingPath(virStorageSourcePtr from,
|
|
||||||
virStorageSourcePtr to,
|
|
||||||
char **relpath)
|
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
|
||||||
|
|
||||||
int virStorageSourceNewFromBackingAbsolute(const char *path,
|
|
||||||
virStorageSourcePtr *src);
|
|
||||||
|
|
||||||
bool virStorageSourceIsRelative(virStorageSourcePtr src);
|
bool virStorageSourceIsRelative(virStorageSourcePtr src);
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -542,39 +502,4 @@ virStorageSourceInitiatorCopy(virStorageSourceInitiatorDefPtr dest,
|
|||||||
void
|
void
|
||||||
virStorageSourceInitiatorClear(virStorageSourceInitiatorDefPtr initiator);
|
virStorageSourceInitiatorClear(virStorageSourceInitiatorDefPtr initiator);
|
||||||
|
|
||||||
int virStorageFileInit(virStorageSourcePtr src);
|
|
||||||
int virStorageFileInitAs(virStorageSourcePtr src,
|
|
||||||
uid_t uid, gid_t gid);
|
|
||||||
void virStorageFileDeinit(virStorageSourcePtr src);
|
|
||||||
|
|
||||||
int virStorageFileCreate(virStorageSourcePtr src);
|
|
||||||
int virStorageFileUnlink(virStorageSourcePtr src);
|
|
||||||
int virStorageFileStat(virStorageSourcePtr src,
|
|
||||||
struct stat *stat);
|
|
||||||
ssize_t virStorageFileRead(virStorageSourcePtr src,
|
|
||||||
size_t offset,
|
|
||||||
size_t len,
|
|
||||||
char **buf);
|
|
||||||
const char *virStorageFileGetUniqueIdentifier(virStorageSourcePtr src);
|
|
||||||
int virStorageFileAccess(virStorageSourcePtr src, int mode);
|
|
||||||
int virStorageFileChown(const virStorageSource *src, uid_t uid, gid_t gid);
|
|
||||||
|
|
||||||
int virStorageFileSupportsSecurityDriver(const virStorageSource *src);
|
|
||||||
int virStorageFileSupportsAccess(const virStorageSource *src);
|
|
||||||
int virStorageFileSupportsCreate(const virStorageSource *src);
|
|
||||||
int virStorageFileSupportsBackingChainTraversal(const virStorageSource *src);
|
|
||||||
|
|
||||||
int virStorageFileGetMetadata(virStorageSourcePtr src,
|
|
||||||
uid_t uid, gid_t gid,
|
|
||||||
bool report_broken)
|
|
||||||
ATTRIBUTE_NONNULL(1);
|
|
||||||
|
|
||||||
int virStorageFileGetBackingStoreStr(virStorageSourcePtr src,
|
|
||||||
char **backing)
|
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
||||||
|
|
||||||
void virStorageFileReportBrokenChain(int errcode,
|
|
||||||
virStorageSourcePtr src,
|
|
||||||
virStorageSourcePtr parent);
|
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageAuthDef, virStorageAuthDefFree);
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageAuthDef, virStorageAuthDefFree);
|
||||||
|
@ -442,7 +442,7 @@ endif
|
|||||||
if conf.has('WITH_QEMU')
|
if conf.has('WITH_QEMU')
|
||||||
tests += [
|
tests += [
|
||||||
{ 'name': 'qemuagenttest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
{ 'name': 'qemuagenttest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
||||||
{ 'name': 'qemublocktest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
{ 'name': 'qemublocktest', 'include': [ storage_file_inc_dir ], 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
||||||
{ 'name': 'qemucapabilitiestest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
{ 'name': 'qemucapabilitiestest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
||||||
{ 'name': 'qemucaps2xmltest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
{ 'name': 'qemucaps2xmltest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
||||||
{ 'name': 'qemucommandutiltest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
{ 'name': 'qemucommandutiltest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] },
|
||||||
@ -509,7 +509,7 @@ endif
|
|||||||
|
|
||||||
if conf.has('WITH_STORAGE_FS')
|
if conf.has('WITH_STORAGE_FS')
|
||||||
tests += [
|
tests += [
|
||||||
{ 'name': 'virstoragetest', 'link_with': [ storage_driver_impl_lib ] },
|
{ 'name': 'virstoragetest', 'include': [ storage_file_inc_dir ],'link_with': [ storage_driver_impl_lib ] },
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "storage_source.h"
|
||||||
#include "testutils.h"
|
#include "testutils.h"
|
||||||
#include "testutilsqemu.h"
|
#include "testutilsqemu.h"
|
||||||
#include "testutilsqemuschema.h"
|
#include "testutilsqemuschema.h"
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "storage_source.h"
|
||||||
#include "testutils.h"
|
#include "testutils.h"
|
||||||
#include "vircommand.h"
|
#include "vircommand.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user