[libvirt] [PATCH 1/3] qemu: report properer error number when change graphics failed

Wang Rui moon.wangrui at huawei.com
Wed Nov 19 04:50:47 UTC 2014


Signed-off-by: Wang Rui <moon.wangrui at huawei.com>
---
 src/qemu/qemu_hotplug.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index b9a0cee..1c75861 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2347,7 +2347,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
         switch ((virDomainGraphicsListenType) newlisten->type) {
         case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
             if (STRNEQ_NULLABLE(newlisten->address, oldlisten->address)) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                virReportError(VIR_ERR_INVALID_ARG, "%s",
                                dev->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC ?
                                _("cannot change listen address setting on vnc graphics") :
                                _("cannot change listen address setting on spice graphics"));
@@ -2377,12 +2377,12 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
         if ((olddev->data.vnc.autoport != dev->data.vnc.autoport) ||
             (!dev->data.vnc.autoport &&
              (olddev->data.vnc.port != dev->data.vnc.port))) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+            virReportError(VIR_ERR_INVALID_ARG, "%s",
                            _("cannot change port settings on vnc graphics"));
             goto cleanup;
         }
         if (STRNEQ_NULLABLE(olddev->data.vnc.keymap, dev->data.vnc.keymap)) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+            virReportError(VIR_ERR_INVALID_ARG, "%s",
                            _("cannot change keymap setting on vnc graphics"));
             goto cleanup;
         }
@@ -2423,13 +2423,13 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
              (olddev->data.spice.port != dev->data.spice.port)) ||
             (!dev->data.spice.autoport &&
              (olddev->data.spice.tlsPort != dev->data.spice.tlsPort))) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+            virReportError(VIR_ERR_INVALID_ARG, "%s",
                            _("cannot change port settings on spice graphics"));
             goto cleanup;
         }
         if (STRNEQ_NULLABLE(olddev->data.spice.keymap,
                             dev->data.spice.keymap)) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+            virReportError(VIR_ERR_INVALID_ARG, "%s",
                             _("cannot change keymap setting on spice graphics"));
             goto cleanup;
         }
-- 
1.7.12.4





More information about the libvir-list mailing list