<dt><code>shmem</code></dt>
<dd>
The <code>shmem</code> element has one mandatory attribute,
- <code>name</code> to identify the shared memory.
+ <code>name</code> to identify the shared memory. This attribute cannot
+ be directory specific to <code>.</code> or <code>..</code> as well as
+ it cannot involve path separator <code>/</code>.
</dd>
<dt><code>model</code></dt>
<dd>
}
+static int
+virDomainShmemDefValidate(const virDomainShmemDef *shmem)
+{
+ if (strchr(shmem->name, '/')) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("shmem name cannot include '/' character"));
+ return -1;
+ }
+
+ if (STREQ(shmem->name, ".")) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("shmem name cannot be equal to '.'"));
+ return -1;
+ }
+
+ if (STREQ(shmem->name, "..")) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("shmem name cannot be equal to '..'"));
+ return -1;
+ }
+
+ return 0;
+}
+
+
static int
virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev,
const virDomainDef *def)
case VIR_DOMAIN_DEVICE_INPUT:
return virDomainInputDefValidate(dev->data.input);
+ case VIR_DOMAIN_DEVICE_SHMEM:
+ return virDomainShmemDefValidate(dev->data.shmem);
+
case VIR_DOMAIN_DEVICE_LEASE:
case VIR_DOMAIN_DEVICE_FS:
case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_HUB:
case VIR_DOMAIN_DEVICE_MEMBALLOON:
case VIR_DOMAIN_DEVICE_NVRAM:
- case VIR_DOMAIN_DEVICE_SHMEM:
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
case VIR_DOMAIN_DEVICE_IOMMU: