util: virstoragefile: Move virStorageIs[File|Relative] to storage_source

There are no other files using it. Move it and make the functions
static.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa
2021-01-22 15:34:33 +01:00
parent db4d7a37ca
commit 04489d9fca
4 changed files with 38 additions and 43 deletions

View File

@@ -37,40 +37,6 @@
VIR_LOG_INIT("util.storagefile");
bool
virStorageIsFile(const char *backing)
{
char *colon;
char *slash;
if (!backing)
return false;
colon = strchr(backing, ':');
slash = strchr(backing, '/');
/* Reject anything that looks like a protocol (such as nbd: or
* rbd:); if someone really does want a relative file name that
* includes ':', they can always prefix './'. */
if (colon && (!slash || colon < slash))
return false;
return true;
}
bool
virStorageIsRelative(const char *backing)
{
if (backing[0] == '/')
return false;
if (!virStorageIsFile(backing))
return false;
return true;
}
#ifdef WITH_UDEV
/* virStorageFileGetSCSIKey
* @path: Path to the SCSI device

View File

@@ -33,9 +33,6 @@ int virStorageFileParseBackingStoreStr(const char *str,
unsigned int *chainIndex)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
bool virStorageIsFile(const char *path);
bool virStorageIsRelative(const char *backing);
int virStorageFileGetSCSIKey(const char *path,
char **key,
bool ignoreError);