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: v1.2.9.1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1aeac2af000c37635b09a4c475b254488c1ec291;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' (cherry picked from commit cce8e5f7395fef5fa782910bc4a6fc8a786f8bc2) --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index b3b6451012..d59166378f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5657,9 +5657,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; }