mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemuMonitorJSONAttachCharDevGetProps: Simplify handling of unsupported types
Use 'virReportEnumRangeError' for the invalid cases and keep the original error for known but unsupported chardevs. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d3af4392f7
commit
1dbb7cef70
@ -6737,16 +6737,14 @@ qemuMonitorJSONAttachCharDevGetProps(const char *chrID,
|
||||
case VIR_DOMAIN_CHR_TYPE_PIPE:
|
||||
case VIR_DOMAIN_CHR_TYPE_STDIO:
|
||||
case VIR_DOMAIN_CHR_TYPE_NMDM:
|
||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
_("Hotplug unsupported for char device type '%s'"),
|
||||
virDomainChrTypeToString(chr->type));
|
||||
return NULL;
|
||||
|
||||
case VIR_DOMAIN_CHR_TYPE_LAST:
|
||||
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);
|
||||
}
|
||||
default:
|
||||
virReportEnumRangeError(virDomainChrType, chr->type);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user