storage: recognize gluster as networked file
A qcow2 file with a backing file of 'gluster://host/vol/file' should not try to look for a directory named './gluster:/' in the file system. * src/util/virstoragefile.c (virBackingStoreIsFile): Broaden check to include all protocols. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
1569fa14d8
commit
0705933b89
@ -671,8 +671,13 @@ virStorageFileMatchesVersion(int format,
|
|||||||
static bool
|
static bool
|
||||||
virBackingStoreIsFile(const char *backing)
|
virBackingStoreIsFile(const char *backing)
|
||||||
{
|
{
|
||||||
/* Backing store is a network block device or Rados block device */
|
char *colon = strchr(backing, ':');
|
||||||
if (STRPREFIX(backing, "nbd:") || STRPREFIX(backing, "rbd:"))
|
char *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 false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user