diff options
author | Xiao Guangrong | 2016-10-28 18:35:38 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2016-11-01 18:21:09 +0100 |
commit | 75b0713e189a981e5bfd087d5f35705446bbb12a (patch) | |
tree | 80db861053f54611f44101714aed68d03955eabc /hw/core/hotplug.c | |
parent | nvdimm acpi: prebuild nvdimm devices for available slots (diff) | |
download | qemu-75b0713e189a981e5bfd087d5f35705446bbb12a.tar.gz qemu-75b0713e189a981e5bfd087d5f35705446bbb12a.tar.xz qemu-75b0713e189a981e5bfd087d5f35705446bbb12a.zip |
nvdimm acpi: introduce fit buffer
The buffer is used to save the FIT info for all the presented nvdimm
devices which is updated after the nvdimm device is plugged or
unplugged. In the later patch, it will be used to construct NVDIMM
ACPI _FIT method which reflects the presented nvdimm devices after
nvdimm hotplug
As FIT buffer can not completely mapped into guest address space,
OSPM will exit to QEMU multiple times, however, there is the race
condition - FIT may be changed during these multiple exits, so that
some rules are introduced:
1) the user should hold the @lock to access the buffer and
2) mark @dirty whenever the buffer is updated.
@dirty is cleared for the first time OSPM gets fit buffer, if
dirty is detected in the later access, OSPM will restart the
access
As fit should be updated after nvdimm device is successfully realized
so that a new hotplug callback, post_hotplug, is introduced
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/core/hotplug.c')
-rw-r--r-- | hw/core/hotplug.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/core/hotplug.c b/hw/core/hotplug.c index 17ac986685..ab34c19461 100644 --- a/hw/core/hotplug.c +++ b/hw/core/hotplug.c @@ -35,6 +35,17 @@ void hotplug_handler_plug(HotplugHandler *plug_handler, } } +void hotplug_handler_post_plug(HotplugHandler *plug_handler, + DeviceState *plugged_dev, + Error **errp) +{ + HotplugHandlerClass *hdc = HOTPLUG_HANDLER_GET_CLASS(plug_handler); + + if (hdc->post_plug) { + hdc->post_plug(plug_handler, plugged_dev, errp); + } +} + void hotplug_handler_unplug_request(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) |