aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Uvarov <maxim.uvarov@linaro.org>2021-06-25 14:18:42 +0300
committerPeter Maydell <peter.maydell@linaro.org>2021-07-02 11:48:36 +0100
commite3bcf57c1a3c498fe7bd1f18744614a802d8859a (patch)
treefe4a1a850341388855a256c1fd154738560bcff9
parent103e7579ddbd539fbe38e150da78264d0496023a (diff)
downloadqemu-e3bcf57c1a3c498fe7bd1f18744614a802d8859a.zip
qemu-e3bcf57c1a3c498fe7bd1f18744614a802d8859a.tar.gz
qemu-e3bcf57c1a3c498fe7bd1f18744614a802d8859a.tar.bz2
hw/gpio/gpio_pwr: use shutdown function for reboot
qemu has 2 type of functions: shutdown and reboot. Shutdown function has to be used for machine shutdown. Otherwise we cause a reset with a bogus "cause" value, when we intended a shutdown. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20210625111842.3790-3-maxim.uvarov@linaro.org [PMM: tweaked commit message] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/gpio/gpio_pwr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/gpio/gpio_pwr.c b/hw/gpio/gpio_pwr.c
index 7714fa0..dbaf1c7 100644
--- a/hw/gpio/gpio_pwr.c
+++ b/hw/gpio/gpio_pwr.c
@@ -43,7 +43,7 @@ static void gpio_pwr_reset(void *opaque, int n, int level)
static void gpio_pwr_shutdown(void *opaque, int n, int level)
{
if (level) {
- qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
+ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
}
}