mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/loongarch/virt: Replace destination error with error_abort
In function virt_cpu_plug() and virt_cpu_unplug(), the error is impossile. Destination error is not propagated and replaced with error_abort. With this, the logic is simple. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Acked-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20250324030145.3037408-3-maobibo@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn>
This commit is contained in:
parent
988ad4cceb
commit
fa0dde12db
1 changed files with 7 additions and 32 deletions
|
@ -936,29 +936,15 @@ static void virt_cpu_unplug(HotplugHandler *hotplug_dev,
|
||||||
DeviceState *dev, Error **errp)
|
DeviceState *dev, Error **errp)
|
||||||
{
|
{
|
||||||
CPUArchId *cpu_slot;
|
CPUArchId *cpu_slot;
|
||||||
Error *err = NULL;
|
|
||||||
LoongArchCPU *cpu = LOONGARCH_CPU(dev);
|
LoongArchCPU *cpu = LOONGARCH_CPU(dev);
|
||||||
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(hotplug_dev);
|
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(hotplug_dev);
|
||||||
|
|
||||||
/* Notify ipi and extioi irqchip to remove interrupt routing to CPU */
|
/* Notify ipi and extioi irqchip to remove interrupt routing to CPU */
|
||||||
hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->ipi), dev, &err);
|
hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->ipi), dev, &error_abort);
|
||||||
if (err) {
|
hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->extioi), dev, &error_abort);
|
||||||
error_propagate(errp, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->extioi), dev, &err);
|
|
||||||
if (err) {
|
|
||||||
error_propagate(errp, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Notify acpi ged CPU removed */
|
/* Notify acpi ged CPU removed */
|
||||||
hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->acpi_ged), dev, &err);
|
hotplug_handler_unplug(HOTPLUG_HANDLER(lvms->acpi_ged), dev, &error_abort);
|
||||||
if (err) {
|
|
||||||
error_propagate(errp, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cpu_slot = virt_find_cpu_slot(MACHINE(lvms), cpu->phy_id);
|
cpu_slot = virt_find_cpu_slot(MACHINE(lvms), cpu->phy_id);
|
||||||
cpu_slot->cpu = NULL;
|
cpu_slot->cpu = NULL;
|
||||||
|
@ -971,29 +957,18 @@ static void virt_cpu_plug(HotplugHandler *hotplug_dev,
|
||||||
CPUArchId *cpu_slot;
|
CPUArchId *cpu_slot;
|
||||||
LoongArchCPU *cpu = LOONGARCH_CPU(dev);
|
LoongArchCPU *cpu = LOONGARCH_CPU(dev);
|
||||||
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(hotplug_dev);
|
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(hotplug_dev);
|
||||||
Error *err = NULL;
|
|
||||||
|
|
||||||
if (lvms->ipi) {
|
if (lvms->ipi) {
|
||||||
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), dev, &err);
|
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), dev, &error_abort);
|
||||||
if (err) {
|
|
||||||
error_propagate(errp, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lvms->extioi) {
|
if (lvms->extioi) {
|
||||||
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->extioi), dev, &err);
|
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->extioi), dev, &error_abort);
|
||||||
if (err) {
|
|
||||||
error_propagate(errp, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lvms->acpi_ged) {
|
if (lvms->acpi_ged) {
|
||||||
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->acpi_ged), dev, &err);
|
hotplug_handler_plug(HOTPLUG_HANDLER(lvms->acpi_ged), dev,
|
||||||
if (err) {
|
&error_abort);
|
||||||
error_propagate(errp, err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cpu_slot = virt_find_cpu_slot(MACHINE(lvms), cpu->phy_id);
|
cpu_slot = virt_find_cpu_slot(MACHINE(lvms), cpu->phy_id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue