qmp: add query-memory-devices command

... allowing to get state of present memory devices.
Currently implemented only for PCDIMMDevice.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
v3:
 * improve PCDIMMDeviceInfo doc comments
 * fix conflict with numa series
v2:
 * fix typos an json syntax in QMP example
 * make 'id' optional to allow command work with
   anonymous memory devices
acpi: introduce TYPE_ACPI_DEVICE_IF interface

... it will be used to abstract generic ACPI bits from
device that implements ACPI interface.

ACPIOSTInfo type is used for passing-through raw _OST
event/status codes reported by guest OS to a management
layer. It lets management tools interpret values
as specified by ACPI spec if it is interested in it.

QEMU doesn't encode these values as enum, since it
doesn't need to handle them and it allows interface
to scale well without any changes in QEMU while guest
OS and management evolves in time.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
v3:
 - fix ACPIOSTInfo docs comments
 - fix sgramar errors in commit message
v2:
 - fix doc comments, describe not described fields
 - add slot-type field with DIMM type for now, which later
   we could extend to PCI slots and probably to CPUs
 - extend commit message describing why source/status
   are raw integers vs enum.
acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices

... using TYPE_ACPI_DEVICE_IF interface.
Which provides status reporting of ACPI declared memory devices

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
v2:
 - set slot-type to DIMM
 - take into account that 'device' field could be optional
qmp: add query-acpi-ospm-status command

... to get ACPI OSPM status reported by ACPI devices
via _OST method.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
qmp: add ACPI_DEVICE_OST event handling

emits event when ACPI OSPM evaluates _OST method
of ACPI device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
v2:
 - move event description at the beginning of file
   to preserve alphabet ordering in file
 - fix example json
numa: handle mmaped memory allocation failure correctly

when memory_region_init_ram_from_file() fails
memory_region_size() will still return size that was
provided at region init time.
Instead use errp to properly detect error condition.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>