From: Ján Tomko Date: Mon, 10 Nov 2014 15:52:49 +0000 (+0100) Subject: Display nicer error message for unsupported chardev hotplug X-Git-Tag: CVE-2014-8135~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cce8e5f7395fef5fa782910bc4a6fc8a786f8bc2;p=thirdparty%2Flibvirt.git Display nicer error message for unsupported chardev hotplug Use the device type name if we know it instead of its number, even if we can't hotplug it: qemuMonitorJSONAttachCharDevCommand:6094 : operation failed: Unsupported char device type '10' --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index aceb14db08..91a7aba1db 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5955,9 +5955,15 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID, case VIR_DOMAIN_CHR_TYPE_STDIO: case VIR_DOMAIN_CHR_TYPE_NMDM: case VIR_DOMAIN_CHR_TYPE_LAST: - virReportError(VIR_ERR_OPERATION_FAILED, - _("Unsupported char device type '%d'"), - chr->type); + if (virDomainChrTypeToString(chr->type)) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Hotplug unsupported for char device type '%s'"), + virDomainChrTypeToString(chr->type)); + } else { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Hotplug unsupported for char device type '%d'"), + chr->type); + } goto error; }