From: Leonid Bloch <lb.workbox@gmail.com>
To: "Michael S . Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Eduardo Habkost <ehabkost@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Leonid Bloch <lb.workbox@gmail.com>, qemu-devel@nongnu.org
Subject: [PATCH 0/4] Introduce a battery, AC adapter, and lid button
Date: Wed, 20 Jan 2021 22:54:57 +0200 [thread overview]
Message-ID: <20210120205501.33918-1-lb.workbox@gmail.com> (raw)
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
next reply other threads:[~2021-01-20 20:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 20:54 Leonid Bloch [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210120205501.33918-1-lb.workbox@gmail.com \
--to=lb.workbox@gmail.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).