From 1c5b97acbf7f505cd7f6dcbcea210b309bc6ec1a Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Mon, 19 Mar 2012 09:20:01 +0100 Subject: [PATCH 5/5] monitor: fix client_migrate_info error handling RH-Author: Yonit Halperin Message-id: <1332148801-31396-1-git-send-email-yhalperi@redhat.com> Patchwork-id: 38614 O-Subject: [PATCH RHEL6.3] monitor: fix client_migrate_info error handling Bugzilla: 795652 RH-Acked-by: Alon Levy RH-Acked-by: Gerd Hoffmann RH-Acked-by: Uri Lublin Report QERR_INVALID_PARAMETER when port is missing. Otherwise QERR_UNDEFINED_ERROR will occur. rhbz #795652 upstream: http://patchwork.ozlabs.org/patch/147353/ Signed-off-by: Yonit Halperin --- monitor.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) Signed-off-by: Michal Novotny --- monitor.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/monitor.c b/monitor.c index 0a5b772..b8c394f 100644 --- a/monitor.c +++ b/monitor.c @@ -1282,6 +1282,11 @@ static int client_migrate_info(Monitor *mon, const QDict *qdict, MonitorCompleti return -1; } + if (port == -1 && tls_port == -1) { + qerror_report(QERR_MISSING_PARAMETER, "port/tls-port"); + return -1; + } + ret = qemu_spice_migrate_info(hostname, port, tls_port, subject, cb, opaque); if (ret != 0) { qerror_report(QERR_UNDEFINED_ERROR); @@ -1307,6 +1312,11 @@ static int redhat_spice_migrate_info(Monitor *mon, const QDict *qdict, MonitorCo return -1; } + if (port == -1 && tls_port == -1) { + qerror_report(QERR_MISSING_PARAMETER, "port/tls-port"); + return -1; + } + ret = qemu_spice_migrate_info(hostname, port, tls_port, subject, cb, opaque); if (ret != 0) { qerror_report(QERR_UNDEFINED_ERROR); -- 1.7.7.6