pc-dimm: Drop @errp argument of pc_dimm_plug()
pc_dimm_plug() doesn't use it. It only aborts on error. Drop @errp and adapt the callers accordingly. [dwg: Removed unused label to fix compile] Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <160309728447.2739814.12831204841251148202.stgit@bahia.lan> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
3cff86f036
commit
84fd549619
@ -2261,12 +2261,8 @@ static void virt_memory_plug(HotplugHandler *hotplug_dev,
|
||||
VirtMachineState *vms = VIRT_MACHINE(hotplug_dev);
|
||||
MachineState *ms = MACHINE(hotplug_dev);
|
||||
bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
|
||||
Error *local_err = NULL;
|
||||
|
||||
pc_dimm_plug(PC_DIMM(dev), MACHINE(vms), &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
}
|
||||
pc_dimm_plug(PC_DIMM(dev), MACHINE(vms));
|
||||
|
||||
if (is_nvdimm) {
|
||||
nvdimm_plug(ms->nvdimms_state);
|
||||
@ -2274,9 +2270,6 @@ static void virt_memory_plug(HotplugHandler *hotplug_dev,
|
||||
|
||||
hotplug_handler_plug(HOTPLUG_HANDLER(vms->acpi_dev),
|
||||
dev, &error_abort);
|
||||
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev,
|
||||
|
@ -1265,24 +1265,18 @@ static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
|
||||
static void pc_memory_plug(HotplugHandler *hotplug_dev,
|
||||
DeviceState *dev, Error **errp)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
PCMachineState *pcms = PC_MACHINE(hotplug_dev);
|
||||
X86MachineState *x86ms = X86_MACHINE(hotplug_dev);
|
||||
MachineState *ms = MACHINE(hotplug_dev);
|
||||
bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
|
||||
|
||||
pc_dimm_plug(PC_DIMM(dev), MACHINE(pcms), &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
}
|
||||
pc_dimm_plug(PC_DIMM(dev), MACHINE(pcms));
|
||||
|
||||
if (is_nvdimm) {
|
||||
nvdimm_plug(ms->nvdimms_state);
|
||||
}
|
||||
|
||||
hotplug_handler_plug(x86ms->acpi_dev, dev, &error_abort);
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void pc_memory_unplug_request(HotplugHandler *hotplug_dev,
|
||||
|
@ -64,7 +64,7 @@ void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine,
|
||||
errp);
|
||||
}
|
||||
|
||||
void pc_dimm_plug(PCDIMMDevice *dimm, MachineState *machine, Error **errp)
|
||||
void pc_dimm_plug(PCDIMMDevice *dimm, MachineState *machine)
|
||||
{
|
||||
PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
|
||||
MemoryRegion *vmstate_mr = ddc->get_vmstate_memory_region(dimm,
|
||||
|
@ -3438,10 +3438,7 @@ static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
|
||||
|
||||
size = memory_device_get_region_size(MEMORY_DEVICE(dev), &error_abort);
|
||||
|
||||
pc_dimm_plug(dimm, MACHINE(ms), &local_err);
|
||||
if (local_err) {
|
||||
goto out;
|
||||
}
|
||||
pc_dimm_plug(dimm, MACHINE(ms));
|
||||
|
||||
if (!is_nvdimm) {
|
||||
addr = object_property_get_uint(OBJECT(dimm),
|
||||
@ -3469,7 +3466,6 @@ static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
|
||||
|
||||
out_unplug:
|
||||
pc_dimm_unplug(dimm, MACHINE(ms));
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,6 @@ struct PCDIMMDeviceClass {
|
||||
|
||||
void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine,
|
||||
const uint64_t *legacy_align, Error **errp);
|
||||
void pc_dimm_plug(PCDIMMDevice *dimm, MachineState *machine, Error **errp);
|
||||
void pc_dimm_plug(PCDIMMDevice *dimm, MachineState *machine);
|
||||
void pc_dimm_unplug(PCDIMMDevice *dimm, MachineState *machine);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user