diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index c5f101325e..c64544ac47 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3633,7 +3633,11 @@ - + + + [^/]* + + diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 522f49d8b7..8508a6dee9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4589,6 +4589,25 @@ qemuProcessStartValidateIOThreads(virDomainObjPtr vm, } +qemuProcessStartValidateShmem(virDomainObjPtr vm) +{ + size_t i; + + for (i = 0; i < vm->def->nshmems; i++) { + virDomainShmemDefPtr shmem = vm->def->shmems[i]; + + if (strchr(shmem->name, '/')) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("shmem name '%s' must not contain '/'"), + shmem->name); + return -1; + } + } + + return 0; +} + + static int qemuProcessStartValidateXML(virQEMUDriverPtr driver, virDomainObjPtr vm, @@ -4668,6 +4687,9 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, if (qemuProcessStartValidateIOThreads(vm, qemuCaps) < 0) return -1; + if (qemuProcessStartValidateShmem(vm) < 0) + return -1; + VIR_DEBUG("Checking for any possible (non-fatal) issues"); qemuProcessStartWarnShmem(vm);