::
- vol-create pool-or-uuid FILE [--prealloc-metadata]
+ vol-create pool-or-uuid FILE [--prealloc-metadata] [--validate]
Create a volume from an XML <file>.
resulting in higher performance compared to images with no preallocation and
only slightly higher initial disk space usage.
+If *--validate* is specified, validates the format of the XML document against
+an internal RNG schema.
+
**Example:**
::
::
vol-create-from pool-or-uuid FILE vol-name-or-key-or-path
- [--inputpool pool-or-uuid] [--prealloc-metadata] [--reflink]
+ [--inputpool pool-or-uuid] [--prealloc-metadata] [--reflink] [--validate]
Create a volume, using another volume as input.
where the data blocks are copied only when modified.
If this is not possible, the copy fails.
+If *--validate* is specified, validates the format of the XML document against
+an internal RNG schema.
vol-create-as
-------------
typedef enum {
VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA = 1 << 0, /* (Since: 1.0.1) */
VIR_STORAGE_VOL_CREATE_REFLINK = 1 << 1, /* perform a btrfs lightweight copy (Since: 1.2.13) */
+ VIR_STORAGE_VOL_CREATE_VALIDATE = 1 << 2, /* Validate the XML document against schema (Since: 8.10.0) */
} virStorageVolCreateFlags;
virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool,
.type = VSH_OT_BOOL,
.help = N_("preallocate metadata (for qcow2 instead of full allocation)")
},
+ {.name = "validate",
+ .type = VSH_OT_BOOL,
+ .help = N_("validate the XML against the schema")
+ },
{.name = NULL}
};
if (vshCommandOptBool(cmd, "prealloc-metadata"))
flags |= VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA;
+ if (vshCommandOptBool(cmd, "validate"))
+ flags |= VIR_STORAGE_VOL_CREATE_VALIDATE;
+
if (!(pool = virshCommandOptPool(ctl, cmd, "pool", NULL)))
return false;
.type = VSH_OT_BOOL,
.help = N_("use btrfs COW lightweight copy")
},
+ {.name = "validate",
+ .type = VSH_OT_BOOL,
+ .help = N_("validate the XML against the schema")
+ },
{.name = NULL}
};
if (vshCommandOptBool(cmd, "reflink"))
flags |= VIR_STORAGE_VOL_CREATE_REFLINK;
+ if (vshCommandOptBool(cmd, "validate"))
+ flags |= VIR_STORAGE_VOL_CREATE_VALIDATE;
+
if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
return false;