mirror of
https://github.com/qemu/qemu.git
synced 2025-08-02 04:35:42 +00:00

This patch adds unplug request cb for memory device, and adds the is_removing boolean field to MemStatus. This field is used to indicate whether the memory device in slot has been requested to be ejected. This field is set to true in acpi_memory_unplug_request_cb(). Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
#ifndef QEMU_HW_ACPI_MEMORY_HOTPLUG_H
|
|
#define QEMU_HW_ACPI_MEMORY_HOTPLUG_H
|
|
|
|
#include "hw/qdev-core.h"
|
|
#include "hw/acpi/acpi.h"
|
|
#include "migration/vmstate.h"
|
|
|
|
#define ACPI_MEMORY_HOTPLUG_STATUS 8
|
|
|
|
/**
|
|
* MemStatus:
|
|
* @is_removing: the memory device in slot has been requested to be ejected.
|
|
*
|
|
* This structure stores memory device's status.
|
|
*/
|
|
typedef struct MemStatus {
|
|
DeviceState *dimm;
|
|
bool is_enabled;
|
|
bool is_inserting;
|
|
bool is_removing;
|
|
uint32_t ost_event;
|
|
uint32_t ost_status;
|
|
} MemStatus;
|
|
|
|
typedef struct MemHotplugState {
|
|
bool is_enabled; /* true if memory hotplug is supported */
|
|
MemoryRegion io;
|
|
uint32_t selector;
|
|
uint32_t dev_count;
|
|
MemStatus *devs;
|
|
} MemHotplugState;
|
|
|
|
void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner,
|
|
MemHotplugState *state);
|
|
|
|
void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
|
|
DeviceState *dev, Error **errp);
|
|
void acpi_memory_unplug_request_cb(ACPIREGS *ar, qemu_irq irq,
|
|
MemHotplugState *mem_st,
|
|
DeviceState *dev, Error **errp);
|
|
|
|
extern const VMStateDescription vmstate_memory_hotplug;
|
|
#define VMSTATE_MEMORY_HOTPLUG(memhp, state) \
|
|
VMSTATE_STRUCT(memhp, state, 1, \
|
|
vmstate_memory_hotplug, MemHotplugState)
|
|
|
|
void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list);
|
|
#endif
|