A storage volume will generally be either a file or a device
node; <span class="since">since 1.2.0</span>, an optional
output-only attribute <code>type</code> lists the actual type
- (file, block, dir, or network), which is also available
+ (file, block, dir, network, or netdir), which is also available
from <code>virStorageVolGetInfo()</code>. The storage volume
XML format is available <span class="since">since 0.4.1</span>
</p>
<value>block</value>
<value>dir</value>
<value>network</value>
+ <value>netdir</value>
</choice>
</attribute>
</optional>
VIR_STORAGE_VOL_BLOCK = 1, /* Block based volumes */
VIR_STORAGE_VOL_DIR = 2, /* Directory-passthrough based volume */
VIR_STORAGE_VOL_NETWORK = 3, /* Network volumes like RBD (RADOS Block Device) */
+ VIR_STORAGE_VOL_NETDIR = 4, /* Network accessible directory that can
+ * contain other network volumes */
#ifdef VIR_ENUM_SENTINELS
VIR_STORAGE_VOL_LAST
VIR_ENUM_IMPL(virStorageVol,
VIR_STORAGE_VOL_LAST,
- "file", "block", "dir", "network")
+ "file", "block", "dir", "network", "netdir")
VIR_ENUM_IMPL(virStoragePool,
VIR_STORAGE_POOL_LAST,
{
int ret = -1;
- switch (disk->srcpool->voltype) {
+ switch ((virStorageVolType) disk->srcpool->voltype) {
case VIR_STORAGE_VOL_DIR:
if (!disk->readonly) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
}
break;
case VIR_STORAGE_VOL_NETWORK:
+ case VIR_STORAGE_VOL_NETDIR:
+ case VIR_STORAGE_VOL_LAST:
/* Keep the compiler quiet, qemuTranslateDiskSourcePool already
* reported the unsupported error.
*/
- break;
+ goto cleanup;
}
ret = 0;
goto cleanup;
}
- switch (info.type) {
+ switch ((virStorageVolType) info.type) {
case VIR_STORAGE_VOL_FILE:
case VIR_STORAGE_VOL_DIR:
if (!(def->src = virStorageVolGetPath(vol)))
break;
case VIR_STORAGE_VOL_NETWORK:
+ case VIR_STORAGE_VOL_NETDIR:
+ case VIR_STORAGE_VOL_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Using network volume as disk source is not supported"));
goto cleanup;
{
virCheckFlags(0, -1);
- switch (vol->type) {
+ switch ((virStorageVolType) vol->type) {
case VIR_STORAGE_VOL_FILE:
if (unlink(vol->target.path) < 0) {
/* Silently ignore failures where the vol has already gone away */
break;
case VIR_STORAGE_VOL_BLOCK:
case VIR_STORAGE_VOL_NETWORK:
- default:
+ case VIR_STORAGE_VOL_NETDIR:
+ case VIR_STORAGE_VOL_LAST:
virReportError(VIR_ERR_NO_SUPPORT,
_("removing block or network volumes is not supported: %s"),
vol->target.path);
static const char *
vshVolumeTypeToString(int type)
{
- switch (type) {
+ switch ((virStorageVolType) type) {
case VIR_STORAGE_VOL_FILE:
return N_("file");
case VIR_STORAGE_VOL_NETWORK:
return N_("network");
+ case VIR_STORAGE_VOL_NETDIR:
+ return N_("netdir");
+
case VIR_STORAGE_VOL_LAST:
break;
}