提交 0705933b 编写于 作者: E Eric Blake

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: NEric Blake <eblake@redhat.com>
上级 1569fa14
......@@ -671,8 +671,13 @@ virStorageFileMatchesVersion(int format,
static bool
virBackingStoreIsFile(const char *backing)
{
/* Backing store is a network block device or Rados block device */
if (STRPREFIX(backing, "nbd:") || STRPREFIX(backing, "rbd:"))
char *colon = strchr(backing, ':');
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 true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册