From: Eric Blake Date: Mon, 4 Nov 2013 21:27:42 +0000 (-0700) Subject: storage: recognize gluster as networked file X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0705933b89b8cc69d944ef75e815da6305564ddf;p=libvirt.git 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 --- diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 1b4d4cf85e..8f04b78392 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -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; }