]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainInputDefValidate: Reformat
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 26 May 2022 11:50:23 +0000 (13:50 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 30 May 2022 14:30:09 +0000 (16:30 +0200)
There are some formatting problems with virDomainInputDefValidate().
Reformat it to our standards. Use this opportunity to move error
messages onto a single line.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/conf/domain_validate.c

index 627c366fe9407971c128fc67e6923408bc8aa111..1feb7a8f9c37dc0828aa5ad8eb155e592d1033e9 100644 (file)
@@ -2254,8 +2254,7 @@ virDomainInputDefValidate(const virDomainInputDef *input,
             def->virtType == VIR_DOMAIN_VIRT_PARALLELS) {
             if (input->bus != VIR_DOMAIN_INPUT_BUS_PARALLELS) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("parallels containers don't support "
-                                 "input bus %s"),
+                               _("parallels containers don't support input bus %s"),
                                virDomainInputBusTypeToString(input->bus));
                 return -1;
             }
@@ -2263,52 +2262,48 @@ virDomainInputDefValidate(const virDomainInputDef *input,
             if (input->type != VIR_DOMAIN_INPUT_TYPE_MOUSE &&
                 input->type != VIR_DOMAIN_INPUT_TYPE_KBD) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("parallels bus does not support "
-                                 "%s input device"),
+                               _("parallels bus does not support %s input device"),
                                virDomainInputTypeToString(input->type));
                 return -1;
             }
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("Input devices are not supported by this "
-                             "virtualization driver."));
+                           _("Input devices are not supported by this virtualization driver."));
             return -1;
         }
     }
 
     switch ((virDomainInputType) input->type) {
-        case VIR_DOMAIN_INPUT_TYPE_MOUSE:
-        case VIR_DOMAIN_INPUT_TYPE_TABLET:
-        case VIR_DOMAIN_INPUT_TYPE_KBD:
-            if (input->source.evdev) {
-                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                                _("setting source evdev path only supported for "
-                                  "passthrough input devices"));
-                 return -1;
-            }
-            break;
-
-        case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH:
-            if (input->bus != VIR_DOMAIN_INPUT_BUS_VIRTIO) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("only bus 'virtio' is supported for 'passthrough' "
-                                 "input devices"));
-                return -1;
-            }
-            break;
+    case VIR_DOMAIN_INPUT_TYPE_MOUSE:
+    case VIR_DOMAIN_INPUT_TYPE_TABLET:
+    case VIR_DOMAIN_INPUT_TYPE_KBD:
+        if (input->source.evdev) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("setting source evdev path only supported for passthrough input devices"));
+            return -1;
+        }
+        break;
 
-        case VIR_DOMAIN_INPUT_TYPE_EVDEV:
-            if (input->bus != VIR_DOMAIN_INPUT_BUS_NONE) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("input evdev doesn't support bus element"));
-                return -1;
-            }
-            break;
+    case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH:
+        if (input->bus != VIR_DOMAIN_INPUT_BUS_VIRTIO) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("only bus 'virtio' is supported for 'passthrough' input devices"));
+            return -1;
+        }
+        break;
 
-        case VIR_DOMAIN_INPUT_TYPE_LAST:
-        default:
-            virReportEnumRangeError(virDomainInputType, input->type);
+    case VIR_DOMAIN_INPUT_TYPE_EVDEV:
+        if (input->bus != VIR_DOMAIN_INPUT_BUS_NONE) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("input evdev doesn't support bus element"));
             return -1;
+        }
+        break;
+
+    case VIR_DOMAIN_INPUT_TYPE_LAST:
+    default:
+        virReportEnumRangeError(virDomainInputType, input->type);
+        return -1;
     }
 
     return 0;