[libvirt] [PATCH 1/3] qemu: report properer error number when change graphics failed
Ján Tomko
jtomko at redhat.com
Thu Dec 4 13:10:21 UTC 2014
On 11/19/2014 05:50 AM, Wang Rui wrote:
> 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",
But the arguments are valid, we just can't change them. I think 'operation
unsupported' would be a better error code.
Jan
> 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;
> }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141204/f6b36aa0/attachment-0001.sig>
More information about the libvir-list
mailing list