/* Silently skip '.' and '..'. */
if (STREQ(name, ".") || STREQ(name, ".."))
return 0;
- /* FIXME: support directories. For now, silently skip them. */
- if (S_ISDIR(st->st_mode))
- return 0;
if (VIR_ALLOC(vol) < 0)
goto cleanup;
vol->name) < 0)
goto cleanup;
- vol->type = VIR_STORAGE_VOL_NETWORK;
tmp = state->uri->path;
state->uri->path = vol->key;
if (!(vol->target.path = virURIFormat(state->uri))) {
}
state->uri->path = tmp;
+ if (S_ISDIR(st->st_mode)) {
+ vol->type = VIR_STORAGE_VOL_NETDIR;
+ vol->target.format = VIR_STORAGE_FILE_DIR;
+ *volptr = vol;
+ vol = NULL;
+ ret = 0;
+ goto cleanup;
+ }
+
/* FIXME - must open files to determine if they are non-raw */
+ vol->type = VIR_STORAGE_VOL_NETWORK;
vol->target.format = VIR_STORAGE_FILE_RAW;
vol->capacity = vol->allocation = st->st_size;
--- /dev/null
+<volume type='netdir'>
+ <name>dir</name>
+ <key>vol/dir</key>
+ <source>
+ </source>
+ <capacity unit='bytes'>0</capacity>
+ <allocation unit='bytes'>0</allocation>
+ <target>
+ <format type='dir'/>
+ <path>gluster://example.com/vol/dir</path>
+ </target>
+</volume>
--- /dev/null
+<volume type='netdir'>
+ <name>dir</name>
+ <key>vol/dir</key>
+ <source>
+ </source>
+ <capacity unit='bytes'>0</capacity>
+ <allocation unit='bytes'>0</allocation>
+ <target>
+ <path>gluster://example.com/vol/dir</path>
+ <format type='dir'/>
+ <permissions>
+ <mode>0600</mode>
+ <owner>4294967295</owner>
+ <group>4294967295</group>
+ </permissions>
+ </target>
+</volume>
DO_TEST("pool-logical", "vol-logical");
DO_TEST("pool-logical", "vol-logical-backing");
DO_TEST("pool-sheepdog", "vol-sheepdog");
+ DO_TEST("pool-gluster", "vol-gluster-dir");
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}