]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: virDomainMemoryDefValidate: Improve error message v8.5.0-rc2
authorLiu Yiding <liuyd.fnst@fujitsu.com>
Tue, 28 Jun 2022 03:53:35 +0000 (11:53 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 28 Jun 2022 10:33:38 +0000 (12:33 +0200)
An explicit limit would be more user friendly. Add the limit to error message.

Before this commit:
```
error: requested size must be smaller than or equal to @size
```

Now:
```
error: requested size must be smaller than or equal to @size (8388608KiB)
```

Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_validate.c

index 33b6f471596b2b221ec4e59be471f020fda6e6c1..28b0481d4ec396573d05266a332236c4dcdbe359 100644 (file)
@@ -2194,8 +2194,9 @@ virDomainMemoryDefValidate(const virDomainMemoryDef *mem,
 
     case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM:
         if (mem->requestedsize > mem->size) {
-            virReportError(VIR_ERR_XML_DETAIL, "%s",
-                           _("requested size must be smaller than or equal to @size"));
+            virReportError(VIR_ERR_XML_DETAIL,
+                           _("requested size must be smaller than or equal to @size (%lluKiB)"),
+                           mem->size);
             return -1;
         }