mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemu_hotplug: Report better error message for platform serial devices
This should be better than the current for both hotplug: error: internal error: Invalid target model for serial device and hot-unplug: error: An error occurred, but the cause is unknown which should not be reached at all. Resolves: https://issues.redhat.com/browse/RHEL-66222 Resolves: https://issues.redhat.com/browse/RHEL-66223 Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
52c2e3e0a7
commit
27ae5e602a
@ -2063,6 +2063,12 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver,
|
|||||||
bool need_release = false;
|
bool need_release = false;
|
||||||
bool guestfwd = false;
|
bool guestfwd = false;
|
||||||
|
|
||||||
|
if (qemuChrIsPlatformDevice(vmdef, chr)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("Cannot hotplug platform device"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) {
|
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) {
|
||||||
guestfwd = chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD;
|
guestfwd = chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD;
|
||||||
|
|
||||||
@ -6051,6 +6057,12 @@ qemuDomainDetachDeviceChr(virQEMUDriver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (qemuChrIsPlatformDevice(vmdef, tmpChr)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("Cannot detach platform device"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (vmdef->os.type == VIR_DOMAIN_OSTYPE_HVM &&
|
if (vmdef->os.type == VIR_DOMAIN_OSTYPE_HVM &&
|
||||||
tmpChr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
|
tmpChr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
|
||||||
(tmpChr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL ||
|
(tmpChr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL ||
|
||||||
|
Loading…
Reference in New Issue
Block a user