]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Move logic from qemuProcessStartValidateShmem to qemuValidateDomainDeviceDefShmem
authorPeter Krempa <pkrempa@redhat.com>
Fri, 23 May 2025 14:43:56 +0000 (16:43 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Jun 2025 11:11:02 +0000 (13:11 +0200)
Move the check to the appropriate central place.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_process.c
src/qemu/qemu_validate.c

index c13a2844735cc0d079a809e7cdce293a95c0ef45..9fbb03ee8b8efbec44f6a5c96dd855b9da93601f 100644 (file)
@@ -5580,26 +5580,6 @@ qemuProcessStartValidateGraphics(virDomainObj *vm)
 }
 
 
-static int
-qemuProcessStartValidateShmem(virDomainObj *vm)
-{
-    size_t i;
-
-    for (i = 0; i < vm->def->nshmems; i++) {
-        virDomainShmemDef *shmem = vm->def->shmems[i];
-
-        if (strchr(shmem->name, '/')) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("shmem name '%1$s' must not contain '/'"),
-                           shmem->name);
-            return -1;
-        }
-    }
-
-    return 0;
-}
-
-
 /* 250 parts per million (ppm) is a half of NTP threshold */
 #define TSC_TOLERANCE 250
 
@@ -5707,9 +5687,6 @@ qemuProcessStartValidate(virQEMUDriver *driver,
     if (qemuProcessStartValidateGraphics(vm) < 0)
         return -1;
 
-    if (qemuProcessStartValidateShmem(vm) < 0)
-        return -1;
-
     if (vm->def->cpu) {
         if (virCPUValidateFeatures(vm->def->os.arch, vm->def->cpu) < 0)
             return -1;
index e45f636418644cd169a3aa3a2538927f0c027545..0e7dd3fc58b5ab28efb8b0617b0961a50139ab28 100644 (file)
@@ -5472,6 +5472,13 @@ static int
 qemuValidateDomainDeviceDefShmem(virDomainShmemDef *shmem,
                                  virQEMUCaps *qemuCaps)
 {
+    if (strchr(shmem->name, '/')) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("shmem name '%1$s' must not contain '/'"),
+                       shmem->name);
+        return -1;
+    }
+
     if (shmem->size > 0) {
         if (shmem->size < 1024 * 1024 ||
             !VIR_IS_POW2(shmem->size)) {