All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Introduce a battery, AC adapter, and lid button
@ 2021-01-20 20:54 Leonid Bloch
  2021-01-20 20:54 ` [PATCH 1/4] hw/acpi: Increase the number of possible ACPI interrupts Leonid Bloch
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Leonid Bloch @ 2021-01-20 20:54 UTC (permalink / raw)
  To: Michael S . Tsirkin, Igor Mammedov, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Marcel Apfelbaum
  Cc: Leonid Bloch, qemu-devel

This series introduces the following ACPI devices:

* Battery
* AC adapter
* Laptop lid button

When running QEMU on a laptop, these paravirtualized devices reflect the
state of these physical devices onto the guest. This functionality is
relevant not only for laptops, but also for any other device which has e.g.
a battery. This even allows to insert a ``fake'' battery to the
guest, in a form of a file which emulates the behavior of the actual
battery in sysfs. A possible use case for such a ``fake'' battery can be
limiting the budget of VM usage to a subscriber, in a naturally-visible way.
But of course, the main purpose here is addressing the desktop users.

This series was tested with Windows and (desktop) Linux guests, on which
indeed the battery icon appears in the corresponding state (full,
charging, discharging, time remaining to empty, etc.) and the AC adapter
plugging/unplugging behaves as expected. So is the laptop lid button.

For the ease of review, these commits are also available here:
https://github.com/blochl/qemu/pull/1/commits


Thanks,
Leonid.

Leonid Bloch (4):
  hw/acpi: Increase the number of possible ACPI interrupts
  hw/acpi: Introduce the QEMU Battery
  hw/acpi: Introduce the QEMU AC adapter
  hw/acpi: Introduce the QEMU lid button

 MAINTAINERS                          |  15 +
 docs/specs/acad.txt                  |  24 ++
 docs/specs/battery.txt               |  23 ++
 docs/specs/button.txt                |  35 ++
 hw/acpi/Kconfig                      |  12 +
 hw/acpi/acad.c                       | 318 +++++++++++++++++
 hw/acpi/battery.c                    | 512 +++++++++++++++++++++++++++
 hw/acpi/button.c                     | 327 +++++++++++++++++
 hw/acpi/core.c                       |  17 +-
 hw/acpi/meson.build                  |   3 +
 hw/acpi/trace-events                 |  15 +
 hw/i386/Kconfig                      |   3 +
 hw/i386/acpi-build.c                 | 178 ++++++++++
 include/hw/acpi/acad.h               |  37 ++
 include/hw/acpi/acpi_dev_interface.h |   3 +
 include/hw/acpi/battery.h            |  43 +++
 include/hw/acpi/button.h             |  35 ++
 17 files changed, 1598 insertions(+), 2 deletions(-)
 create mode 100644 docs/specs/acad.txt
 create mode 100644 docs/specs/battery.txt
 create mode 100644 docs/specs/button.txt
 create mode 100644 hw/acpi/acad.c
 create mode 100644 hw/acpi/battery.c
 create mode 100644 hw/acpi/button.c
 create mode 100644 include/hw/acpi/acad.h
 create mode 100644 include/hw/acpi/battery.h
 create mode 100644 include/hw/acpi/button.h

-- 
2.30.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-28  6:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 20:54 [PATCH 0/4] Introduce a battery, AC adapter, and lid button Leonid Bloch
2021-01-20 20:54 ` [PATCH 1/4] hw/acpi: Increase the number of possible ACPI interrupts Leonid Bloch
2021-01-20 20:54 ` [PATCH 2/4] hw/acpi: Introduce the QEMU Battery Leonid Bloch
2021-01-20 20:55 ` [PATCH 3/4] hw/acpi: Introduce the QEMU AC adapter Leonid Bloch
2021-01-20 20:55 ` [PATCH 4/4] hw/acpi: Introduce the QEMU lid button Leonid Bloch
2021-01-20 21:52 ` [PATCH 0/4] Introduce a battery, AC adapter, and " Philippe Mathieu-Daudé
2021-01-21  5:38   ` Leonid Bloch
2021-01-26 14:39     ` Michael S. Tsirkin
2021-01-28  6:02       ` Leonid Bloch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.