]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: validate RDP configuration
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Sun, 16 Mar 2025 08:18:36 +0000 (12:18 +0400)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 18 Mar 2025 13:15:56 +0000 (14:15 +0100)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_validate.c

index eae75d7bf5ecc4494f7a0844b14c50d02da56d6b..89dee51526689d83efb2100969423c7ae26131cc 100644 (file)
@@ -4484,6 +4484,29 @@ qemuValidateDomainDeviceDefDBusGraphics(const virDomainGraphicsDef *graphics,
 }
 
 
+static int
+qemuValidateDomainDeviceDefRDPGraphics(const virDomainGraphicsDef *graphics)
+{
+    if (graphics->data.rdp.replaceUser) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("RDP doesn't support 'replaceUser'"));
+        return -1;
+    }
+    if (graphics->data.rdp.multiUser) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("RDP doesn't support 'multiUser'"));
+        return -1;
+    }
+    if (graphics->data.rdp.auth.expires) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("RDP password expiration isn't supported"));
+        return -1;
+    }
+
+    return 0;
+}
+
+
 static int
 qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics,
                                     const virDomainDef *def,
@@ -4555,8 +4578,13 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics,
 
         break;
 
-    case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
     case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
+        if (qemuValidateDomainDeviceDefRDPGraphics(graphics) < 0)
+            return -1;
+
+        break;
+
+    case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
     case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
     case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
         break;